Issue
I am supporting a Java 1.8 project (I know, I can see the eyes rolling)
The code base compiles using Maven with no error. Using VS Code there is an error. In order to resolved the error an import is required to access an inner class of a parent class in the current type hierarchy.
The version of Java is enforced by using the Maven Enforcer plugin. And VS Code is correctly configured also.
I think this has started to happened in the last 2 weeks, so I suspect an update to VS Code or an extension is likely to be the cause of the problem.
Solution
It was a bug in a VS Extension. (Which extension or the exact nature of the bug I am unsure. A colleague directed me to this fix.)
To get around this I added the following to the settings.json
:
"java.compile.nullAnalysis.nonnull": [],
"java.compile.nullAnalysis.nullable": [],
Answered By - Brett Walker
Answer Checked By - Cary Denson (JavaFixing Admin)