I am using intellij IDE for my Spring Boot microservice. I have never used intellij IDE for coding. While writing the REST API, Intellij has added inferred annotation on local variable of my class. So it is creating problem to me to pass the null value in that variable,throwing null pointer exception. The annotation added by Intellij is "@org.jetbrains.annotation.NotNull". I don't know why Intellij showing this behaviour. I just don't want any implicit annotation added by the intellij. Any intellij expert, please help me. I am using centos7 operating system. inferred annotation
- Troubleshooting steps i did:-
- unchecked the box "constant conditional expression"
- restarted the intellij.
- rebuild the mvn project.
Still issue not resolved.
"Annotations aren't physically inserted in the code, but the IDE shows them as if they were in place to help you better understand code contacts"
More details here: https://www.jetbrains.com/help/idea/annotating-source-code.html#8e1a2500
If NPE is thrown, there's a problem in the code. In step 1 you probably switched off an inspection which warned about such null/nonNull being a constant condition.