Skip to content

Commit

Permalink
OAK-11304: Remove usage of Guava Collections2 - oak-security-spi
Browse files Browse the repository at this point in the history
  • Loading branch information
reschke committed Dec 12, 2024
1 parent b5ffdbc commit 15b2afe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol;

import org.apache.jackrabbit.guava.common.collect.Collections2;
import org.apache.jackrabbit.guava.common.collect.ImmutableSet;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlEntry;
import org.apache.jackrabbit.api.security.authorization.PrivilegeCollection;
Expand Down Expand Up @@ -112,7 +111,7 @@ public boolean isAllow() {
@NotNull
@Override
public String[] getRestrictionNames() {
return Collections2.transform(restrictions, this::getJcrName).toArray(new String[restrictions.size()]);
return restrictions.stream().map(this::getJcrName).toArray(size -> new String[size]);
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol;

import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand All @@ -27,7 +26,6 @@
import javax.jcr.security.AccessControlEntry;
import javax.jcr.security.Privilege;

import org.apache.jackrabbit.guava.common.collect.Collections2;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlEntry;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
import org.apache.jackrabbit.oak.namepath.NamePathMapper;
Expand Down Expand Up @@ -103,9 +101,9 @@ public int size() {
@NotNull
@Override
public String[] getRestrictionNames() {
Collection<RestrictionDefinition> supported = getRestrictionProvider().getSupportedRestrictions(getOakPath());
return Collections2.transform(supported, definition -> namePathMapper.getJcrName(definition.getName())).toArray(new String[supported.size()]);

return getRestrictionProvider().getSupportedRestrictions(getOakPath()).
stream().map(definition -> namePathMapper.getJcrName(definition.getName())).
toArray(size -> new String[size]);
}

@Override
Expand Down

0 comments on commit 15b2afe

Please sign in to comment.