gnodet-bot commented on code in PR #13995:
URL: https://github.com/apache/maven/pull/13995#discussion_r4573117312


##########
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:
   ⚠️ **Javadoc `@return` is accurate but incomplete** — it says "the 
unmodifiable list of restrictions" but doesn't describe what an empty list 
means or what a non-empty list represents. Add a brief semantic note.



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