changeset 11293:d2d67948c4d2

8132210: Reinforce JMX collector internals Reviewed-by: dfuchs, ahgross
author sjiang
date Fri, 11 Sep 2015 09:04:27 +0200
parents 43fec8fd8706
children 854ad54445c0
files src/share/classes/sun/management/GarbageCollectorImpl.java
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/management/GarbageCollectorImpl.java	Tue Sep 08 22:31:26 2015 +0300
+++ b/src/share/classes/sun/management/GarbageCollectorImpl.java	Fri Sep 11 09:04:27 2015 +0200
@@ -102,17 +102,13 @@
         GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION
     };
 
-    private MBeanNotificationInfo[] notifInfo = null;
+    @Override
     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;