8132210: Reinforce JMX collector internals
authorsjiang
Tue, 08 Sep 2015 08:34:35 +0200
changeset 35284 36b96625b545
parent 35283 c5082624b79f
child 35285 c8e399b7825b
8132210: Reinforce JMX collector internals Reviewed-by: jbachorik, ahgross
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;