Repository navigation
[javadoc] Option.getValues() returns null if there are no values - #456
Open
sergiparpal wants to merge 1 commit into
Open
sergiparpal wants to merge 1 commit into
sergiparpal wants to merge 1 commit into
Conversation
The Javadoc of Option.getValues() says it returns an empty array if there are no values, but it returns null. The Javadoc said null until the pull request for CLI-340 (apache#334, in 1.10.0), which changed it together with getValuesList()'s; that one does return an empty list. getValues() was not changed and still returns null, as getValue() does, and DefaultParserTest's testPropertiesDoNotChangeRegisteredOption() asserts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Javadoc of
Option.getValues()says:When there are no values, the method returns
null:The Javadoc said
nulluntil #334 (CLI-340, released in 1.10.0). That pull request changed it together with the Javadoc ofgetValuesList(), which does return an empty list, butgetValues()itself was not changed. It returnsnull, asgetValue()does, andDefaultParserTest.testPropertiesDoNotChangeRegisteredOption()asserts thatnull. It has returnednullsince 1.0, so returning an empty array instead would change behavior that callers may rely on.This PR puts
nullback in the Javadoc ofgetValues(). It changes Javadoc only.mvn; that'smvnon the command line by itself.