Skip to content

Commit

Permalink
OAK-11311: Remove usage of Guava ImmutableList - oak-security-spi - m…
Browse files Browse the repository at this point in the history
…ake a few lists unmodifiable
  • Loading branch information
reschke committed Dec 19, 2024
1 parent ffea376 commit 3b7c30a
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.osgi.framework.Constants;

import java.security.Principal;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -220,28 +221,29 @@ public RepositoryInitializer getRepositoryInitializer() {
public List<? extends CommitHook> getCommitHooks(@NotNull final String workspaceName) {
Iterable<CommitHook> t = Iterables.concat(Lists.transform(getConfigurations(),
securityConfiguration -> securityConfiguration.getCommitHooks(workspaceName)));
return CollectionUtils.toList(t);
return Collections.unmodifiableList(CollectionUtils.toList(t));
}

@NotNull
@Override
public List<? extends ValidatorProvider> getValidators(@NotNull final String workspaceName, @NotNull final Set<Principal> principals, @NotNull final MoveTracker moveTracker) {
Iterable<ValidatorProvider> t = Iterables.concat(Lists.transform(getConfigurations(), securityConfiguration -> securityConfiguration.getValidators(workspaceName, principals, moveTracker)));
return CollectionUtils.toList(t);
return Collections.unmodifiableList(CollectionUtils.toList(t));
}

@NotNull
@Override
public List<ThreeWayConflictHandler> getConflictHandlers() {
return CollectionUtils.toList(Iterables.concat(Lists.transform(getConfigurations(), securityConfiguration -> securityConfiguration.getConflictHandlers())));
return CollectionUtils.toList(Iterables.concat(Lists.transform(getConfigurations(),
securityConfiguration -> securityConfiguration.getConflictHandlers())));
}

@NotNull
@Override
public List<ProtectedItemImporter> getProtectedItemImporters() {
Iterable<ProtectedItemImporter> t = Iterables.concat(Lists.transform(getConfigurations(),
securityConfiguration -> securityConfiguration.getProtectedItemImporters()));
return CollectionUtils.toList(t);
return Collections.unmodifiableList(CollectionUtils.toList(t));
}

@NotNull
Expand Down

0 comments on commit 3b7c30a

Please sign in to comment.