Skip to content

Commit

Permalink
make internal representation immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Jun 16, 2022
1 parent 73d2f3b commit 66b0050
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import java.nio.file.attribute.PosixFilePermission;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -241,15 +242,15 @@ public static class MatchedCredentials {

private MatchedCredentials(String matchExpression, Collection<ServiceRef> targets) {
this.matchExpression = matchExpression;
this.targets = targets;
this.targets = new HashSet<>(targets);
}

public String getMatchExpression() {
return matchExpression;
}

public Collection<ServiceRef> getTargets() {
return targets;
return Collections.unmodifiableCollection(targets);
}
}

Expand Down

0 comments on commit 66b0050

Please sign in to comment.