AmarGhugare commented on code in PR #13997:
URL: https://github.com/apache/maven/pull/13997#discussion_r4573221854
##########
maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java:
##########
@@ -46,13 +46,18 @@ public class VersionRange {
private VersionRange(ArtifactVersion recommendedVersion, List<Restriction>
restrictions) {
this.recommendedVersion = recommendedVersion;
- this.restrictions = restrictions;
+ this.restrictions = Collections.unmodifiableList(restrictions);
}
public ArtifactVersion getRecommendedVersion() {
return recommendedVersion;
}
+ /**
+ * Returns the restrictions defining this version range.
+ *
+ * @return the unmodifiable list of restrictions
Review Comment:
Updated in 44876ce3e8. The return value is now documented as non-null and
unmodifiable, with the empty-list behavior explained separately. The same
wording is on master and the 3.9.x backport.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]