Skip to content

Commit 98dbb5f

Browse files
committed
add Initializer annotation
1 parent 06e0c6f commit 98dbb5f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.instrumentation.api.internal;
7+
8+
/**
9+
* See <a href="https://github.com/uber/NullAway/wiki/Supported-Annotations#initialization">NullAway
10+
* spec</a>
11+
*
12+
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
13+
* at any time.
14+
*/
15+
public @interface Initializer {}

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/InstrumenterUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@
1919
* This class is internal and is hence not for public use. Its APIs are unstable and can change at
2020
* any time.
2121
*/
22-
@SuppressWarnings("NullAway") // setters called in static initializer
2322
public final class InstrumenterUtil {
2423

2524
private static InstrumenterAccess instrumenterAccess;
2625
private static InstrumenterBuilderAccess instrumenterBuilderAccess;
2726

27+
@Initializer
2828
public static void setInstrumenterAccess(InstrumenterAccess instrumenterAccess) {
2929
InstrumenterUtil.instrumenterAccess = instrumenterAccess;
3030
}
3131

32+
@Initializer
3233
public static void setInstrumenterBuilderAccess(
3334
InstrumenterBuilderAccess instrumenterBuilderAccess) {
3435
InstrumenterUtil.instrumenterBuilderAccess = instrumenterBuilderAccess;

0 commit comments

Comments
 (0)