[MNG-7910] DefaultProfileSelector empty ctor uses immutable list (#1283)

It uses immutable list and while it suggests it allows this below, it actually fails on constructs like this (runtime ONLY):
{noformat}
new DefaultProfileSelector()
                .addProfileActivator(new JdkVersionProfileActivator())
                .addProfileActivator(new PropertyProfileActivator())
{noformat}

As default ctor creates immutable list, but API kinda suggests this is ok.

---

https://issues.apache.org/jira/browse/MNG-7910
This commit is contained in:
Tamas Cservenak 2023-10-16 13:26:42 +02:00 committed by GitHub
parent 07db6ec76a
commit bd608d8cc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -24,7 +24,6 @@ import javax.inject.Singleton;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@ -47,7 +46,7 @@ public class DefaultProfileSelector implements ProfileSelector {
private final List<ProfileActivator> activators;
public DefaultProfileSelector() {
this.activators = Collections.emptyList();
this.activators = new ArrayList<>();
}
@Inject