You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/09/25 09:51:29 UTC

[GitHub] wangnimaa commented on a change in pull request #2554: code format

wangnimaa commented on a change in pull request #2554: code format
URL: https://github.com/apache/incubator-dubbo/pull/2554#discussion_r220127882
 
 

 ##########
 File path: dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/ClassGenerator.java
 ##########
 @@ -46,288 +47,345 @@
  * ClassGenerator
  */
 public final class ClassGenerator {
-    private static final AtomicLong CLASS_NAME_COUNTER = new AtomicLong(0);
-    private static final String SIMPLE_NAME_TAG = "<init>";
-    private static final Map<ClassLoader, ClassPool> POOL_MAP = new ConcurrentHashMap<ClassLoader, ClassPool>(); //ClassLoader - ClassPool
-    private ClassPool mPool;
-    private CtClass mCtc;
-    private String mClassName, mSuperClass;
-    private Set<String> mInterfaces;
-    private List<String> mFields, mConstructors, mMethods;
-    private Map<String, Method> mCopyMethods; // <method desc,method instance>
-    private Map<String, Constructor<?>> mCopyConstructors; // <constructor desc,constructor instance>
-    private boolean mDefaultConstructor = false;
-
-    private ClassGenerator() {
-    }
-
-    private ClassGenerator(ClassPool pool) {
-        mPool = pool;
-    }
-
-    public static ClassGenerator newInstance() {
-        return new ClassGenerator(getClassPool(Thread.currentThread().getContextClassLoader()));
-    }
-
-    public static ClassGenerator newInstance(ClassLoader loader) {
-        return new ClassGenerator(getClassPool(loader));
-    }
-
-    public static boolean isDynamicClass(Class<?> cl) {
-        return ClassGenerator.DC.class.isAssignableFrom(cl);
-    }
-
-    public static ClassPool getClassPool(ClassLoader loader) {
-        if (loader == null)
-            return ClassPool.getDefault();
 
-        ClassPool pool = POOL_MAP.get(loader);
-        if (pool == null) {
-            pool = new ClassPool(true);
-            pool.appendClassPath(new LoaderClassPath(loader));
-            POOL_MAP.put(loader, pool);
-        }
-        return pool;
-    }
-
-    private static String modifier(int mod) {
-        StringBuilder modifier = new StringBuilder();
-        if (Modifier.isPublic(mod)) modifier.append("public");
-        if (Modifier.isProtected(mod)) modifier.append("protected");
-        if (Modifier.isPrivate(mod)) modifier.append("private");
-
-        if (Modifier.isStatic(mod)) modifier.append(" static");
-        if (Modifier.isVolatile(mod)) modifier.append(" volatile");
+  private static final AtomicLong CLASS_NAME_COUNTER = new AtomicLong(0);
+  private static final String SIMPLE_NAME_TAG = "<init>";
 
 Review comment:
   ![image](https://user-images.githubusercontent.com/18657682/46007014-853cc500-c0eb-11e8-8169-05d34dce455b.png)
   but he told me 2 blanks

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org