Add Configuration Key lombok.builder.toBuilder (Fixes #3758) - #3816
Add Configuration Key lombok.builder.toBuilder (Fixes #3758)#3816Mahmoud-Khawaja wants to merge 2 commits into
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. |
|
@rzwitserloot Do you think this would be merged soon, for availability into edge? TY |
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.