Skip to content

Enabling annotation based null analysis on the project brings a wrong compiler error in editor for a Java class #1039

@mauromol

Description

@mauromol

It's hard to summarize the problem in a title, but I was able to extract a reproducible test case.
Consider the attached project (create a new workspace, "Import Existing Project Into Workspace", from the attached archive).
TestGroovyNull.zip

Look at the Java class named JavaExt1.
In the Project Explorer all classes seem to compile fine. But if you open the editor on JavaExt1 you'll see this error on line 10:

The method getFoo() is undefined for the type GroovyExt2

If you then go to TestGroovyNull project settings and uncheck Java Compiler | Errors/Warnings | Enable annotation-based null analysis, the above error goes away.
It's not clear to me whether the code is actually compiled or not, and hence it could be run.

Please note that the error also goes away if you keep annotation-based null analysis enabled but remove method test.GroovyExt2.foobar()... really obscure to me why.

This is a bit annoying because it's forcing me to disable annotation-based null analysis on a real project for now.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions