changeset 1128:21e38c573956

6656633: getNotificationInfo methods static mutable Reviewed-by: emcmanus, jfdenise
author dfuchs
date Mon, 09 Mar 2009 21:49:56 +0100
parents 51f13571014c
children ea88236be621
files src/share/classes/javax/management/monitor/CounterMonitor.java src/share/classes/javax/management/monitor/GaugeMonitor.java src/share/classes/javax/management/monitor/StringMonitor.java
diffstat 3 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/management/monitor/CounterMonitor.java	Fri Mar 06 12:40:38 2009 +0300
+++ b/src/share/classes/javax/management/monitor/CounterMonitor.java	Mon Mar 09 21:49:56 2009 +0100
@@ -596,7 +596,7 @@
      * types sent by the counter monitor.
      */
     public MBeanNotificationInfo[] getNotificationInfo() {
-        return notifsInfo;
+        return notifsInfo.clone();
     }
 
     /*
--- a/src/share/classes/javax/management/monitor/GaugeMonitor.java	Fri Mar 06 12:40:38 2009 +0300
+++ b/src/share/classes/javax/management/monitor/GaugeMonitor.java	Mon Mar 09 21:49:56 2009 +0100
@@ -478,7 +478,7 @@
      * types sent by the gauge monitor.
      */
     public MBeanNotificationInfo[] getNotificationInfo() {
-        return notifsInfo;
+        return notifsInfo.clone();
     }
 
     /*
--- a/src/share/classes/javax/management/monitor/StringMonitor.java	Fri Mar 06 12:40:38 2009 +0300
+++ b/src/share/classes/javax/management/monitor/StringMonitor.java	Mon Mar 09 21:49:56 2009 +0100
@@ -184,6 +184,7 @@
      * @return The derived gauge of the specified object.
      *
      */
+    @Override
     public synchronized String getDerivedGauge(ObjectName object) {
         return (String) super.getDerivedGauge(object);
     }
@@ -199,6 +200,7 @@
      * @return The derived gauge timestamp of the specified object.
      *
      */
+    @Override
     public synchronized long getDerivedGaugeTimeStamp(ObjectName object) {
         return super.getDerivedGaugeTimeStamp(object);
     }
@@ -341,8 +343,9 @@
      * the Java class of the notification and the notification types sent by
      * the string monitor.
      */
+    @Override
     public MBeanNotificationInfo[] getNotificationInfo() {
-        return notifsInfo;
+        return notifsInfo.clone();
     }
 
     /*