mrproliu commented on a change in pull request #4379: Fix ehcache:  missing 
interceptor of private constructor and setName method
URL: https://github.com/apache/skywalking/pull/4379#discussion_r381121129
 
 

 ##########
 File path: 
apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/define/EhcachePluginInstrumentation.java
 ##########
 @@ -82,13 +88,41 @@
                 public String getConstructorInterceptor() {
                     return CONSTRUCTOR_CLASS_INTERCEPT_CLASS;
                 }
+            },
+            new ConstructorInterceptPoint() {
+                @Override
+                public ElementMatcher<MethodDescription> 
getConstructorMatcher() {
+                    return isPrivate().and(takesArgument(0, 
named("net.sf.ehcache.Cache")));
+                }
+
+                @Override
+                public String getConstructorInterceptor() {
+                    return PRIVATE_CONSTRUCTOR_CLASS_INTERCEPT_CLASS;
+                }
             }
         };
     }
 
     @Override
     public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() 
{
         return new InstanceMethodsInterceptPoint[] {
+            new InstanceMethodsInterceptPoint() {
+                @Override
+                public ElementMatcher<MethodDescription> getMethodsMatcher() {
+                    return 
named(CACHE_NAME_ENHANCE_METHOD).and(takesArgument(0, String.class));
+                }
+
+                @Override
+                public String getMethodsInterceptor() {
+                    return CACHE_NAME_INTERCEPTOR_CLASS;
+                }
+
+                @Override
+                public boolean isOverrideArgs() {
+                        return false;
+                    }
 
 Review comment:
   Is this a code format error?

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


With regards,
Apache Git Services

Reply via email to