8009034: Improve resulting notifications in JMX
Disallowing access to mutable shared arrays Reviewed-by: dfuchs, mchung, skoivu
This commit is contained in:
parent
c5d1f48f54
commit
9e0c698e00
@ -89,7 +89,7 @@ public class NotificationResult implements Serializable {
|
||||
|
||||
this.earliestSequenceNumber = earliestSequenceNumber;
|
||||
this.nextSequenceNumber = nextSequenceNumber;
|
||||
this.targetedNotifications = targetedNotifications;
|
||||
this.targetedNotifications = (targetedNotifications.length == 0 ? targetedNotifications : targetedNotifications.clone());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -122,7 +122,7 @@ public class NotificationResult implements Serializable {
|
||||
* listeners they correspond to. This array can be empty.
|
||||
*/
|
||||
public TargetedNotification[] getTargetedNotifications() {
|
||||
return targetedNotifications;
|
||||
return targetedNotifications.length == 0 ? targetedNotifications : targetedNotifications.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user