提交 f47e2e27 编写于 作者: J jbachorik

8009034: Improve resulting notifications in JMX

Summary: Disallowing access to mutable shared arrays
Reviewed-by: dfuchs, mchung, skoivu
上级 93f7ec53
...@@ -89,7 +89,7 @@ public class NotificationResult implements Serializable { ...@@ -89,7 +89,7 @@ public class NotificationResult implements Serializable {
this.earliestSequenceNumber = earliestSequenceNumber; this.earliestSequenceNumber = earliestSequenceNumber;
this.nextSequenceNumber = nextSequenceNumber; this.nextSequenceNumber = nextSequenceNumber;
this.targetedNotifications = targetedNotifications; this.targetedNotifications = (targetedNotifications.length == 0 ? targetedNotifications : targetedNotifications.clone());
} }
/** /**
...@@ -122,7 +122,7 @@ public class NotificationResult implements Serializable { ...@@ -122,7 +122,7 @@ public class NotificationResult implements Serializable {
* listeners they correspond to. This array can be empty. * listeners they correspond to. This array can be empty.
*/ */
public TargetedNotification[] getTargetedNotifications() { public TargetedNotification[] getTargetedNotifications() {
return targetedNotifications; return targetedNotifications.length == 0 ? targetedNotifications : targetedNotifications.clone();
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册