You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2018/11/03 08:29:16 UTC

[GitHub] ni-ze commented on a change in pull request #1875: Correct overriding parent class methods, when method parameters have annotations.More details to see the issue #1740

ni-ze commented on a change in pull request #1875: Correct overriding parent class methods,when method parameters have annotations.More details to see the issue #1740
URL: https://github.com/apache/incubator-skywalking/pull/1875#discussion_r230548676
 
 

 ##########
 File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/interceptor/enhance/ClassEnhancePluginDefine.java
 ##########
 @@ -201,24 +204,26 @@
         for (StaticMethodsInterceptPoint staticMethodsInterceptPoint : staticMethodsInterceptPoints) {
             String interceptor = staticMethodsInterceptPoint.getMethodsInterceptor();
             if (StringUtil.isEmpty(interceptor)) {
-                throw new EnhanceException("no StaticMethodsAroundInterceptor define to enhance class " + enhanceOriginClassName);
+                throw new EnhanceException("no StaticMethodsAroundInterceptor define to enhance class " + typeDescription.getTypeName());
             }
 
             if (staticMethodsInterceptPoint.isOverrideArgs()) {
-                newClassBuilder = newClassBuilder.method(isStatic().and(staticMethodsInterceptPoint.getMethodsMatcher()))
-                    .intercept(
-                        MethodDelegation.withDefaultConfiguration()
-                            .withBinders(
-                                Morph.Binder.install(OverrideCallable.class)
-                            )
-                            .to(new StaticMethodsInterWithOverrideArgs(interceptor))
-                    );
+                newClassBuilder = newClassBuilder.method(not(isDeclaredBy(typeDescription))
 
 Review comment:
   Yes. If this class is a subclass. It have Not declear. this grammar will work when enhance the subclass like com.mysql.jdbc.Driver which the "connect" method does noes decleared by  com.mysql.jdbc.Driver.

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