# HG changeset patch # User sjiang # Date 1441694075 -7200 # Node ID 36b96625b545b228328f4b0bd1f1d4580270c2a4 # Parent c5082624b79fc3693f812d2216526ab35f844467 8132210: Reinforce JMX collector internals Reviewed-by: jbachorik, ahgross diff -r c5082624b79f -r 36b96625b545 jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java --- a/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java Mon Sep 07 18:58:41 2015 +0300 +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java Tue Sep 08 08:34:35 2015 +0200 @@ -81,17 +81,12 @@ GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION }; - private MBeanNotificationInfo[] notifInfo = null; public MBeanNotificationInfo[] getNotificationInfo() { - synchronized (this) { - if (notifInfo == null) { - notifInfo = new MBeanNotificationInfo[1]; - notifInfo[0] = new MBeanNotificationInfo(gcNotifTypes, - notifName, - "GC Notification"); - } - } - return notifInfo; + return new MBeanNotificationInfo[]{ + new MBeanNotificationInfo(gcNotifTypes, + notifName, + "GC Notification") + }; } private static long seqNumber = 0;