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
3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 9
9
10
10
import com .google .auto .service .AutoService ;
11
11
import com .google .errorprone .BugPattern ;
12
+ import com .google .errorprone .ErrorProneFlags ;
12
13
import com .google .errorprone .VisitorState ;
13
14
import com .google .errorprone .bugpatterns .BugChecker ;
14
15
import com .google .errorprone .bugpatterns .checkreturnvalue .CanIgnoreReturnValueSuggester ;
15
16
import com .google .errorprone .matchers .Description ;
17
+ import com .google .inject .Inject ;
16
18
import com .sun .source .tree .ClassTree ;
17
19
import com .sun .source .tree .MethodTree ;
18
20
import com .sun .source .util .TreePath ;
@@ -27,7 +29,19 @@ public class OtelCanIgnoreReturnValueSuggester extends BugChecker
27
29
28
30
private static final long serialVersionUID = 1L ;
29
31
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
+ }
31
45
32
46
@ Override
33
47
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(
39
39
40
40
val autoServiceVersion = " 1.1.1"
41
41
val autoValueVersion = " 1.10.4"
42
- val errorProneVersion = " 2.21.1 "
42
+ val errorProneVersion = " 2.22.0 "
43
43
val byteBuddyVersion = " 1.14.8"
44
44
val asmVersion = " 9.5"
45
45
val jmhVersion = " 1.37"
Original file line number Diff line number Diff line change @@ -100,21 +100,20 @@ void synchronousCall() throws ApiException {
100
100
void handleErrorsInSyncCall () {
101
101
mockWebServer .enqueue (
102
102
HttpResponse .of (HttpStatus .valueOf (451 ), MediaType .PLAIN_TEXT_UTF_8 , "42" ));
103
- AtomicReference < ApiException > apiExceptionReference = new AtomicReference <>( null ) ;
103
+ ApiException exception = null ;
104
104
try {
105
105
testing .runWithSpan (
106
106
"parent" ,
107
107
() -> {
108
108
coreV1Api .connectGetNamespacedPodProxy ("name" , "namespace" , "path" );
109
109
});
110
110
} catch (ApiException e ) {
111
- apiExceptionReference . set ( e ) ;
111
+ exception = e ;
112
112
}
113
- assertThat (apiExceptionReference .get ()).isNotNull ();
113
+ ApiException apiException = exception ;
114
+ assertThat (apiException ).isNotNull ();
114
115
assertThat (mockWebServer .takeRequest ().request ().headers ().get ("traceparent" )).isNotBlank ();
115
116
116
- ApiException apiException = apiExceptionReference .get ();
117
-
118
117
testing .waitAndAssertTraces (
119
118
trace ->
120
119
trace .hasSpansSatisfyingExactly (
You can’t perform that action at this time.
0 commit comments