wu-sheng commented on code in PR #775:
URL: https://github.com/apache/skywalking-java/pull/775#discussion_r2371289752
##########
apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/client/AsyncHttpRequestSendInterceptor.java:
##########
@@ -57,6 +57,12 @@ public void beforeMethod(EnhancedInstance objInst, Method
method, Object[] allAr
span.prepareForAsync();
request.attribute(Constants.SW_JETTY_EXIT_SPAN_KEY, span);
+
+ if (allArguments[0] instanceof Response.Listener) {
+ Response.Listener callback = (Response.Listener) allArguments[0];
+ allArguments[0] = new ResponseListenerWrapper(callback,
ContextManager.capture());
+ return;
+ }
Response.CompleteListener callback = (Response.CompleteListener)
allArguments[0];
Review Comment:
Putting this in else should be better than adding a `return` in L64.
--
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]