changeset 35284:36b96625b545

8132210: Reinforce JMX collector internals Reviewed-by: jbachorik, ahgross
author sjiang
date Tue, 08 Sep 2015 08:34:35 +0200
parents c5082624b79f
children c8e399b7825b
files jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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;