TisonKun commented on issue #1276: ZOOKEEPER-3497:Change the constructor of 
MBeanRegistry to private
URL: https://github.com/apache/zookeeper/pull/1276#issuecomment-595004371
 
 
   > > we can remove the setter and change the static instance field to final.
   > 
   > Agree with removing the setter
   > 
   > * `private static MBeanRegistry instance = new MBeanRegistry();` is 
already enough for thread-safe and simply? `volatile` or `final` is no need?
   
   `volatile` in no need. `final` can help the Java compiler & JVM for 
optimization. Thus generally we mark final field as final.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to