You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by da...@apache.org on 2025/01/07 04:38:48 UTC
(jackrabbit-oak) branch OAK-11353 created (now 611e9b07f2)
This is an automated email from the ASF dual-hosted git repository.
daim pushed a change to branch OAK-11353
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
at 611e9b07f2 OAK-11353 : removed usage of Guava's Maps.newHashMap
This branch includes the following new commits:
new 611e9b07f2 OAK-11353 : removed usage of Guava's Maps.newHashMap
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(jackrabbit-oak) 01/01: OAK-11353 : removed usage of Guava's Maps.newHashMap
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
daim pushed a commit to branch OAK-11353
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
commit 611e9b07f2f359bee151da08e07de2292c5294f7
Author: Rishabh Kumar <di...@adobe.com>
AuthorDate: Tue Jan 7 10:08:34 2025 +0530
OAK-11353 : removed usage of Guava's Maps.newHashMap
---
.../jackrabbit/oak/plugins/index/property/MultiPropertyOrTest.java | 5 ++---
oak-examples/standalone/README.md | 2 +-
.../org/apache/jackrabbit/oak/jcr/session/SessionNamespaces.java | 5 ++---
.../jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java | 3 +--
.../apache/jackrabbit/oak/run/osgi/SegmentNodeStoreConfigTest.java | 4 ++--
.../org/apache/jackrabbit/oak/plugins/document/SplitOperations.java | 3 +--
.../oak/plugins/document/util/ReadOnlyDocumentStoreWrapperTest.java | 4 ++--
7 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/MultiPropertyOrTest.java b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/MultiPropertyOrTest.java
index 31df7419fe..846db655af 100644
--- a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/MultiPropertyOrTest.java
+++ b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/MultiPropertyOrTest.java
@@ -25,15 +25,14 @@ import static org.junit.Assert.assertTrue;
import java.text.ParseException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Random;
import javax.jcr.query.Query;
-import org.apache.jackrabbit.guava.common.collect.Maps;
import org.apache.jackrabbit.oak.Oak;
import org.apache.jackrabbit.oak.api.ContentRepository;
-import org.apache.jackrabbit.oak.api.PropertyValue;
import org.apache.jackrabbit.oak.api.ResultRow;
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.commons.collections.CollectionUtils;
@@ -186,7 +185,7 @@ public class MultiPropertyOrTest extends AbstractQueryTest {
private String measureWithLimit(String query, String lang, int limit) throws ParseException {
List<? extends ResultRow> result = CollectionUtils.toList(
- qe.executeQuery(query, lang, limit, 0, Maps.<String, PropertyValue>newHashMap(),
+ qe.executeQuery(query, lang, limit, 0, new HashMap<>(),
NO_MAPPINGS).getRows());
String measure = "";
diff --git a/oak-examples/standalone/README.md b/oak-examples/standalone/README.md
index bdf6feea7b..21f70bc970 100644
--- a/oak-examples/standalone/README.md
+++ b/oak-examples/standalone/README.md
@@ -146,7 +146,7 @@ default config files depending on options provided (like --mongo ) and then
construct the Oak Repository instance via `OakOSGiRepositoryFactory`
private Repository createRepository(List<String> repoConfigs, File repoHomeDir) throws RepositoryException {
- Map<String,Object> config = Maps.newHashMap();
+ Map<String,Object> config = new HashMap<>();
config.put(OakOSGiRepositoryFactory.REPOSITORY_HOME, repoHomeDir.getAbsolutePath());
config.put(OakOSGiRepositoryFactory.REPOSITORY_CONFIG_FILE, commaSepFilePaths(repoConfigs));
config.put(OakOSGiRepositoryFactory.REPOSITORY_SHUTDOWN_ON_TIMEOUT, false);
diff --git a/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/SessionNamespaces.java b/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/SessionNamespaces.java
index 8caa5e3875..463b912ff1 100644
--- a/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/SessionNamespaces.java
+++ b/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/SessionNamespaces.java
@@ -18,6 +18,7 @@ package org.apache.jackrabbit.oak.jcr.session;
import static org.apache.jackrabbit.guava.common.collect.Iterables.toArray;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
@@ -32,8 +33,6 @@ import org.apache.jackrabbit.oak.namepath.impl.LocalNameMapper;
import org.apache.jackrabbit.util.XMLChar;
import org.jetbrains.annotations.NotNull;
-import org.apache.jackrabbit.guava.common.collect.Maps;
-
/**
* {@code SessionNamespaces} implements namespace handling on the JCR
* Session level. That is, it maintains a map of session local namespace
@@ -43,7 +42,7 @@ import org.apache.jackrabbit.guava.common.collect.Maps;
public class SessionNamespaces extends LocalNameMapper {
public SessionNamespaces(@NotNull Root root) {
- super(root, Maps.<String, String>newHashMap());
+ super(root, new HashMap<>());
}
// The code below was initially copied from JCR Commons AbstractSession,
diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java
index 7d4c6bf82c..ccd63eabf3 100644
--- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java
+++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java
@@ -45,7 +45,6 @@ import javax.jcr.PropertyType;
import org.apache.jackrabbit.guava.common.collect.ComparisonChain;
import org.apache.jackrabbit.guava.common.collect.Iterables;
-import org.apache.jackrabbit.guava.common.collect.Maps;
import org.apache.jackrabbit.guava.common.io.CountingInputStream;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
@@ -1430,7 +1429,7 @@ public class LucenePropertyIndexTest extends AbstractQueryTest {
private String measureWithLimit(String query, String lang, int limit) throws ParseException {
List<? extends ResultRow> result = CollectionUtils.toList(
- qe.executeQuery(query, lang, limit, 0, Maps.<String, PropertyValue>newHashMap(),
+ qe.executeQuery(query, lang, limit, 0, new HashMap<>(),
NO_MAPPINGS).getRows());
String measure = "";
diff --git a/oak-pojosr/src/test/java/org/apache/jackrabbit/oak/run/osgi/SegmentNodeStoreConfigTest.java b/oak-pojosr/src/test/java/org/apache/jackrabbit/oak/run/osgi/SegmentNodeStoreConfigTest.java
index 730ccf04fb..04f28dc050 100644
--- a/oak-pojosr/src/test/java/org/apache/jackrabbit/oak/run/osgi/SegmentNodeStoreConfigTest.java
+++ b/oak-pojosr/src/test/java/org/apache/jackrabbit/oak/run/osgi/SegmentNodeStoreConfigTest.java
@@ -20,11 +20,11 @@ import static org.junit.Assert.assertNotNull;
import java.lang.management.ManagementFactory;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import org.apache.felix.connect.launch.PojoServiceRegistry;
-import org.apache.jackrabbit.guava.common.collect.Maps;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.apache.jackrabbit.oak.spi.state.NodeStore;
import org.junit.Assert;
@@ -155,7 +155,7 @@ public class SegmentNodeStoreConfigTest extends AbstractRepositoryFactoryTest {
return result;
}
- private final Map<ServiceReference<NodeStore>, NodeStore> stores = Maps.newHashMap();
+ private final Map<ServiceReference<NodeStore>, NodeStore> stores = new HashMap<>();
private final Object trackerLock = new Object();
private final CountDownLatch trackerLatch;
private final CountDownLatch deactivateLatch;
diff --git a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/SplitOperations.java b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/SplitOperations.java
index 1b8338ab60..1bea179c40 100644
--- a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/SplitOperations.java
+++ b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/SplitOperations.java
@@ -42,7 +42,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.jackrabbit.guava.common.base.Suppliers;
-import org.apache.jackrabbit.guava.common.collect.Maps;
import static java.util.Objects.requireNonNull;
@@ -110,7 +109,7 @@ class SplitOperations {
this.headRevision = requireNonNull(headRev).getRevision(context.getClusterId());
this.numRevsThreshold = numRevsThreshold;
this.nodeExistsAtHeadRevision = Suppliers.memoize(() -> doc.getLiveRevision(context, headRev,
- Maps.<Revision, String>newHashMap(),
+ new HashMap<>(),
new LastRevs(headRev)) != null);
}
diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ReadOnlyDocumentStoreWrapperTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ReadOnlyDocumentStoreWrapperTest.java
index e871fbeebe..ad80a25653 100644
--- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ReadOnlyDocumentStoreWrapperTest.java
+++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ReadOnlyDocumentStoreWrapperTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.jackrabbit.oak.plugins.document.util;
-import org.apache.jackrabbit.guava.common.collect.Maps;
import org.apache.jackrabbit.oak.plugins.document.Collection;
import org.apache.jackrabbit.oak.plugins.document.Document;
import org.apache.jackrabbit.oak.plugins.document.DocumentMKBuilderProvider;
@@ -37,6 +36,7 @@ import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import static org.junit.Assert.assertFalse;
@@ -102,7 +102,7 @@ public class ReadOnlyDocumentStoreWrapperTest {
uoeThrown = false;
try {
- readOnlyStore.remove(collection, Maps.<String, Long>newHashMap());
+ readOnlyStore.remove(collection, new HashMap<>());
} catch (UnsupportedOperationException uoe) {
//catch uoe thrown by read only wrapper
uoeThrown = true;