Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsamehsalah committed Nov 19, 2024
1 parent 881cc12 commit c3cc316
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,7 +20,7 @@ public final class IsFunctionReturningMono implements Matcher<ExpressionTree> {
private static final Matcher<Tree> MONO_TYPE =
isSameType(Suppliers.typeFromString("reactor.core.publisher.Mono"));
private static final Matcher<Tree> FUNCTION_TYPE =
isSameType(Suppliers.typeFromString("java.util.function.Function"));
isSameType(Suppliers.typeFromString(Function.class.getCanonicalName()));

/** Instantiates a new {@link IsFunctionReturningMono} instance. */
public IsFunctionReturningMono() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ void matches() {
"import reactor.core.publisher.Mono;",
"",
"class A {",
"// BUG: Diagnostic contains:",
" Function<String, Mono<String>> positive = s -> Mono.just(s);",
" // BUG: Diagnostic contains:",
" Function<String, Mono<String>> positive = s -> Mono.just(s);",
"",
" Function<String, Flux<String>> negative = s -> Flux.just(s);",
" Function<String, Flux<String>> negative = s -> Flux.just(s);",
"",
" Supplier<Mono<String>> negative2 = () -> Mono.just(\"s\");",
" Supplier<Mono<String>> negative2 = () -> Mono.just(\"s\");",
"}")
.doTest();
}
Expand Down

0 comments on commit c3cc316

Please sign in to comment.