spring-data-commons icon indicating copy to clipboard operation
spring-data-commons copied to clipboard

Invalid @NonNullApi [DATACMNS-1616]

Open spring-projects-issues opened this issue 6 years ago • 1 comments

James Howe opened DATACMNS-1616 and commented

There are some APIs that are designed to work with nulls, but are in packages annotated with @NonNullApi. This generates static analysis warning for any implementers / extenders.

I've not done an exhaustive search, but one example is o.s.d.querydsl.binding.SingleValueBinding#bind

Returns: can be null, in which case the binding will not be incorporated in the overall Predicate .

Attempting to return null will be treated as a mistake


Affects: 2.2.1 (Moore SR1)

spring-projects-issues avatar Nov 14 '19 17:11 spring-projects-issues

James Howe commented

Related: I've also just noticed MultiValueBinding has the same documented return, even though it returns an Optional

spring-projects-issues avatar Nov 14 '19 17:11 spring-projects-issues