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 re...@apache.org on 2025/01/08 18:28:02 UTC
(jackrabbit-oak) branch trunk updated: OAK-11360: remove usage of Guava Ints.contains() (#1958)
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new bcb652775d OAK-11360: remove usage of Guava Ints.contains() (#1958)
bcb652775d is described below
commit bcb652775d1a7745495f5da891ab1a92b109e1f2
Author: Julian Reschke <re...@apache.org>
AuthorDate: Wed Jan 8 19:27:57 2025 +0100
OAK-11360: remove usage of Guava Ints.contains() (#1958)
* OAK-11360: remove usage of Guava Ints.contains()
* OAK-11360: remove usage of Guava Ints.contains()
---
.../jackrabbit/oak/plugins/index/lucene/FieldFactory.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/FieldFactory.java b/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/FieldFactory.java
index c908322c15..600b7dc22c 100644
--- a/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/FieldFactory.java
+++ b/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/FieldFactory.java
@@ -18,11 +18,10 @@ package org.apache.jackrabbit.oak.plugins.index.lucene;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
+import java.util.Set;
-import org.apache.jackrabbit.guava.common.primitives.Ints;
import org.apache.jackrabbit.oak.api.Blob;
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.commons.PathUtils;
@@ -49,12 +48,12 @@ public final class FieldFactory {
private static final FieldType OAK_TYPE_NOT_STORED = new FieldType();
- private static final int[] TYPABLE_TAGS = {
+ private static final Set<Integer> TYPABLE_TAGS = Set.of(
Type.DATE.tag(),
Type.BOOLEAN.tag(),
Type.DOUBLE.tag(),
- Type.LONG.tag(),
- };
+ Type.LONG.tag()
+ );
static {
OAK_TYPE.setIndexed(true);
@@ -70,12 +69,10 @@ public final class FieldFactory {
OAK_TYPE_NOT_STORED.setIndexOptions(DOCS_AND_FREQS_AND_POSITIONS);
OAK_TYPE_NOT_STORED.setTokenized(true);
OAK_TYPE_NOT_STORED.freeze();
-
- Arrays.sort(TYPABLE_TAGS);
}
public static boolean canCreateTypedField(Type<?> type) {
- return Ints.contains(TYPABLE_TAGS, type.tag());
+ return TYPABLE_TAGS.contains(type.tag());
}
private final static class OakTextField extends Field {