Skip to content

Commit

Permalink
s/ImplicitBlockingFlux/FluxImplicitBlock/
Browse files Browse the repository at this point in the history
  • Loading branch information
rickie committed Feb 20, 2023
1 parent c712eca commit a60c4d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
@AutoService(BugChecker.class)
@BugPattern(
summary = "Avoid iterating over `Flux`es in an implicitly blocking manner",
link = BUG_PATTERNS_BASE_URL + "ImplicitBlockingFlux",
link = BUG_PATTERNS_BASE_URL + "FluxImplicitBlock",
linkType = CUSTOM,
severity = WARNING,
tags = {CONCURRENCY, PERFORMANCE})
public final class ImplicitBlockingFlux extends BugChecker implements MethodInvocationTreeMatcher {
public final class FluxImplicitBlock extends BugChecker implements MethodInvocationTreeMatcher {
private static final long serialVersionUID = 1L;
private static final Matcher<ExpressionTree> FLUX_WITH_IMPLICIT_BLOCK =
instanceMethod()
Expand All @@ -50,8 +50,8 @@ public final class ImplicitBlockingFlux extends BugChecker implements MethodInvo
.withNoParameters();
private static final Supplier<Type> STREAM = Suppliers.typeFromString(Stream.class.getName());

/** Instantiates a new {@link ImplicitBlockingFlux} instance. */
public ImplicitBlockingFlux() {}
/** Instantiates a new {@link FluxImplicitBlock} instance. */
public FluxImplicitBlock() {}

@Override
public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import reactor.core.CorePublisher;
import reactor.core.publisher.Flux;

final class ImplicitBlockingFluxTest {
final class FluxImplicitBlockTest {
@Test
void identification() {
CompilationTestHelper.newInstance(ImplicitBlockingFlux.class, getClass())
CompilationTestHelper.newInstance(FluxImplicitBlock.class, getClass())
.expectErrorMessage(
"X",
and(
Expand Down Expand Up @@ -61,7 +61,7 @@ void identification() {

@Test
void identificationWithoutGuavaOnClasspath() {
CompilationTestHelper.newInstance(ImplicitBlockingFlux.class, getClass())
CompilationTestHelper.newInstance(FluxImplicitBlock.class, getClass())
.withClasspath(CorePublisher.class, Flux.class, Publisher.class)
.expectErrorMessage("X", not(containsPattern("toImmutableList")))
.addSourceLines(
Expand All @@ -81,7 +81,7 @@ void identificationWithoutGuavaOnClasspath() {

@Test
void replacementFirstSuggestedFix() {
BugCheckerRefactoringTestHelper.newInstance(ImplicitBlockingFlux.class, getClass())
BugCheckerRefactoringTestHelper.newInstance(FluxImplicitBlock.class, getClass())
.addInputLines(
"A.java",
"import reactor.core.publisher.Flux;",
Expand All @@ -97,7 +97,7 @@ void replacementFirstSuggestedFix() {
"import reactor.core.publisher.Flux;",
"",
"class A {",
" @SuppressWarnings(\"ImplicitBlockingFlux\")",
" @SuppressWarnings(\"FluxImplicitBlock\")",
" void m() {",
" Flux.just(1).toIterable();",
" Flux.just(2).toStream();",
Expand All @@ -108,7 +108,7 @@ void replacementFirstSuggestedFix() {

@Test
void replacementSecondSuggestedFix() {
BugCheckerRefactoringTestHelper.newInstance(ImplicitBlockingFlux.class, getClass())
BugCheckerRefactoringTestHelper.newInstance(FluxImplicitBlock.class, getClass())
.setFixChooser(SECOND)
.addInputLines(
"A.java",
Expand Down Expand Up @@ -145,7 +145,7 @@ void replacementSecondSuggestedFix() {

@Test
void replacementThirdSuggestedFix() {
BugCheckerRefactoringTestHelper.newInstance(ImplicitBlockingFlux.class, getClass())
BugCheckerRefactoringTestHelper.newInstance(FluxImplicitBlock.class, getClass())
.setFixChooser(THIRD)
.addInputLines(
"A.java",
Expand Down

0 comments on commit a60c4d1

Please sign in to comment.