-
Notifications
You must be signed in to change notification settings - Fork 101
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
Java 21 throws warning with idiomatic Freebuilder usage #466
Comments
What happens if you add an explicit |
It still throws the warning, as it is still a call to a overwritable method from the constructor |
That seems like a bug, since it's not overwriteable if you call the super method. |
🤔 strange. In the meantime, a workaround would be to not set the defaults in the constructor directly but in a static |
I'll leave this open in case anyone has any other advice |
Hello,
while preparing a codebase for the migration to Java 21, we noticed that when you use Freebuilder with default values as described in the README
the Java 21 compiler now throws a warning, failing the compilation if the
-Werror
flag is set.This can be suppressed with
@SuppressWarnings("this-escape")
, but having a cleaner solution would be preferable.The text was updated successfully, but these errors were encountered: