Skip to content

Commit

Permalink
fix webflux cast exception. (apache#2608)
Browse files Browse the repository at this point in the history
* fix

* revert status interceptor.
  • Loading branch information
JaredTan95 authored and wu-sheng committed May 6, 2019
1 parent 12f9991 commit ea347b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;

import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import static org.apache.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMatch.takesArgumentWithType;
import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;

Expand All @@ -48,7 +47,7 @@ public class HttpServerOperations20xInstrumentation extends ClassInstanceMethods
return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named("status").and(takesArguments(1));
return named("status").and(takesArgumentWithType(0, "io.netty.handler.codec.http.HttpResponseStatus"));
}

@Override public String getMethodsInterceptor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;

import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import static org.apache.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMatch.takesArgumentWithType;
import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;

Expand All @@ -48,7 +47,7 @@ public class HttpServerOperations21xInstrumentation extends ClassInstanceMethods
return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named("status").and(takesArguments(1));
return named("status").and(takesArgumentWithType(0, "io.netty.handler.codec.http.HttpResponseStatus"));
}

@Override public String getMethodsInterceptor() {
Expand Down Expand Up @@ -104,4 +103,4 @@ public class HttpServerOperations21xInstrumentation extends ClassInstanceMethods
@Override protected ClassMatch enhanceClass() {
return byName("reactor.netty.http.server.HttpServerOperations");
}
}
}

0 comments on commit ea347b8

Please sign in to comment.