Skip to content

Commit c3c5f29

Browse files
committed
add nullaway
1 parent 1132997 commit c3c5f29

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
package io.opentelemetry.instrumentation.api.incubator.semconv.db;
77

8+
import static java.util.Objects.requireNonNull;
9+
810
import javax.annotation.Nullable;
911

1012
/** An interface for getting attributes common to database clients. */
@@ -16,7 +18,12 @@ default String getSystem(REQUEST request) {
1618
return null;
1719
}
1820

19-
String getDbSystem(REQUEST request);
21+
// TODO: make this required to implement
22+
default String getDbSystem(REQUEST request) {
23+
// this method will become abstract in
24+
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/14460
25+
return requireNonNull(getSystem(request));
26+
}
2027

2128
@Deprecated
2229
@Nullable

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesGetter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ default Collection<String> getRawQueryTexts(REQUEST request) {
6565
}
6666

6767
// TODO: make this required to implement
68+
@Nullable
6869
default Long getBatchSize(REQUEST request) {
6970
return null;
7071
}

0 commit comments

Comments
 (0)