6656633: getNotificationInfo methods static mutable
Reviewed-by: emcmanus, jfdenise
--- a/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java Fri Mar 06 12:40:38 2009 +0300
+++ b/jdk/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/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java Fri Mar 06 12:40:38 2009 +0300
+++ b/jdk/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/jdk/src/share/classes/javax/management/monitor/StringMonitor.java Fri Mar 06 12:40:38 2009 +0300
+++ b/jdk/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();
}
/*