diff --git a/refaster-support/src/main/java/tech/picnic/errorprone/refaster/matchers/IsFunctionReturningMono.java b/refaster-support/src/main/java/tech/picnic/errorprone/refaster/matchers/IsFunctionReturningMono.java index 41a8b566fc..116bd523f3 100644 --- a/refaster-support/src/main/java/tech/picnic/errorprone/refaster/matchers/IsFunctionReturningMono.java +++ b/refaster-support/src/main/java/tech/picnic/errorprone/refaster/matchers/IsFunctionReturningMono.java @@ -9,6 +9,7 @@ import com.sun.source.tree.LambdaExpressionTree; import com.sun.source.tree.Tree; import com.sun.source.tree.Tree.Kind; +import java.util.function.Function; /** * A matcher of lambda expressions that are of type {@code java.util.function.Function} that returns @@ -19,7 +20,7 @@ public final class IsFunctionReturningMono implements Matcher { private static final Matcher MONO_TYPE = isSameType(Suppliers.typeFromString("reactor.core.publisher.Mono")); private static final Matcher FUNCTION_TYPE = - isSameType(Suppliers.typeFromString("java.util.function.Function")); + isSameType(Suppliers.typeFromString(Function.class.getCanonicalName())); /** Instantiates a new {@link IsFunctionReturningMono} instance. */ public IsFunctionReturningMono() {} diff --git a/refaster-support/src/test/java/tech/picnic/errorprone/refaster/matchers/IsFunctionReturningMonoTest.java b/refaster-support/src/test/java/tech/picnic/errorprone/refaster/matchers/IsFunctionReturningMonoTest.java index 7b78040ded..7487e3fd00 100644 --- a/refaster-support/src/test/java/tech/picnic/errorprone/refaster/matchers/IsFunctionReturningMonoTest.java +++ b/refaster-support/src/test/java/tech/picnic/errorprone/refaster/matchers/IsFunctionReturningMonoTest.java @@ -19,12 +19,12 @@ void matches() { "import reactor.core.publisher.Mono;", "", "class A {", - "// BUG: Diagnostic contains:", - " Function> positive = s -> Mono.just(s);", + " // BUG: Diagnostic contains:", + " Function> positive = s -> Mono.just(s);", "", - " Function> negative = s -> Flux.just(s);", + " Function> negative = s -> Flux.just(s);", "", - " Supplier> negative2 = () -> Mono.just(\"s\");", + " Supplier> negative2 = () -> Mono.just(\"s\");", "}") .doTest(); }