Skip to content

Commit

Permalink
OAK-11360: remove usage of Guava Ints.contains() (#1958)
Browse files Browse the repository at this point in the history
* OAK-11360: remove usage of Guava Ints.contains()

* OAK-11360: remove usage of Guava Ints.contains()
  • Loading branch information
reschke authored Jan 8, 2025
1 parent 673572f commit bcb6527
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@

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;
Expand All @@ -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);
Expand All @@ -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 {
Expand Down

0 comments on commit bcb6527

Please sign in to comment.