Closed cobratbq closed 9 months ago
@cobratbq NullAway assumes that any type without an annotation is @Nonnull
by default. So writing @Nonnull
explicitly has no effect. I would expect to see an error inside the Bla()
method for a case like this. Do you see anything like that?
@cobratbq NullAway assumes that any type without an annotation is
@Nonnull
by default. So writing@Nonnull
explicitly has no effect. I would expect to see an error inside theBla()
method for a case like this. Do you see anything like that?
The interface is defined for interoperability, so an implementation is not provided. It is expected to be implemented by the user of the library. NullAway, for this code-base, has only the interface and the method calls to work with. (Apart from some tests.)
I am taken by surprise, because this seems to deviate from the practices of other analysis tools that by-default assume plain Java behavior, unless explicitly annotated on invidual cases or per-package.
Regardless, that's my mistake. Explicitly annotating the interface works. Sorry about my false false negative :-P
A violation of
@Nonnull
is not detected when a method is called on an instance received as argument. The function parametertest
of typeInterfaceType
contains a methodBla
that does NOT guarantee@Nonnull
on the return-type. This is not detected as an issue.