From 7ba62d5e0ae5254f3d87aa8e0a6c8edefa340668 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Sun, 26 Jun 2022 12:39:42 +0200 Subject: [PATCH] Classpath suggestions --- error-prone-contrib/pom.xml | 3 ++- .../MissingImmutableSortedSetDefaultCheck.java | 10 +++++----- pom.xml | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/error-prone-contrib/pom.xml b/error-prone-contrib/pom.xml index fec979b3afc..91c220fb47f 100644 --- a/error-prone-contrib/pom.xml +++ b/error-prone-contrib/pom.xml @@ -143,7 +143,8 @@ org.immutables - value + value-annotations + test org.junit.jupiter diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingImmutableSortedSetDefaultCheck.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingImmutableSortedSetDefaultCheck.java index cc547f06755..1e95f9e00bc 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingImmutableSortedSetDefaultCheck.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MissingImmutableSortedSetDefaultCheck.java @@ -20,9 +20,6 @@ import com.google.errorprone.matchers.Matcher; import com.sun.source.tree.MethodTree; import com.sun.source.tree.Tree; -import org.immutables.value.Value.Immutable; -import org.immutables.value.Value.Modifiable; -import org.immutables.value.Value.NaturalOrder; /** * A {@link BugChecker} which flags methods with return type {@link @@ -43,7 +40,10 @@ public final class MissingImmutableSortedSetDefaultCheck extends BugChecker implements MethodTreeMatcher { private static final long serialVersionUID = 1L; private static final Matcher ENCLOSING_IS_MODIFIABLE_OR_IMMUTABLES = - enclosingClass(anyOf(hasAnnotation(Immutable.class), hasAnnotation(Modifiable.class))); + enclosingClass( + anyOf( + hasAnnotation("org.immutables.value.Value.Immutable"), + hasAnnotation("org.immutables.value.Value.Modifiable"))); private static final Matcher RETURNS_IMMUTABLE_SORTED_SET = methodReturns(isSameType(ImmutableSortedSet.class)); @@ -51,7 +51,7 @@ public final class MissingImmutableSortedSetDefaultCheck extends BugChecker public Description matchMethod(MethodTree tree, VisitorState state) { if (!RETURNS_IMMUTABLE_SORTED_SET.matches(tree, state) || !ENCLOSING_IS_MODIFIABLE_OR_IMMUTABLES.matches(tree, state) - || hasAnnotation(NaturalOrder.class).matches(tree, state)) { + || hasAnnotation("org.immutables.value.Value.NaturalOrder").matches(tree, state)) { return Description.NO_MATCH; } diff --git a/pom.xml b/pom.xml index 42cf002cb6c..2b5face3f39 100644 --- a/pom.xml +++ b/pom.xml @@ -350,8 +350,8 @@ org.immutables - value - 2.8.2 + value-annotations + 2.9.0 org.junit