Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAK-10322: oak-core: remove Guava from public API #1037

Merged
merged 1 commit into from
Jul 25, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions oak-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
<configuration>
<instructions>
<Import-Package>
<!-- OAK-7182 -->${guava.osgi.import},
com.codahale.metrics*;version="[3.1, 4)";resolution:=optional,
*
</Import-Package>
Expand Down Expand Up @@ -292,11 +291,6 @@
<version>${project.version}</version>
</dependency>
<!-- General utility libraries -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.apache.jackrabbit.guava.common.collect.Iterables;

import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.core.GuavaDeprecation;
import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.apache.jackrabbit.oak.plugins.tree.TreeUtil;
Expand All @@ -49,7 +48,7 @@
*
* @since Oak 0.11
*/
public class TypePredicate implements Predicate<NodeState>, com.google.common.base.Predicate<NodeState> {
public class TypePredicate implements Predicate<NodeState> {

@NotNull
public static TypePredicate isOrderable(@NotNull NodeState root) {
Expand Down Expand Up @@ -201,35 +200,6 @@ && any(input.getNames(JCR_MIXINTYPES), in(mixinTypes))) {
return false;
}

// backwards compatibility, see OAK-8874

/**
* @deprecated use {@link #test(NodeState)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@Deprecated(since = "1.26.0", forRemoval = true)
public boolean apply(@Nullable NodeState input) {
GuavaDeprecation.handleCall("OAK-8874");
return test(input);
}

/**
* @deprecated use {@link #test(Tree)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@Deprecated(since = "1.26.0", forRemoval = true)
public boolean apply(@Nullable Tree input) {
GuavaDeprecation.handleCall("OAK-8874");
return test(input);
}

/**
* @deprecated use {@link #test(String, Set)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@Deprecated(since = "1.26.0", forRemoval = true)
public boolean apply(String primary, Set<String> mixins) {
GuavaDeprecation.handleCall("OAK-8874");
return test(primary, mixins);
}

//------------------------------------------------------------< Object >--

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
import javax.jcr.RepositoryException;
import javax.jcr.Value;

import org.apache.jackrabbit.oak.core.GuavaDeprecation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class BooleanConstraint implements Predicate<Value>, com.google.common.base.Predicate<Value> {
public class BooleanConstraint implements Predicate<Value> {
private static final Logger log = LoggerFactory.getLogger(BooleanConstraint.class);

private final Boolean requiredValue;
Expand Down Expand Up @@ -54,16 +53,6 @@ public boolean test(Value value) {
}
}

/**
* @deprecated use {@link #test(Value)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@Override
@Deprecated(since = "1.26.0", forRemoval = true)
public boolean apply(Value value) {
GuavaDeprecation.handleCall("OAK-8874");
return test(value);
}

@Override
public String toString() {
return "'" + requiredValue + '\'';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import javax.jcr.PropertyType;
import javax.jcr.Value;

import org.apache.jackrabbit.oak.core.GuavaDeprecation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -63,14 +62,4 @@ public static Predicate<Value> asPredicate(int type, String constraint) {
throw new IllegalArgumentException(msg);
}
}

/**
* @deprecated use {@link #asPredicate(int, String)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@SuppressWarnings("unchecked")
@Deprecated(since = "1.26.0", forRemoval = true)
public static com.google.common.base.Predicate<Value> valueConstraint(int type, String constraint) {
GuavaDeprecation.handleCall("OAK-8874");
return (com.google.common.base.Predicate<Value>) asPredicate(type, constraint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
import javax.jcr.RepositoryException;
import javax.jcr.Value;

import org.apache.jackrabbit.oak.core.GuavaDeprecation;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class NameConstraint implements Predicate<Value>, com.google.common.base.Predicate<Value> {
public class NameConstraint implements Predicate<Value> {
private static final Logger log = LoggerFactory.getLogger(NameConstraint.class);

private final String requiredValue;
Expand All @@ -46,16 +45,6 @@ public boolean test(@Nullable Value value) {
}
}

/**
* @deprecated use {@link #test(Value)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@Deprecated(since = "1.26.0", forRemoval = true)
@Override
public boolean apply(@Nullable Value value) {
GuavaDeprecation.handleCall("OAK-8874");
return test(value);
}

@Override
public String toString() {
return '\'' + requiredValue + '\'';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
import javax.jcr.RepositoryException;
import javax.jcr.Value;

import org.apache.jackrabbit.oak.core.GuavaDeprecation;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class NumericConstraint<T> implements Predicate<Value>, com.google.common.base.Predicate<Value> {
public abstract class NumericConstraint<T> implements Predicate<Value> {
private static final Logger log = LoggerFactory.getLogger(NumericConstraint.class);

private boolean invalid;
Expand Down Expand Up @@ -107,16 +106,6 @@ public boolean test(@Nullable Value value) {
}
}

/**
* @deprecated use {@link #test(Value)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@Deprecated(since = "1.26.0", forRemoval = true)
@Override
public boolean apply(@Nullable Value value) {
GuavaDeprecation.handleCall("OAK-8874");
return test(value);
}

protected abstract T getValue(Value value) throws RepositoryException;
protected abstract boolean less(T val, T bound);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
import javax.jcr.Value;

import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.core.GuavaDeprecation;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PathConstraint implements Predicate<Value>, com.google.common.base.Predicate<Value> {
public class PathConstraint implements Predicate<Value> {
private static final Logger log = LoggerFactory.getLogger(PathConstraint.class);

private final String requiredValue;
Expand Down Expand Up @@ -64,16 +63,6 @@ public boolean test(@Nullable Value value) {
}
}

/**
* @deprecated use {@link #test(Value)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@Deprecated(since = "1.26.0", forRemoval = true)
@Override
public boolean apply(@Nullable Value value) {
GuavaDeprecation.handleCall("OAK-8874");
return test(value);
}

@Override
public String toString() {
return '\'' + requiredValue + '\'';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@

import javax.jcr.Value;

import org.apache.jackrabbit.oak.core.GuavaDeprecation;

public class ReferenceConstraint implements Predicate<Value>, com.google.common.base.Predicate<Value> {
public class ReferenceConstraint implements Predicate<Value> {

private final String requiredTargetType;

Expand All @@ -36,16 +34,6 @@ public boolean test(Value value) {
return true;
}

/**
* @deprecated use {@link #test(Value)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@Deprecated(since = "1.26.0", forRemoval = true)
@Override
public boolean apply(Value value) {
GuavaDeprecation.handleCall("OAK-8874");
return test(value);
}

@Override
public String toString() {
return '\'' + requiredTargetType + '\'';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
import javax.jcr.RepositoryException;
import javax.jcr.Value;

import org.apache.jackrabbit.oak.core.GuavaDeprecation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class StringConstraint implements Predicate<Value>, com.google.common.base.Predicate<Value> {
public class StringConstraint implements Predicate<Value> {
private static final Logger log = LoggerFactory.getLogger(StringConstraint.class);

private final Pattern pattern;
Expand Down Expand Up @@ -62,16 +61,6 @@ public boolean test(Value value) {
}
}

/**
* @deprecated use {@link #test(Value)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@Deprecated(since = "1.26.0", forRemoval = true)
@Override
public boolean apply(Value value) {
GuavaDeprecation.handleCall("OAK-8874");
return test(value);
}

@Override
public String toString() {
return "'" + pattern + '\'';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.function.Predicate;

import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.core.GuavaDeprecation;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.jetbrains.annotations.NotNull;

Expand All @@ -33,7 +32,7 @@
* the node has a property of the given {@code name} and the given
* {@code propertyPredicate} holds on that property.
*/
public class PropertyPredicate implements Predicate<NodeState>, com.google.common.base.Predicate<NodeState> {
public class PropertyPredicate implements Predicate<NodeState> {
private final String name;
private final Predicate<PropertyState> propertyPredicate;

Expand All @@ -52,14 +51,4 @@ public boolean test(NodeState node) {
PropertyState property = node.getProperty(name);
return property != null && propertyPredicate.test(property);
}

/**
* @deprecated use {@link #test(NodeState)} instead (see <a href="https://issues.apache.org/jira/browse/OAK-8874">OAK-8874</a>)
*/
@Deprecated(since = "1.26.0", forRemoval = true)
@Override
public boolean apply(NodeState node) {
GuavaDeprecation.handleCall("OAK-8874");
return test(node);
}
}