New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException when using Java 10 and val #1974
Comments
Could it be that it's the raw types? |
I have also seen this with non-generic types (String, MyClass) I think I have seen it with generic types that are properly constrained (Set, List<? extends Number>) |
I am getting this issue with Java 11 and |
Another suggestion: Does this only happen when compiling test code? We've had some other reports about bugs that could only be reproduced when compiling tests. |
Having the same issue when using |
Looks like it happens (in some of these cases) due to the following javac code: @Override
public void visitTypeApply(JCTypeApply tree) {
if (tree.type.hasTag(CLASS)) { // <-- here
// .......
}
} |
I'm having this issue with openjdk 12/lombok 1.18.12 |
When compiling with the Java 10 compiler, maven and lombok 1.18.4, I get the following stack trace below.
The code being compiled looks like
The above code gives an actual error, and I have not been able to get a small test case to reproduce it. This has happened multiple times to me, and it seems to generally involve errors in the expressions being assigned to
val
and often using one type when a different type is needed.This is particularly annoying if you have maven fork the compiler, as then the entire stack trace, including the information about where the error is, disappears.
If inspecting the code does not show a problem, I can also install a custom jar with extra logging / debugging information at the problem point.
The text was updated successfully, but these errors were encountered: