mxsm opened a new issue, #4698:
URL: https://github.com/apache/rocketmq/issues/4698

   
   
![image](https://user-images.githubusercontent.com/15797831/181179551-733594f0-14f7-4533-b1fb-1e7c0e910f97.png)
   
   These two pieces of code do the same thing. And This code snippet
   ```java
    if (controllerConfig.isEnableControllerInNamesrv()) {
         createAndStartControllerManager();
    }
   ```
   extract method like this:
   ```java
       private static ControllerManager controllerManagerMain() {
           try {
               if (controllerConfig.isEnableControllerInNamesrv()) {
                  return createAndStartControllerManager();
               }
           } catch (Throwable e) {
               e.printStackTrace();
               System.exit(-1);
           }
           return null;
       }
   ```
   then NamesrvStartup.main
   ```java
       public static void main(String[] args) {
           main0(args);
           controllerManagerMain();
       }
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to