You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for PR! I definitely welcome this functionality, but aside from some refinements I'll have to do (make sure nullability annotations added for when optional accepts nullable etc.), I need to check if this would work correctly in general.
To be clear, instead of warning, we introduce a new notion of isOptionalWithDefault. In all behaviors it will be considered as REGULAR attribute having a default (isGenerateDefault), but we use isOptionalWithDefault to add some convenience. In the light of this, I still feel like warning is not that bad as it still would remind of that this will not act as optional, but as regular with default (+some conveniences). It's not that we need to get warning back, but definitely need to make sure the documentation, at least, tries to explain that. We have a paragraph about that I guess, but we might need to revise it (or add if it's not there).
In any case, I would as if you can, for example add/revise a note to the Value.Default Javadoc explaining what will happen if Default is placed on the Optional attribute: i.e. it will lose optional status, but will retain some conveniences like initializing from the unwrapped value (like next PR if this will be merged by then)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handles Optionals with default value, adds setter and wither methods with the unwrapped type and no longer prints warnings for this case.
Fixes #1432