From 605e712ecd9b7e9088a7b79cd506ff1b088fdac2 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Mon, 9 Mar 2009 21:49:56 +0100 Subject: [PATCH] 6656633: getNotificationInfo methods static mutable Reviewed-by: emcmanus, jfdenise --- .../classes/javax/management/monitor/CounterMonitor.java | 2 +- .../share/classes/javax/management/monitor/GaugeMonitor.java | 2 +- .../classes/javax/management/monitor/StringMonitor.java | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java b/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java index f2f9887b4cd..8105e6fa8aa 100644 --- a/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java +++ b/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java @@ -596,7 +596,7 @@ public class CounterMonitor extends Monitor implements CounterMonitorMBean { * types sent by the counter monitor. */ public MBeanNotificationInfo[] getNotificationInfo() { - return notifsInfo; + return notifsInfo.clone(); } /* diff --git a/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java b/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java index 5ce63fbe532..8fe8700464f 100644 --- a/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java +++ b/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java @@ -478,7 +478,7 @@ public class GaugeMonitor extends Monitor implements GaugeMonitorMBean { * types sent by the gauge monitor. */ public MBeanNotificationInfo[] getNotificationInfo() { - return notifsInfo; + return notifsInfo.clone(); } /* diff --git a/jdk/src/share/classes/javax/management/monitor/StringMonitor.java b/jdk/src/share/classes/javax/management/monitor/StringMonitor.java index 3c2bbc56410..9b4af52d41e 100644 --- a/jdk/src/share/classes/javax/management/monitor/StringMonitor.java +++ b/jdk/src/share/classes/javax/management/monitor/StringMonitor.java @@ -184,6 +184,7 @@ public class StringMonitor extends Monitor implements StringMonitorMBean { * @return The derived gauge of the specified object. * */ + @Override public synchronized String getDerivedGauge(ObjectName object) { return (String) super.getDerivedGauge(object); } @@ -199,6 +200,7 @@ public class StringMonitor extends Monitor implements StringMonitorMBean { * @return The derived gauge timestamp of the specified object. * */ + @Override public synchronized long getDerivedGaugeTimeStamp(ObjectName object) { return super.getDerivedGaugeTimeStamp(object); } @@ -341,8 +343,9 @@ public class StringMonitor extends Monitor implements StringMonitorMBean { * the Java class of the notification and the notification types sent by * the string monitor. */ + @Override public MBeanNotificationInfo[] getNotificationInfo() { - return notifsInfo; + return notifsInfo.clone(); } /*