opentelemetry-java icon indicating copy to clipboard operation
opentelemetry-java copied to clipboard

Investigate if we can/want to make fields and return values @Nonnull by default.

Open Oberon00 opened this issue 5 years ago • 1 comments

https://stackoverflow.com/a/11807961/2128694 suggests there is a way to annotate a package so that fields and/or return values are @Nonnull by default, similarly to the @ParametersAreNonnullByDefault we already use. This answer is for findbugs, but may also work with our errorprone.

Relatedly, we may want to improve checking for these annotations: #1768

Oberon00 avatar Dec 17 '20 16:12 Oberon00

Would a custom annotation like Spring's @NonNullApi work for this project?

I'd be happy to submit a PR to add it. :) Just let me know in which subproject/package it would fit.

edysli avatar Oct 15 '22 18:10 edysli