You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/08/27 13:26:58 UTC

[GitHub] [servicecomb-java-chassis] yhs0092 commented on a change in pull request #1307: [SCB-1448]support class inheritance and interface inheritance with te…

yhs0092 commented on a change in pull request #1307: [SCB-1448]support class inheritance and interface inheritance with te…
URL: https://github.com/apache/servicecomb-java-chassis/pull/1307#discussion_r318078999
 
 

 ##########
 File path: swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/SwaggerGenerator.java
 ##########
 @@ -236,35 +231,13 @@ private boolean isInterfaceReactive(Class<?> interfaceCls) {
     return false;
   }
 
-  /**
-   * Whether this method should be processed as a swagger operation
-   * @return true if this isn't a swagger operation; otherwise, false.
-   */
-  protected boolean isSkipMethod(Method method) {
-    if (method.getDeclaringClass().getName().equals(Object.class.getName())) {
-      return true;
-    }
-    // skip static method
-    int modifiers = method.getModifiers();
-    if (Modifier.isStatic(modifiers)) {
-      return true;
-    }
-    // skip bridge method
-    if (method.isBridge()) {
-      return true;
-    }
-
-    ApiOperation apiOperation = method.getAnnotation(ApiOperation.class);
-    if (apiOperation != null && apiOperation.hidden()) {
-      return apiOperation.hidden();
-    }
-
-    return !context.canProcess(method);
+  protected boolean isSkipMethod(Method m) {
+    return !context.canProcess(m);
   }
 
   protected void scanMethods() {
     // 有时方法顺序不同,很不利于测试,所以先排序
-    List<Method> methods = Arrays.asList(cls.getMethods());
+    List<Method> methods = MethodUtils.findProducerMethods(cls);
     methods.sort(Comparator.comparing(Method::getName));
 
 Review comment:
   Is the sorting operation here redundant? since the `MethodUtils#findProducerMethods` has sorted the methods

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services