opentelemetry-java
opentelemetry-java copied to clipboard
Investigate if we can/want to make fields and return values @Nonnull by default.
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
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.