-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
@Builder annotation causes compile error with Java 11 #1907
Comments
Can you try to assign the result of the build method to a local variable first? |
I don't know if we can configure the issue tracker to allow reopening by the reporter. |
I just found out that even the reporter cannot open an issues that they didn't close themselves. |
No problem. Creating a new one and linking the old one is not an issue for me.
I tried this but the behavior did not change. I updated the github repo with my changes. |
It seems this issue is similar to #1877. EDIT: Sorry, I tried again with the project as a clean new maven project: I get the same error as well. So, maven is also affected and it's not gradle specific. |
Here's a real simple test case for it: class BuilderOnConstructor {
@lombok.Builder
BuilderOnConstructor(int a, boolean b) {}
static class BuilderOnConstructorBuilder {
void from() {
a(x()).b(y());
}
}
static int x() {
return 0;
}
static boolean y() {
return true;
}
} |
confirmed failure with error: |
NB: Just plain 'javac' is enough, you don't need gradle or maven to be involved. The chaining is key; if you write |
Great! Thanks! |
Hello!
My code using the
@Builder
annotation does not compile with Java 11 (or Java 10) while it compiles properly with Java 8.As issue #1896 was closed and I could not reopen it, I create this issue to provide the code; please see here: https://github.com/jrmyr/lombokbuilder.
To reproduce the problem, just clone the repo and execute a simple
gradle compileJava
in it. Depending on the Java version in use, it will pass (8) or fail (10, 11). Tested on Mac.Please tell me if you need more info.
Thanks.
The text was updated successfully, but these errors were encountered: