Review Board 1.7.22


QuorumPeer should unregister only its previsously registered MBeans instead of use MBeanRegistry.unregisterAll() method.

Review Request #2208 - Created Oct. 5, 2011 and updated

César Álvarez Núñez
zookeeper-trunk
ZOOKEEPER-1214
Reviewers
zookeeper
zookeeper
See https://issues.apache.org/jira/browse/ZOOKEEPER-1214
-
Total:
1
Open:
1
Resolved:
0
Dropped:
0
Status:
From:
Review request changed
Updated (Jan. 13, 2012, 12:10 p.m.)
Posted (Jan. 20, 2013, 1:42 p.m.)

   

  
This method is leaking the keySet of a field to outside world. I suggest to change this to either:

1. return new HashSet<ZKMBeanInfo>(mapBean2Path.keySet()); // returns a static snapshot

or 

2. return Collections.unmodifiableSet(mapBean2Path.keySet()); // returns a live view

I prefer the 1st one, but let you decide.