wujimin commented on a change in pull request #699: [SCB-532] Support recursive 
dependency
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/699#discussion_r187761407
 
 

 ##########
 File path: 
common/common-javassist/src/main/java/org/apache/servicecomb/common/javassist/JavassistUtils.java
 ##########
 @@ -185,10 +185,47 @@ private static void addEnumValuesMethod(CtClass ctClass, 
List<String> values) th
         }
       }
 
-      LOGGER.info("generate {} in classLoader {}.", config.getClassName(), 
classLoader);
-      return ctClass.toClass(classLoader, null);
+      LOGGER.info("create CtClass {} in classLoader {}.", 
config.getClassName(), classLoader);
+      return ctClass;
+    } catch (Throwable e) {
+      throw new IllegalStateException(
+          String.format("Failed to create CtClass %s in classLoader %s.", 
config.getClassName(),
+              classLoader), e);
+    }
+  }
+
+  public static Class<?> createClass(ClassLoader classLoader, ClassConfig 
config) {
+    if (classLoader == null) {
 
 Review comment:
   i have test for this
   because already throw exception with error context, invoker already print 
the exception
   if print in this place, then will print multi times.
   
   so i think it's better not log here.
   what's your suggestion?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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