MartinKanters commented on a change in pull request #446:
URL: https://github.com/apache/maven/pull/446#discussion_r575807350



##########
File path: 
maven-core/src/main/java/org/apache/maven/execution/ProfileActivation.java
##########
@@ -74,7 +44,7 @@ static ActivationSettings of( final boolean active, final 
boolean optional )
     @Deprecated
     public List<String> getActiveProfiles()
     {
-        return new ArrayList<>( getProfileIds( pa -> pa.active ) );
+        return Collections.unmodifiableList( new ArrayList<>( getProfileIds( 
pa -> pa.active ) ) );

Review comment:
       I understand your concern and usually we wouldn't have changed something 
like this all of a sudden. The reason why we did change it is because the 
current implementation returns a view of the active profiles in this case. If 
some extension or whatever would add elements to this list it will not have any 
effect. Our theory is that if we make it unmodifiable, we at throw an exception 
if someone tries this. This hopefully points the dev to the method and they 
notice the replacement methods. 




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to