AmarGhugare commented on code in PR #13995:
URL: https://github.com/apache/maven/pull/13995#discussion_r4573221047


##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java:
##########
@@ -44,13 +44,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() {

Review Comment:
   Clarified this in a145d5350e, with the same documentation on both backports. 
The getter now describes the version intervals and the non-null, unmodifiable 
list. It also explains that an empty list makes containsVersion() return false, 
while a recommended version may still be present.



-- 
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]

Reply via email to