jiacheliu3 commented on code in PR #733:
URL: https://github.com/apache/ratis/pull/733#discussion_r969118520


##########
ratis-server-api/src/main/java/org/apache/ratis/server/RaftServer.java:
##########
@@ -168,21 +172,28 @@ class Builder {
     private static Method initNewRaftServerMethod() {
       final String className = RaftServer.class.getPackage().getName() + 
".impl.ServerImplUtils";
       final Class<?>[] argClasses = {RaftPeerId.class, RaftGroup.class, 
RaftStorage.StartupOption.class,
-          StateMachine.Registry.class, RaftProperties.class, Parameters.class};
+          StateMachine.Registry.class, RaftProperties.class, Parameters.class, 
Thread.UncaughtExceptionHandler.class};
       try {
         final Class<?> clazz = ReflectionUtils.getClassByName(className);
-        return clazz.getMethod("newRaftServer", argClasses);
+        try {
+          return clazz.getMethod("newRaftServer", argClasses);
+        } catch (NoSuchMethodException e) {
+          final Class<?>[] argClassesNoExHandler = {RaftPeerId.class, 
RaftGroup.class, RaftStorage.StartupOption.class,
+              StateMachine.Registry.class, RaftProperties.class, 
Parameters.class};
+          return 
ReflectionUtils.getClassByName(className).getMethod("newRaftServer", 
argClassesNoExHandler);

Review Comment:
   @szetszwo PTAL if this is okay, thanks a lot!



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