-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add Configuration Key lombok.builder.toBuilder (Fixes #3758) #3816
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
base: master
Are you sure you want to change the base?
Conversation
… default for @builder annotations. Fixes projectlombok#3758
|
I'm not entirely sure lombok.config is the right place for this sort of thing. Config is always fighting with itself: On one hand, lombok never was intended to be silent magic - the source file on its own without knowing what Then again, your class still has I'll discuss this one with @rspilker before merging. One consideration fighting against this, @Mahmoud-Khawaja, is OpenJDK's plans for LocalDate x = fetchSomeLocalDate();
LocalDate y = x with {
year = 10;
month = 12;
};If that was part of OpenJDK, it reduces the boilerplate considerations (the 'bang' part of the 'bang for the buck' equation that lombok features have to balance out). |
|
Talked it over with @rspilker ; we're going to accept this. |
|
Reviewed the code:
If you could add the name to this PR we can accept it. And we'd take it as a kindness if you rebase it, remove the docker stuff. |
|
done, thanks! |
|
ChatGPT is telling me already that the option is existing, but it seems the PR is still in progress. It would be great to have it included. @Mahmoud-Khawaja |
|
@cruftex Just a life tip: "ChatGPT told me X" means nothing. LLM output has potentially useful creative value and totally, utterly pointless truth value. |
Description
This PR introduces the
lombok.builder.toBuilderconfiguration key, allowingtoBuilder()to be enabled globally for all@Builderannotations vialombok.config. If not explicitly set in the annotation, the configuration value is applied (default:false).Changes
BUILDER_TO_BUILDERkey inConfigurationKeys.java.HandleBuilder.java.This provides more flexibility in testing and code generation.
Fixes #3758.