You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/03/05 03:04:41 UTC

[GitHub] [zookeeper] TisonKun commented on issue #1276: ZOOKEEPER-3497:Change the constructor of MBeanRegistry to private

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:
users@infra.apache.org


With regards,
Apache Git Services