4 Replies Latest reply on Jan 9, 2009 10:29 AM by timfox

    Can it be a final static?

    gaohoward

      This class only has one static member

      public class JMSClientVMIdentifier
      {
       public static String instance = GUIDGenerator.generateGUID();
      }
      


      I think it should be final like

      public class JMSClientVMIdentifier
      {
       public static String instance = GUIDGenerator.generateGUID();
      }
      



        • 1. Re: Can it be a final static?
          gaohoward

          Sorry, should be

          public class JMSClientVMIdentifier
          {
           public static final String instance = GUIDGenerator.generateGUID();
          }
          



          • 2. Re: Can it be a final static?
            timfox

            It help us if you explain why you think it should be changed thus.

            • 3. Re: Can it be a final static?
              gaohoward

              This static is used to identify a JBM process, not only client processes use it, but also the Postoffice use it. So once it is initialized it should never be changed as long as the process is alive. So make it final would be more proper. It will forbid any attempt to change it.

              • 4. Re: Can it be a final static?
                timfox

                 

                "gaohoward" wrote:
                This static is used to identify a JBM process, not only client processes use it, but also the Postoffice use it. So once it is initialized it should never be changed as long as the process is alive. So make it final would be more proper. It will forbid any attempt to change it.


                Ok sure, but it's not a big deal - nothing does change it.