Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.jackrabbit.oak.benchmark.authorization;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import joptsimple.internal.Strings;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlManager;
import org.apache.jackrabbit.api.security.authorization.PrivilegeCollection;
Expand Down Expand Up @@ -44,7 +43,7 @@ private enum EvaluationType {
ACCESSCONTORL_MANAGER_HAS_PRIVILEGES
}

private static final List<String> ALL_PRIVILEGE_NAMES = ImmutableList.copyOf(PrivilegeBits.BUILT_IN.keySet());
private static final List<String> ALL_PRIVILEGE_NAMES = List.copyOf(PrivilegeBits.BUILT_IN.keySet());

private final EvaluationType evalType;

Expand Down Expand Up @@ -73,7 +72,7 @@ private static EvaluationType getEvalType(@Nullable String type) {
@Override
void additionalOperations(@NotNull String path, @NotNull Session s, @NotNull AccessControlManager acMgr) {
try {
List<String> privNames = ImmutableList.of(getRandom(ALL_PRIVILEGE_NAMES), getRandom(ALL_PRIVILEGE_NAMES), getRandom(ALL_PRIVILEGE_NAMES), getRandom(ALL_PRIVILEGE_NAMES));
List<String> privNames = List.of(getRandom(ALL_PRIVILEGE_NAMES), getRandom(ALL_PRIVILEGE_NAMES), getRandom(ALL_PRIVILEGE_NAMES), getRandom(ALL_PRIVILEGE_NAMES));
String accessControlledPath = getAccessControlledPath(path);
if (EvaluationType.ACCESSCONTORL_MANAGER_GET_PRIVILEGE_COLLECTION == evalType) {
PrivilegeCollection pc = ((JackrabbitAccessControlManager) acMgr).getPrivilegeCollection(accessControlledPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.jackrabbit.oak.benchmark.authorization.principalbased;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.oak.spi.security.authorization.permission.Permissions;
import org.jetbrains.annotations.NotNull;

Expand All @@ -38,7 +37,7 @@ protected void randomRead(Session testSession, List<String> allPaths, int cnt) t
logout = true;
}
try {
List<String> permissionNames = ImmutableList.copyOf(Permissions.PERMISSION_NAMES.values());
List<String> permissionNames = List.copyOf(Permissions.PERMISSION_NAMES.values());
int access = 0;
int noAccess = 0;
long start = System.currentTimeMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
package org.apache.jackrabbit.oak.benchmark.authorization.principalbased;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;

import org.apache.jackrabbit.guava.common.collect.Iterables;
import org.apache.jackrabbit.guava.common.collect.Iterators;
import org.apache.jackrabbit.api.JackrabbitSession;
Expand Down Expand Up @@ -161,7 +159,8 @@ private static boolean addEntry(@NotNull JackrabbitAccessControlManager acMgr, @
}
added = acl.addAccessControlEntry(principal, privileges);
} else {
for (JackrabbitAccessControlPolicy policy : Iterables.concat(ImmutableList.copyOf(acMgr.getApplicablePolicies(principal)), ImmutableList.copyOf(acMgr.getPolicies(principal)))) {
for (JackrabbitAccessControlPolicy policy : Iterables.concat(Arrays.asList(acMgr.getApplicablePolicies(principal)),
Arrays.asList(acMgr.getPolicies(principal)))) {
if (policy instanceof PrincipalAccessControlList) {
acl = (PrincipalAccessControlList) policy;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
import java.util.stream.Collectors;

import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
Expand All @@ -30,9 +31,6 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.guava.common.collect.Iterables;

import static org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.ScheduleExecutionInstanceTypes.DEFAULT;
import static org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.ScheduleExecutionInstanceTypes.RUN_ON_LEADER;
import static org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.ScheduleExecutionInstanceTypes.RUN_ON_SINGLE;
Expand Down Expand Up @@ -165,7 +163,7 @@ public static <T> List<T> getServices(@NotNull Whiteboard wb, @NotNull Class<T>
if (predicate == null) {
return tracker.getServices();
} else {
return ImmutableList.copyOf(Iterables.filter(tracker.getServices(), (input) -> predicate.test(input)));
return tracker.getServices().stream().filter(predicate).collect(Collectors.toUnmodifiableList());
}
} finally {
tracker.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.jetbrains.annotations.NotNull;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;

/**
* Aggregation of a list of editor providers into a single provider.
*/
Expand All @@ -50,7 +48,7 @@ public Editor getIndexEditor(
return providers.iterator().next();
} else {
return new CompositeIndexEditorProvider(
ImmutableList.copyOf(providers));
List.copyOf(providers));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.TYPE_PROPERTY_NAME;
import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.UNIQUE_PROPERTY_NAME;

import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Map;
Expand All @@ -42,7 +43,6 @@

import javax.jcr.RepositoryException;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.guava.common.collect.Iterables;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Tree;
Expand Down Expand Up @@ -131,7 +131,7 @@ public static Tree createIndexDefinition(@NotNull Tree indexNode,
@NotNull String[] propertyNames,
@NotNull String... declaringNodeTypeNames) throws RepositoryException {

return createIndexDefinition(indexNode, indexDefName, unique, ImmutableList.copyOf(propertyNames), ImmutableList.copyOf(declaringNodeTypeNames), PropertyIndexEditorProvider.TYPE, null);
return createIndexDefinition(indexNode, indexDefName, unique, Arrays.asList(propertyNames), Arrays.asList(declaringNodeTypeNames), PropertyIndexEditorProvider.TYPE, null);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.felix.inventory.Format;
import org.apache.felix.inventory.InventoryPrinter;
import org.apache.jackrabbit.oak.api.jmx.IndexStatsMBean;
import org.apache.jackrabbit.oak.commons.IOUtils;
import org.apache.jackrabbit.oak.commons.collections.CollectionUtils;
import org.apache.jackrabbit.oak.commons.json.JsopBuilder;
import org.apache.jackrabbit.oak.plugins.index.AsyncIndexInfo;
import org.apache.jackrabbit.oak.plugins.index.AsyncIndexInfoService;
Expand Down Expand Up @@ -76,7 +76,7 @@ public void print(PrintWriter pw, Format format, boolean isZip) {
}

private void asyncLanesInfo(PrinterOutput po) {
List<String> asyncLanes = ImmutableList.copyOf(asyncIndexInfoService.getAsyncLanes());
List<String> asyncLanes = CollectionUtils.toList(asyncIndexInfoService.getAsyncLanes());
po.startSection("Async Indexers State", true);
po.text("Number of async indexer lanes", asyncLanes.size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.Set;
import javax.jcr.RepositoryException;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.oak.api.CommitFailedException;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Root;
Expand Down Expand Up @@ -436,7 +435,7 @@ private void createVersion(@NotNull NodeBuilder vHistory,

Validate.checkState(versionable.hasProperty(JCR_PREDECESSORS));
PropertyState state = versionable.getProperty(JCR_PREDECESSORS);
List<String> predecessors = ImmutableList.copyOf(state.getValue(Type.REFERENCES));
List<String> predecessors = CollectionUtils.toList(state.getValue(Type.REFERENCES));
NodeBuilder version = vHistory.child(calculateVersion(vHistory, versionable));

String versionUUID = UUIDUtils.generateUUID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Map;
import java.util.Set;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.guava.common.collect.LinkedListMultimap;
import org.apache.jackrabbit.guava.common.collect.ListMultimap;
import org.osgi.service.component.annotations.Component;
Expand Down Expand Up @@ -185,7 +184,7 @@ class CompositeIndexFieldProvider implements IndexFieldProvider {

CompositeIndexFieldProvider(String nodeType, List<IndexFieldProvider> providers) {
this.nodeType = nodeType;
this.providers = ImmutableList.copyOf(providers);
this.providers = List.copyOf(providers);
}

@NotNull
Expand Down Expand Up @@ -219,7 +218,7 @@ class CompositeFulltextQueryTermsProvider implements FulltextQueryTermsProvider

CompositeFulltextQueryTermsProvider(String nodeType, List<FulltextQueryTermsProvider> providers) {
this.nodeType = nodeType;
this.providers = ImmutableList.copyOf(providers);
this.providers = List.copyOf(providers);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.jackrabbit.oak.plugins.index.lucene.hybrid;

import java.io.Closeable;
Expand All @@ -29,7 +28,6 @@
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.commons.io.FileUtils;
import org.apache.jackrabbit.oak.commons.conditions.Validate;
import org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier;
Expand Down Expand Up @@ -173,7 +171,7 @@ public synchronized List<LuceneIndexReader> getReaders() {
decrementReaderUseCount(readers);

dirReader = latestReader;
readers = ImmutableList.copyOf(newReaders);
readers = List.copyOf(newReaders);
return readers;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.jetbrains.annotations.NotNull;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;

/**
* This {@code QueryIndexProvider} aggregates a list of query index providers
* into a single query index provider.
Expand All @@ -49,14 +47,14 @@ public static QueryIndexProvider compose(
return new QueryIndexProvider() {
@Override
public List<QueryIndex> getQueryIndexes(NodeState nodeState) {
return ImmutableList.of();
return List.of();
}
};
} else if (providers.size() == 1) {
return providers.iterator().next();
} else {
return new CompositeQueryIndexProvider(
ImmutableList.copyOf(providers));
List.copyOf(providers));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.jackrabbit.oak.index.indexer.document.flatfile;

import static org.apache.jackrabbit.guava.common.collect.ImmutableList.copyOf;
import static org.apache.jackrabbit.oak.commons.PathUtils.elements;

import java.io.BufferedWriter;
Expand All @@ -29,6 +28,7 @@
import java.util.Comparator;
import java.util.stream.StreamSupport;

import org.apache.jackrabbit.oak.commons.collections.CollectionUtils;
import org.apache.jackrabbit.oak.index.indexer.document.NodeStateEntry;
import org.apache.jackrabbit.oak.plugins.document.DocumentNodeState;
import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
Expand Down Expand Up @@ -93,7 +93,7 @@ private void addEntry(NodeState ns) throws IOException {
return;
}
String jsonText = entryWriter.asSortedJson(e.getNodeState());
String line = entryWriter.toString(copyOf(elements(path)), jsonText);
String line = entryWriter.toString(CollectionUtils.toList(elements(path)), jsonText);
writer.append(line);
writer.append(LINE_SEPARATOR);
totalLines++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.jackrabbit.oak.index.indexer.document.flatfile;

import java.util.Collections;
import java.util.List;

import org.apache.jackrabbit.oak.commons.StringUtils;
import org.apache.jackrabbit.oak.commons.collections.CollectionUtils;

import static org.apache.jackrabbit.guava.common.collect.ImmutableList.copyOf;
import static org.apache.jackrabbit.oak.commons.PathUtils.elements;
import static org.apache.jackrabbit.oak.index.indexer.document.flatfile.NodeStateEntryWriter.getPath;

Expand All @@ -32,7 +32,7 @@ public class SimpleNodeStateHolder implements NodeStateHolder{
private final List<String> pathElements;

public SimpleNodeStateHolder(String line) {
this.pathElements = copyOf(elements(getPath(line)));
this.pathElements = Collections.unmodifiableList(CollectionUtils.toList(elements(getPath(line))));
this.line = line;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.jackrabbit.oak.index.indexer.document.flatfile;

import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;

import org.apache.jackrabbit.oak.commons.StringUtils;
import org.apache.jackrabbit.oak.commons.collections.CollectionUtils;

import static org.apache.jackrabbit.guava.common.collect.ImmutableList.copyOf;
import static org.apache.jackrabbit.oak.commons.PathUtils.elements;

class StateInBytesHolder implements NodeStateHolder {
private final List<String> pathElements;
private final byte[] content;

public StateInBytesHolder(String path, String line) {
this.pathElements = copyOf(elements(path));
this.pathElements = Collections.unmodifiableList(CollectionUtils.toList(elements(path)));
this.content = line.getBytes(StandardCharsets.UTF_8);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.jackrabbit.oak.plugins.index.search;

import java.util.ArrayList;
Expand All @@ -28,9 +27,9 @@
import java.util.Map;
import java.util.regex.Pattern;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.commons.collections.CollectionUtils;
import org.apache.jackrabbit.oak.plugins.index.search.util.ConfigUtil;
import org.apache.jackrabbit.oak.plugins.memory.MemoryChildNodeEntry;
import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
Expand Down Expand Up @@ -343,7 +342,7 @@ public String toString() {
}

public boolean matches(String nodePath) {
List<String> pathElements = ImmutableList.copyOf(PathUtils.elements(nodePath));
List<String> pathElements = CollectionUtils.toList(PathUtils.elements(nodePath));
if (pathElements.size() != elements.length){
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.jackrabbit.oak.plugins.index.search;

import static org.apache.jackrabbit.guava.common.collect.ImmutableList.copyOf;
import static org.apache.jackrabbit.guava.common.collect.Iterables.toArray;
import static org.apache.jackrabbit.oak.commons.PathUtils.elements;
import static org.apache.jackrabbit.oak.commons.PathUtils.isAbsolute;
Expand All @@ -32,6 +31,7 @@
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.commons.collections.CollectionUtils;
import org.apache.jackrabbit.oak.plugins.index.property.ValuePattern;
import org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition.IndexingRule;
import org.apache.jackrabbit.oak.plugins.index.search.util.FunctionIndexProcessor;
Expand Down Expand Up @@ -306,7 +306,7 @@ private static String[] computeAncestors(String path) {
if (FulltextIndexConstants.REGEX_ALL_PROPS.equals(path)) {
return EMPTY_ANCESTORS;
} else {
return toArray(copyOf(elements(PathUtils.getParentPath(path))), String.class);
return toArray(CollectionUtils.toList(elements(PathUtils.getParentPath(path))), String.class);
}
}

Expand Down
Loading
Loading