Support empty lower and upper bounds in P2 VersionRange #565
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.
This enables support for version range specifications where the lower or upper bound is not specified and the delimiting bracket is directly next to the separating colon. For example
[1,)
or(,1]
but also(,)
can then be parsed successfully.The type of supported brackets for an empty or unspecified bound is something that's not inherently obvious. From a mathematical perspective an empty bound can be considered equivalent to infinity. And in math may not say inclusive infinity. From that perspective only
[1,infinity)
respectively[1,)
would be permitted, but not[1,]
. But technically infinity has a specific value for P2 versions, i.e.Version.MAX_VERSION
. So if one really wants to cover all possible values, the upper bound still has to be inclusive, i.e.]
. For the lower bound the situation is similar, where0.0.0
or the 'empty'-version is the smallest one possible.Alternatively we could treat no lower bound simply as a synonym for
0.0.0
and no upper bound as synonym forVersion.MAX_VERSION
and consider the bounds as specified?