changeset 13514:78fa6f29e5f7

8132210: Reinforce JMX collector internals Reviewed-by: jbachorik, ahgross
author sjiang
date Tue, 08 Sep 2015 08:34:35 +0200
parents 98f0c1f0f3df
children 270887382f1f
files 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/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java	Mon Sep 07 18:58:41 2015 +0300
+++ b/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;