honganan commented on code in PR #704:
URL: https://github.com/apache/skywalking-java/pull/704#discussion_r1671664842


##########
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/AbstractMethodInterceptor.java:
##########
@@ -111,7 +84,7 @@ public void beforeMethod(EnhancedInstance objInst, Method 
method, Object[] allAr
             if (stackDepth == null) {
                 final ContextCarrier contextCarrier = new ContextCarrier();
 
-                if (IN_SERVLET_CONTAINER && IS_JAVAX && 
HttpServletRequest.class.isAssignableFrom(request.getClass())) {
+                if (isAssignableFrom(JAVAX_SERVLET_REQUEST_CLASS, 
request.getClass())) {

Review Comment:
   > `static` block is an important mechanism. You should not remove them all.
   
   The top part of the static block looks a bit redundant. Because when it's 
used, for example:
   ```java
   if (IS_SERVLET_GET_STATUS_METHOD_EXIST && 
HttpServletResponse.class.isAssignableFrom(response.getClass()))
   ```
   If response's class is a subclass of`HttpServletResponse`, it certainly have 
`getStatus()` method.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to