Multiset.Entry.getElement() returns
@ParametricNullness E, which means:
getElement on a Multiset.Entry<@NonNull String> returns @NonNull
String.
getElement on a Multiset.Entry<@Nullable String> returns @Nullable
String.
null,
typically because the type forbids nullable type arguments: For example, ImmutableList.get returns E, but that value is never null. (Accordingly,
ImmutableList is declared to forbid ImmutableList<@Nullable String>.)
null regardless
of the type argument supplied by the user of the class: For example, ImmutableMap.get returns @Nullable E because the method can return null
even on an ImmutableMap<K, @NonNull String>.
Consumers of this annotation include:
ElementTypesAreNonnullByDefault. It is the best we can do for Kotlin
under our current constraints.
Nullable as of version 0.9.9. To treat it that way before then,
you can set -XepOpt:NullAway:CustomNullableAnnotations=com.google.common.base.ParametricNullness,...,com.google.common.util.concurrent.ParametricNullness,
where the ... contains the names of all the other ParametricNullness
annotations in Guava. Or you might prefer to omit Guava from your AnnotatedPackages
list.
NullPointerTester, at least in the Android backport (where the type-use annotations
NullPointerTester would need are not available) and in case of JDK-8202469
This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and tools no longer need it.