File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed
custom-checks/src/main/java/io/opentelemetry/javaagent/customchecks
instrumentation/kubernetes-client-7.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/kubernetesclient Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 99
1010import com .google .auto .service .AutoService ;
1111import com .google .errorprone .BugPattern ;
12+ import com .google .errorprone .ErrorProneFlags ;
1213import com .google .errorprone .VisitorState ;
1314import com .google .errorprone .bugpatterns .BugChecker ;
1415import com .google .errorprone .bugpatterns .checkreturnvalue .CanIgnoreReturnValueSuggester ;
1516import com .google .errorprone .matchers .Description ;
17+ import com .google .inject .Inject ;
1618import com .sun .source .tree .ClassTree ;
1719import com .sun .source .tree .MethodTree ;
1820import com .sun .source .util .TreePath ;
@@ -27,7 +29,19 @@ public class OtelCanIgnoreReturnValueSuggester extends BugChecker
2729
2830 private static final long serialVersionUID = 1L ;
2931
30- private final CanIgnoreReturnValueSuggester delegate = new CanIgnoreReturnValueSuggester ();
32+ private final CanIgnoreReturnValueSuggester delegate ;
33+
34+ @ Inject
35+ OtelCanIgnoreReturnValueSuggester (ErrorProneFlags errorProneFlags ) {
36+ delegate = new CanIgnoreReturnValueSuggester (errorProneFlags );
37+ }
38+
39+ public OtelCanIgnoreReturnValueSuggester () {
40+ // https://errorprone.info/docs/plugins
41+ // this constructor is used by ServiceLoader, actual instance will be created with the other
42+ // constructor
43+ delegate = null ;
44+ }
3145
3246 @ Override
3347 public Description matchMethod (MethodTree methodTree , VisitorState visitorState ) {
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ val DEPENDENCY_BOMS = listOf(
3939
4040val autoServiceVersion = " 1.1.1"
4141val autoValueVersion = " 1.10.4"
42- val errorProneVersion = " 2.21.1 "
42+ val errorProneVersion = " 2.22.0 "
4343val byteBuddyVersion = " 1.14.8"
4444val asmVersion = " 9.5"
4545val jmhVersion = " 1.37"
Original file line number Diff line number Diff line change @@ -100,21 +100,20 @@ void synchronousCall() throws ApiException {
100100 void handleErrorsInSyncCall () {
101101 mockWebServer .enqueue (
102102 HttpResponse .of (HttpStatus .valueOf (451 ), MediaType .PLAIN_TEXT_UTF_8 , "42" ));
103- AtomicReference < ApiException > apiExceptionReference = new AtomicReference <>( null ) ;
103+ ApiException exception = null ;
104104 try {
105105 testing .runWithSpan (
106106 "parent" ,
107107 () -> {
108108 coreV1Api .connectGetNamespacedPodProxy ("name" , "namespace" , "path" );
109109 });
110110 } catch (ApiException e ) {
111- apiExceptionReference . set ( e ) ;
111+ exception = e ;
112112 }
113- assertThat (apiExceptionReference .get ()).isNotNull ();
113+ ApiException apiException = exception ;
114+ assertThat (apiException ).isNotNull ();
114115 assertThat (mockWebServer .takeRequest ().request ().headers ().get ("traceparent" )).isNotBlank ();
115116
116- ApiException apiException = apiExceptionReference .get ();
117-
118117 testing .waitAndAssertTraces (
119118 trace ->
120119 trace .hasSpansSatisfyingExactly (
You can’t perform that action at this time.
0 commit comments