@@ -57,7 +57,7 @@ public static AdviceScope onEnter(@Advice.Argument(0) Request<?> req) {
5757
5858 @ Advice .OnMethodExit (onThrowable = Throwable .class , suppress = Throwable .class )
5959 public static void stopTraceOnResponse (
60- @ Advice .This Object thisAction ,
60+ @ Advice .This Action <?> thisAction ,
6161 @ Advice .Thrown Throwable throwable ,
6262 @ Advice .Argument (0 ) Request <?> req ,
6363 @ Advice .Return (readOnly = false ) Future <Result > responseFuture ,
@@ -66,43 +66,43 @@ public static void stopTraceOnResponse(
6666 return ;
6767 }
6868
69- actionScope .end (throwable , responseFuture , ( Action <?>) thisAction , req );
69+ actionScope .end (throwable , responseFuture , thisAction , req );
7070 }
71- }
72-
73- public static class AdviceScope {
74- private final Context context ;
75- private final Scope scope ;
7671
77- public AdviceScope (Context context , Scope scope ) {
78- this .context = context ;
79- this .scope = scope ;
80- }
72+ public static class AdviceScope {
73+ private final Context context ;
74+ private final Scope scope ;
8175
82- @ Nullable
83- public static AdviceScope start (Context parentContext ) {
84- if (!instrumenter ().shouldStart (parentContext , null )) {
85- return null ;
76+ public AdviceScope (Context context , Scope scope ) {
77+ this .context = context ;
78+ this .scope = scope ;
8679 }
8780
88- Context context = instrumenter ().start (parentContext , null );
89- return new AdviceScope (context , context .makeCurrent ());
90- }
81+ @ Nullable
82+ public static AdviceScope start (Context parentContext ) {
83+ if (!instrumenter ().shouldStart (parentContext , null )) {
84+ return null ;
85+ }
86+
87+ Context context = instrumenter ().start (parentContext , null );
88+ return new AdviceScope (context , context .makeCurrent ());
89+ }
9190
92- public void end (
93- @ Nullable Throwable throwable ,
94- Future <Result > responseFuture ,
95- Action <?> thisAction ,
96- Request <?> req ) {
97- scope .close ();
98- updateSpan (context , req );
99-
100- if (throwable == null ) {
101- // span finished in RequestCompleteCallback
102- responseFuture .onComplete (
103- new RequestCompleteCallback (context ), thisAction .executionContext ());
104- } else {
105- instrumenter ().end (context , null , null , throwable );
91+ public void end (
92+ @ Nullable Throwable throwable ,
93+ Future <Result > responseFuture ,
94+ Action <?> thisAction ,
95+ Request <?> req ) {
96+ scope .close ();
97+ updateSpan (context , req );
98+
99+ if (throwable == null ) {
100+ // span finished in RequestCompleteCallback
101+ responseFuture .onComplete (
102+ new RequestCompleteCallback (context ), thisAction .executionContext ());
103+ } else {
104+ instrumenter ().end (context , null , null , throwable );
105+ }
106106 }
107107 }
108108 }
0 commit comments