Comments (3)
The issue is that you call this.properties.username()
(and password()
) inside a lambda body. NullAway doesn't know when the lambda function will be invoked, and it does not assume that username()
and password()
will remain non-null until that point. If you store this.properties.username()
and password()
in local variables and do both the isNotEmpty()
checks and the uses with those locals, everything will work (since the value of the local variables cannot change).
from nullaway.
I know that the issue is closed, but it is not a similar case?
There is no lambda and nullpointer checks have been made at line 43.
KnownInitializers has been configured with org.apache.commons.collections4.isNotEmpty
-XepOpt:NullAway:KnownInitializers=org.springframework.util.Assert.notNull,org.apache.commons.collections4.isNotEmpty \
-XepOpt:NullAway:CheckOptionalEmptiness=true \
And the error still appears at line 45
[ERROR] /C:/santalucia/workspace/ams-spring-data/ams-spring-data-rest/src/main/java/com/santalucia/arq/ams/data/rest/config/repository/AmsRepositoryRestConfigurer.java:[45,52] [NullAway] dereferenced expression properties.exposeIdsFor() is @Nullable
[ERROR] (see http://t.uber.com/nullaway )
[ERROR] Did you mean '@SuppressWarnings("NullAway") @Override'?
from nullaway.
This is a different case. I don't think the KnownInitializers
flag is being used correctly; that flag is for (most likely inherited) methods that behave like constructors almost and run before other methods in the class:
https://github.com/uber/NullAway/wiki/Configuration#known-initializers
For this case, we seem to be missing a model for the relevant CollectionUtils.isNotEmpty()
method. That would be added around here:
A PR with a fix would be welcome!
from nullaway.
Related Issues (20)
- jdk Files false positive/wrong line HOT 3
- Update JSpecify package in docs HOT 1
- The combination of JSpecify + Lombok does not seem to work well HOT 6
- Method references of nullable instances are not detected HOT 1
- Detected NPE causes EP's Var rule to go nuts. HOT 5
- Validation of null in a switch-case with pattern matching does not work as expected. HOT 1
- False positive warning on switch statements with case null
- Build failure : 'options.compilerArgumentProviders.errorprone$0.name' is missing an input or output annotation. HOT 1
- Support for `collect()` in Streams API HOT 4
- Control flow analysis fails within a stream collector HOT 5
- Validation of null in a method used in a boolean expression does not work as expected. HOT 1
- `if (Foo.this.bar != null)` in nested class not properly analyzed HOT 1
- Rename the Jar Infer Flags `JarInferEnabled`,`JarInferUseReturnAnnotations`
- Variable checked non-null outside a `forEach` or `Stream` lambda triggers an error HOT 13
- `if` statement on a boolean does not prevent a dereferenced nullable error HOT 1
- Null `if` check and failing function to taken in account HOT 2
- Extract methods in StreamNullabilityPropagator
- ignoring generic Nullable on Supplier HOT 14
- Published NonNull Present HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nullaway.