@@ -67,43 +67,43 @@ public void transform(TypeTransformer transformer) {
6767 HttpClientInstrumentation .class .getName () + "$SendAsyncAdvice" );
6868 }
6969
70- public static class AdviceLocals {
70+ public static class AdviceScope {
7171 private final Context context ;
7272 private final Context parentContext ;
7373 private final Scope scope ;
7474 private final CallDepth callDepth ;
7575
76- private AdviceLocals (Context parentContext , Context context , Scope scope , CallDepth callDepth ) {
76+ private AdviceScope (Context parentContext , Context context , Scope scope , CallDepth callDepth ) {
7777 this .parentContext = parentContext ;
7878 this .context = context ;
7979 this .scope = scope ;
8080 this .callDepth = callDepth ;
8181 }
8282
8383 @ Nullable
84- public static AdviceLocals start (HttpRequest request ) {
84+ public static AdviceScope start (HttpRequest request ) {
8585 return start (request , null );
8686 }
8787
88- private static AdviceLocals start (HttpRequest request , CallDepth callDepth ) {
88+ private static AdviceScope start (HttpRequest request , CallDepth callDepth ) {
8989 Context parentContext = currentContext ();
9090 if (!instrumenter ().shouldStart (parentContext , request )) {
9191 return null ;
9292 }
9393
9494 Context context = instrumenter ().start (parentContext , request );
95- return new AdviceLocals (parentContext , context , context .makeCurrent (), callDepth );
95+ return new AdviceScope (parentContext , context , context .makeCurrent (), callDepth );
9696 }
9797
9898 public void end (HttpRequest request , HttpResponse <?> response , Throwable throwable ) {
9999 scope .close ();
100100 instrumenter ().end (context , request , response , throwable );
101101 }
102102
103- public static AdviceLocals startWithCallDepth (HttpRequest httpRequest ) {
103+ public static AdviceScope startWithCallDepth (HttpRequest httpRequest ) {
104104 CallDepth callDepth = CallDepth .forClass (HttpClient .class );
105105 if (callDepth .getAndIncrement () > 0 ) {
106- return new AdviceLocals (null , null , null , callDepth );
106+ return new AdviceScope (null , null , null , callDepth );
107107 }
108108 return start (httpRequest , callDepth );
109109 }
@@ -134,19 +134,19 @@ public static class SendAdvice {
134134
135135 @ Nullable
136136 @ Advice .OnMethodEnter (suppress = Throwable .class )
137- public static AdviceLocals methodEnter (@ Advice .Argument (value = 0 ) HttpRequest httpRequest ) {
138- return AdviceLocals .start (httpRequest );
137+ public static AdviceScope methodEnter (@ Advice .Argument (value = 0 ) HttpRequest httpRequest ) {
138+ return AdviceScope .start (httpRequest );
139139 }
140140
141141 @ Advice .OnMethodExit (onThrowable = Throwable .class , suppress = Throwable .class )
142142 public static void methodExit (
143143 @ Advice .Argument (0 ) HttpRequest httpRequest ,
144144 @ Advice .Return HttpResponse <?> httpResponse ,
145145 @ Advice .Thrown Throwable throwable ,
146- @ Advice .Enter @ Nullable AdviceLocals locals ) {
146+ @ Advice .Enter @ Nullable AdviceScope scope ) {
147147
148- if (locals != null ) {
149- locals .end (httpRequest , httpResponse , throwable );
148+ if (scope != null ) {
149+ scope .end (httpRequest , httpResponse , throwable );
150150 }
151151 }
152152 }
@@ -155,8 +155,8 @@ public static void methodExit(
155155 public static class SendAsyncAdvice {
156156
157157 @ Advice .OnMethodEnter (suppress = Throwable .class )
158- public static AdviceLocals methodEnter (@ Advice .Argument (value = 0 ) HttpRequest httpRequest ) {
159- return AdviceLocals .startWithCallDepth (httpRequest );
158+ public static AdviceScope methodEnter (@ Advice .Argument (value = 0 ) HttpRequest httpRequest ) {
159+ return AdviceScope .startWithCallDepth (httpRequest );
160160 }
161161
162162 @ AssignReturned .ToReturned
@@ -165,16 +165,16 @@ public static CompletableFuture<HttpResponse<?>> methodExit(
165165 @ Advice .Argument (value = 0 ) HttpRequest httpRequest ,
166166 @ Advice .Return CompletableFuture <HttpResponse <?>> originalFuture ,
167167 @ Advice .Thrown Throwable throwable ,
168- @ Advice .Enter AdviceLocals locals ) {
168+ @ Advice .Enter AdviceScope scope ) {
169169
170170 @ SuppressWarnings ("UnnecessaryLocalVariable" )
171171 CompletableFuture <HttpResponse <?>> future = originalFuture ;
172172
173- if (!locals .endWithCallDepth (httpRequest , throwable )) {
173+ if (!scope .endWithCallDepth (httpRequest , throwable )) {
174174 return future ;
175175 }
176176
177- return locals .wrapFuture (future , httpRequest );
177+ return scope .wrapFuture (future , httpRequest );
178178 }
179179 }
180180}
0 commit comments