diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplates.java index 05ee76169a0..b40a9d7d9b5 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJNumberTemplates.java @@ -18,7 +18,7 @@ final class AssertJNumberTemplates { private AssertJNumberTemplates() {} - static final class NumberIsPositive { + static final class NumberAssertIsPositive { @BeforeTemplate AbstractByteAssert before(AbstractByteAssert numberAssert) { return Refaster.anyOf( @@ -69,7 +69,7 @@ AbstractBigDecimalAssert before(AbstractBigDecimalAssert numberAssert) { } } - static final class NumberIsNotPositive { + static final class NumberAssertIsNotPositive { @BeforeTemplate AbstractByteAssert before(AbstractByteAssert numberAssert) { return Refaster.anyOf( @@ -120,7 +120,7 @@ AbstractBigDecimalAssert before(AbstractBigDecimalAssert numberAssert) { } } - static final class NumberIsNegative { + static final class NumberAssertIsNegative { @BeforeTemplate AbstractByteAssert before(AbstractByteAssert numberAssert) { return Refaster.anyOf( @@ -171,7 +171,7 @@ AbstractBigDecimalAssert before(AbstractBigDecimalAssert numberAssert) { } } - static final class NumberIsNotNegative { + static final class NumberAssertIsNotNegative { @BeforeTemplate AbstractByteAssert before(AbstractByteAssert numberAssert) { return Refaster.anyOf( diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJTemplates.java index 0458fc05ff4..87d421bb568 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/AssertJTemplates.java @@ -564,7 +564,7 @@ static final class AssertThatMultisetsAreEqual { // Map // - static final class AssertThatMapIsEmpty { + static final class AbstractMapAssertIsEmpty { @BeforeTemplate @SuppressWarnings("unchecked") void before(AbstractMapAssert mapAssert) { @@ -615,8 +615,7 @@ void after(AbstractMapAssert mapAssert) { } } - // XXX: Find a better name. - static final class AssertThatMapIsEmpty2 { + static final class AssertThatIsEmpty { @BeforeTemplate void before(Map map) { Refaster.anyOf( @@ -638,7 +637,7 @@ void after(Map map) { } } - static final class AssertThatMapIsNotEmpty { + static final class AbstractMapAssertIsNotEmpty { @BeforeTemplate AbstractMapAssert before(AbstractMapAssert mapAssert) { return mapAssert.isNotEqualTo( @@ -657,8 +656,7 @@ static final class AssertThatMapIsNotEmpty { } } - // XXX: Find a better name. - static final class AssertThatMapIsNotEmpty2 { + static final class AssertThatIsNotEmpty { @BeforeTemplate AbstractAssert before(Map map) { return Refaster.anyOf( diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/CollectionTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/CollectionTemplates.java index aea3761bb7f..e8dfc4e9d2e 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/CollectionTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/CollectionTemplates.java @@ -187,7 +187,7 @@ ImmutableList after(ImmutableCollection collection) { * Don't call {@link ImmutableCollection#asList()} if the result is going to be streamed; stream * directly. */ - static final class ImmutableCollectionAsListToStream { + static final class ImmutableCollectionStream { @BeforeTemplate Stream before(ImmutableCollection collection) { return collection.asList().stream(); diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplates.java index 32ab0fbeaae..56a3786e713 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/DoubleStreamTemplates.java @@ -186,7 +186,7 @@ OptionalDouble after(DoubleStream stream) { } /** Prefer {@link DoubleStream#noneMatch(DoublePredicate)} over more contrived alternatives. */ - static final class DoubleStreamNoneMatch { + static final class DoubleStreamNoneMatchDoublePredicate { @BeforeTemplate boolean before(DoubleStream stream, DoublePredicate predicate) { return Refaster.anyOf( @@ -201,7 +201,7 @@ boolean after(DoubleStream stream, DoublePredicate predicate) { } } - abstract static class DoubleStreamNoneMatch2 { + abstract static class DoubleStreamNoneMatch { @Placeholder abstract boolean test(@MayOptionallyUse double element); @@ -230,7 +230,7 @@ boolean after(DoubleStream stream, DoublePredicate predicate) { } } - static final class DoubleStreamAllMatch { + static final class DoubleStreamAllMatchDoublePredicate { @BeforeTemplate boolean before(DoubleStream stream, DoublePredicate predicate) { return stream.noneMatch(predicate.negate()); @@ -242,7 +242,7 @@ boolean after(DoubleStream stream, DoublePredicate predicate) { } } - abstract static class DoubleStreamAllMatch2 { + abstract static class DoubleStreamAllMatch { @Placeholder abstract boolean test(@MayOptionallyUse double element); diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java index 43b1c04c211..9339a8b49c3 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableListMultimapTemplates.java @@ -205,7 +205,7 @@ ImmutableListMultimap after( * Prefer creating an immutable copy of the result of {@link Multimaps#transformValues(Multimap, * com.google.common.base.Function)} over creating and directly collecting a stream. */ - abstract static class TransformMultimapValuesToImmutableListMultimap { + abstract static class ImmutableListMultimapCopyOfMultimapsTransformValues { @Placeholder(allowsIdentity = true) abstract V2 valueTransformation(@MayOptionallyUse V1 value); @@ -227,7 +227,7 @@ ImmutableListMultimap after(Multimap multimap) { * Prefer creating an immutable copy of the result of {@link Multimaps#transformValues(Multimap, * com.google.common.base.Function)} over creating and directly collecting a stream. */ - static final class TransformMultimapValuesToImmutableListMultimap2 { + static final class ImmutableListMultimapCopyOfMultimapsTransformValuesTransformation { // XXX: Drop the `Refaster.anyOf` if we decide to rewrite one to the other. @BeforeTemplate ImmutableListMultimap before( diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java index d851cbaeb85..c4a73db6449 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/ImmutableSetMultimapTemplates.java @@ -121,7 +121,7 @@ ImmutableSetMultimap after( * Don't map a a stream's elements to map entries, only to subsequently collect them into an * {@link ImmutableSetMultimap}. The collection can be performed directly. */ - abstract static class StreamOfMapEntriesToImmutableSetMultimap { + abstract static class StreamCollectToImmutableSetMultimap { @Placeholder(allowsIdentity = true) abstract K keyFunction(@MayOptionallyUse E element); @@ -148,7 +148,7 @@ ImmutableSetMultimap after(Stream stream) { * Prefer creating an immutable copy of the result of {@link Multimaps#transformValues(Multimap, * com.google.common.base.Function)} over creating and directly collecting a stream. */ - abstract static class TransformMultimapValuesToImmutableSetMultimap { + abstract static class ImmutableSetMultimapCopyOfMultimapsTransformValues { @Placeholder(allowsIdentity = true) abstract V2 valueTransformation(@MayOptionallyUse V1 value); @@ -170,7 +170,7 @@ ImmutableSetMultimap after(Multimap multimap) { * Prefer creating an immutable copy of the result of {@link Multimaps#transformValues(Multimap, * com.google.common.base.Function)} over creating and directly collecting a stream. */ - static final class TransformMultimapValuesToImmutableSetMultimap2 { + static final class ImmutableSetMultimapCopyOfMultimapsTransformValuesTransformation { // XXX: Drop the `Refaster.anyOf` if we decide to rewrite one to the other. @BeforeTemplate ImmutableSetMultimap before( diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/IntStreamTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/IntStreamTemplates.java index 52d8bb2d664..3e1673e810f 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/IntStreamTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/IntStreamTemplates.java @@ -199,7 +199,7 @@ OptionalInt after(IntStream stream) { } /** Prefer {@link IntStream#noneMatch(IntPredicate)} over more contrived alternatives. */ - static final class IntStreamNoneMatch { + static final class IntStreamNoneMatchIntPredicate { @BeforeTemplate boolean before(IntStream stream, IntPredicate predicate) { return Refaster.anyOf( @@ -214,7 +214,7 @@ boolean after(IntStream stream, IntPredicate predicate) { } } - abstract static class IntStreamNoneMatch2 { + abstract static class IntStreamNoneMatch { @Placeholder abstract boolean test(@MayOptionallyUse int element); @@ -243,7 +243,7 @@ boolean after(IntStream stream, IntPredicate predicate) { } } - static final class IntStreamAllMatch { + static final class IntStreamAllMatchIntPredicate { @BeforeTemplate boolean before(IntStream stream, IntPredicate predicate) { return stream.noneMatch(predicate.negate()); @@ -255,7 +255,7 @@ boolean after(IntStream stream, IntPredicate predicate) { } } - abstract static class IntStreamAllMatch2 { + abstract static class IntStreamAllMatch { @Placeholder abstract boolean test(@MayOptionallyUse int element); diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/LongStreamTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/LongStreamTemplates.java index 2cefe257f37..6e07e3341cd 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/LongStreamTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/LongStreamTemplates.java @@ -199,7 +199,7 @@ OptionalLong after(LongStream stream) { } /** Prefer {@link LongStream#noneMatch(LongPredicate)} over more contrived alternatives. */ - static final class LongStreamNoneMatch { + static final class LongStreamNoneMatchLongPredicate { @BeforeTemplate boolean before(LongStream stream, LongPredicate predicate) { return Refaster.anyOf( @@ -214,7 +214,7 @@ boolean after(LongStream stream, LongPredicate predicate) { } } - abstract static class LongStreamNoneMatch2 { + abstract static class LongStreamNoneMatch { @Placeholder abstract boolean test(@MayOptionallyUse long element); @@ -243,7 +243,7 @@ boolean after(LongStream stream, LongPredicate predicate) { } } - static final class LongStreamAllMatch { + static final class LongStreamAllMatchLongPredicate { @BeforeTemplate boolean before(LongStream stream, LongPredicate predicate) { return stream.noneMatch(predicate.negate()); @@ -255,7 +255,7 @@ boolean after(LongStream stream, LongPredicate predicate) { } } - abstract static class LongStreamAllMatch2 { + abstract static class LongStreamAllMatch { @Placeholder abstract boolean test(@MayOptionallyUse long element); diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StreamTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StreamTemplates.java index ba0003eee9d..dbb6c06c244 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StreamTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StreamTemplates.java @@ -249,7 +249,7 @@ Optional after(Stream stream) { } /** Prefer {@link Stream#noneMatch(Predicate)} over more contrived alternatives. */ - static final class StreamNoneMatch { + static final class StreamNoneMatchPredicate { @BeforeTemplate boolean before(Stream stream, Predicate predicate) { return Refaster.anyOf( @@ -264,7 +264,7 @@ boolean after(Stream stream, Predicate predicate) { } } - abstract static class StreamNoneMatch2 { + abstract static class StreamNoneMatch { @Placeholder(allowsIdentity = true) abstract boolean test(@MayOptionallyUse T element); @@ -293,7 +293,7 @@ boolean after(Stream stream, Predicate predicate) { } } - static final class StreamAllMatch { + static final class StreamAllMatchPredicate { @BeforeTemplate boolean before(Stream stream, Predicate predicate) { return stream.noneMatch(Refaster.anyOf(not(predicate), predicate.negate())); @@ -305,7 +305,7 @@ boolean after(Stream stream, Predicate predicate) { } } - abstract static class StreamAllMatch2 { + abstract static class StreamAllMatch { @Placeholder(allowsIdentity = true) abstract boolean test(@MayOptionallyUse T element); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJEnumerableTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJEnumerableTemplatesTestInput.java index 6139fd7212a..07d54c71c0b 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJEnumerableTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJEnumerableTemplatesTestInput.java @@ -6,7 +6,7 @@ import com.google.common.collect.Iterables; import org.assertj.core.api.EnumerableAssert; -final class AssertJEnumableTemplatesTest implements RefasterTemplateTestCase { +final class AssertJEnumerableTemplatesTest implements RefasterTemplateTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Iterables.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJEnumerableTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJEnumerableTemplatesTestOutput.java index 3984af26b4d..8eb34f82f73 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJEnumerableTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJEnumerableTemplatesTestOutput.java @@ -6,7 +6,7 @@ import com.google.common.collect.Iterables; import org.assertj.core.api.EnumerableAssert; -final class AssertJEnumableTemplatesTest implements RefasterTemplateTestCase { +final class AssertJEnumerableTemplatesTest implements RefasterTemplateTestCase { @Override public ImmutableSet elidedTypesAndStaticImports() { return ImmutableSet.of(Iterables.class); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJNumberTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJNumberTemplatesTestInput.java index 1838f8c6f04..f5c22194dad 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJNumberTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJNumberTemplatesTestInput.java @@ -8,7 +8,7 @@ import org.assertj.core.api.NumberAssert; final class AssertJNumberTemplatesTest implements RefasterTemplateTestCase { - ImmutableSet> testAbstractIntegerAssertIsPositive() { + ImmutableSet> testNumberAssertIsPositive() { return ImmutableSet.of( assertThat((byte) 0).isGreaterThan((byte) 0), assertThat((byte) 0).isGreaterThanOrEqualTo((byte) 1), @@ -25,7 +25,7 @@ final class AssertJNumberTemplatesTest implements RefasterTemplateTestCase { assertThat(BigDecimal.ZERO).isGreaterThan(BigDecimal.ZERO)); } - ImmutableSet> testAbstractIntegerAssertIsNotPositive() { + ImmutableSet> testNumberAssertIsNotPositive() { return ImmutableSet.of( assertThat((byte) 0).isLessThanOrEqualTo((byte) 0), assertThat((byte) 0).isLessThan((byte) 1), @@ -42,7 +42,7 @@ final class AssertJNumberTemplatesTest implements RefasterTemplateTestCase { assertThat(BigDecimal.ZERO).isLessThanOrEqualTo(BigDecimal.ZERO)); } - ImmutableSet> testAbstractIntegerAssertIsNegative() { + ImmutableSet> testNumberAssertIsNegative() { return ImmutableSet.of( assertThat((byte) 0).isLessThan((byte) 0), assertThat((byte) 0).isLessThanOrEqualTo((byte) -1), @@ -59,7 +59,7 @@ final class AssertJNumberTemplatesTest implements RefasterTemplateTestCase { assertThat(BigDecimal.ZERO).isLessThan(BigDecimal.ZERO)); } - ImmutableSet> testAbstractIntegerAssertIsNotNegative() { + ImmutableSet> testNumberAssertIsNotNegative() { return ImmutableSet.of( assertThat((byte) 0).isGreaterThanOrEqualTo((byte) 0), assertThat((byte) 0).isGreaterThan((byte) -1), diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJNumberTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJNumberTemplatesTestOutput.java index 5b6eaee6d9e..6c15b31011e 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJNumberTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/AssertJNumberTemplatesTestOutput.java @@ -8,7 +8,7 @@ import org.assertj.core.api.NumberAssert; final class AssertJNumberTemplatesTest implements RefasterTemplateTestCase { - ImmutableSet> testAbstractIntegerAssertIsPositive() { + ImmutableSet> testNumberAssertIsPositive() { return ImmutableSet.of( assertThat((byte) 0).isPositive(), assertThat((byte) 0).isPositive(), @@ -25,7 +25,7 @@ final class AssertJNumberTemplatesTest implements RefasterTemplateTestCase { assertThat(BigDecimal.ZERO).isPositive()); } - ImmutableSet> testAbstractIntegerAssertIsNotPositive() { + ImmutableSet> testNumberAssertIsNotPositive() { return ImmutableSet.of( assertThat((byte) 0).isNotPositive(), assertThat((byte) 0).isNotPositive(), @@ -42,7 +42,7 @@ final class AssertJNumberTemplatesTest implements RefasterTemplateTestCase { assertThat(BigDecimal.ZERO).isNotPositive()); } - ImmutableSet> testAbstractIntegerAssertIsNegative() { + ImmutableSet> testNumberAssertIsNegative() { return ImmutableSet.of( assertThat((byte) 0).isNegative(), assertThat((byte) 0).isNegative(), @@ -59,7 +59,7 @@ final class AssertJNumberTemplatesTest implements RefasterTemplateTestCase { assertThat(BigDecimal.ZERO).isNegative()); } - ImmutableSet> testAbstractIntegerAssertIsNotNegative() { + ImmutableSet> testNumberAssertIsNotNegative() { return ImmutableSet.of( assertThat((byte) 0).isNotNegative(), assertThat((byte) 0).isNotNegative(), diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/DoubleStreamTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/DoubleStreamTemplatesTestInput.java index bc5381a700c..0a78bdf0e21 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/DoubleStreamTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/DoubleStreamTemplatesTestInput.java @@ -65,7 +65,7 @@ OptionalDouble testDoubleStreamMin() { return DoubleStream.of(1).sorted().findFirst(); } - ImmutableSet testDoubleStreamNoneMatch() { + ImmutableSet testDoubleStreamNoneMatchDoublePredicate() { DoublePredicate pred = i -> i > 0; return ImmutableSet.of( !DoubleStream.of(1).anyMatch(n -> n > 1), @@ -73,7 +73,7 @@ ImmutableSet testDoubleStreamNoneMatch() { DoubleStream.of(3).filter(pred).findAny().isEmpty()); } - boolean testDoubleStreamNoneMatch2() { + boolean testDoubleStreamNoneMatch() { return DoubleStream.of(1).allMatch(n -> !(n > 1)); } @@ -83,12 +83,12 @@ ImmutableSet testDoubleStreamAnyMatch() { DoubleStream.of(2).filter(n -> n > 2).findAny().isPresent()); } - boolean testDoubleStreamAllMatch() { + boolean testDoubleStreamAllMatchDoublePredicate() { DoublePredicate pred = i -> i > 0; return DoubleStream.of(1).noneMatch(pred.negate()); } - boolean testDoubleStreamAllMatch2() { + boolean testDoubleStreamAllMatch() { return DoubleStream.of(1).noneMatch(n -> !(n > 1)); } } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/DoubleStreamTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/DoubleStreamTemplatesTestOutput.java index 8cfa897a935..366b5c9ac5d 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/DoubleStreamTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/DoubleStreamTemplatesTestOutput.java @@ -65,7 +65,7 @@ OptionalDouble testDoubleStreamMin() { return DoubleStream.of(1).min(); } - ImmutableSet testDoubleStreamNoneMatch() { + ImmutableSet testDoubleStreamNoneMatchDoublePredicate() { DoublePredicate pred = i -> i > 0; return ImmutableSet.of( DoubleStream.of(1).noneMatch(n -> n > 1), @@ -73,7 +73,7 @@ ImmutableSet testDoubleStreamNoneMatch() { DoubleStream.of(3).noneMatch(pred)); } - boolean testDoubleStreamNoneMatch2() { + boolean testDoubleStreamNoneMatch() { return DoubleStream.of(1).noneMatch(n -> n > 1); } @@ -82,12 +82,12 @@ ImmutableSet testDoubleStreamAnyMatch() { DoubleStream.of(1).anyMatch(n -> n > 1), DoubleStream.of(2).anyMatch(n -> n > 2)); } - boolean testDoubleStreamAllMatch() { + boolean testDoubleStreamAllMatchDoublePredicate() { DoublePredicate pred = i -> i > 0; return DoubleStream.of(1).allMatch(pred); } - boolean testDoubleStreamAllMatch2() { + boolean testDoubleStreamAllMatch() { return DoubleStream.of(1).allMatch(n -> n > 1); } } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableListMultimapTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableListMultimapTemplatesTestInput.java index 5c92c169fd2..bc01d1ced68 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableListMultimapTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableListMultimapTemplatesTestInput.java @@ -82,13 +82,13 @@ ImmutableSet> testIndexIterableToImmutab .collect(toImmutableListMultimap(n -> n.intValue(), identity()))); } - ImmutableListMultimap testTransformMultimapValuesToImmutableListMultimap() { + ImmutableListMultimap testImmutableListMultimapCopyOfMultimapsTransformValues() { return ImmutableListMultimap.of("foo", 1L).entries().stream() .collect(toImmutableListMultimap(Map.Entry::getKey, e -> Math.toIntExact(e.getValue()))); } ImmutableSet> - testTransformMultimapValuesToImmutableListMultimap2() { + testImmutableListMultimapCopyOfMultimapsTransformValuesTransformation() { return ImmutableSet.of( ImmutableSetMultimap.of("foo", 1L).asMap().entrySet().stream() .collect( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableListMultimapTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableListMultimapTemplatesTestOutput.java index f9ccde87e5e..1e6cc214561 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableListMultimapTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableListMultimapTemplatesTestOutput.java @@ -68,13 +68,13 @@ ImmutableSet> testIndexIterableToImmutab Multimaps.index(ImmutableList.of(3).iterator(), n -> n.intValue())); } - ImmutableListMultimap testTransformMultimapValuesToImmutableListMultimap() { + ImmutableListMultimap testImmutableListMultimapCopyOfMultimapsTransformValues() { return ImmutableListMultimap.copyOf( Multimaps.transformValues(ImmutableListMultimap.of("foo", 1L), v -> Math.toIntExact(v))); } ImmutableSet> - testTransformMultimapValuesToImmutableListMultimap2() { + testImmutableListMultimapCopyOfMultimapsTransformValuesTransformation() { return ImmutableSet.of( ImmutableListMultimap.copyOf( Multimaps.transformValues(ImmutableSetMultimap.of("foo", 1L), Math::toIntExact)), diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableSetMultimapTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableSetMultimapTemplatesTestInput.java index 779541d5c36..3417b40d3d2 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableSetMultimapTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableSetMultimapTemplatesTestInput.java @@ -54,19 +54,19 @@ ImmutableSet> testIterableToImmutableSetMu .collect(toImmutableSetMultimap(Map.Entry::getKey, Map.Entry::getValue))); } - ImmutableSetMultimap testStreamOfMapEntriesToImmutableSetMultimap() { + ImmutableSetMultimap testStreamCollectToImmutableSetMultimap() { return Stream.of(1, 2, 3) .map(n -> Map.entry(n, n.toString())) .collect(toImmutableSetMultimap(Map.Entry::getKey, Map.Entry::getValue)); } - ImmutableSetMultimap testTransformMultimapValuesToImmutableSetMultimap() { + ImmutableSetMultimap testImmutableSetMultimapCopyOfMultimapsTransformValues() { return ImmutableSetMultimap.of("foo", 1L).entries().stream() .collect(toImmutableSetMultimap(Map.Entry::getKey, e -> Math.toIntExact(e.getValue()))); } ImmutableSet> - testTransformMultimapValuesToImmutableSetMultimap2() { + testImmutableSetMultimapCopyOfMultimapsTransformValuesTransformation() { return ImmutableSet.of( ImmutableSetMultimap.of("foo", 1L).asMap().entrySet().stream() .collect( diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableSetMultimapTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableSetMultimapTemplatesTestOutput.java index a40daadd0d6..84275527447 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableSetMultimapTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/ImmutableSetMultimapTemplatesTestOutput.java @@ -47,17 +47,17 @@ ImmutableSet> testIterableToImmutableSetMu ImmutableSetMultimap.copyOf(Iterables.cycle(Map.entry("foo", 1)))); } - ImmutableSetMultimap testStreamOfMapEntriesToImmutableSetMultimap() { + ImmutableSetMultimap testStreamCollectToImmutableSetMultimap() { return Stream.of(1, 2, 3).collect(toImmutableSetMultimap(n -> n, n -> n.toString())); } - ImmutableSetMultimap testTransformMultimapValuesToImmutableSetMultimap() { + ImmutableSetMultimap testImmutableSetMultimapCopyOfMultimapsTransformValues() { return ImmutableSetMultimap.copyOf( Multimaps.transformValues(ImmutableSetMultimap.of("foo", 1L), e -> Math.toIntExact(e))); } ImmutableSet> - testTransformMultimapValuesToImmutableSetMultimap2() { + testImmutableSetMultimapCopyOfMultimapsTransformValuesTransformation() { return ImmutableSet.of( ImmutableSetMultimap.copyOf( Multimaps.transformValues(ImmutableSetMultimap.of("foo", 1L), Math::toIntExact)), diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/IntStreamTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/IntStreamTemplatesTestInput.java index b0a27c6e60e..56403e5c13e 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/IntStreamTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/IntStreamTemplatesTestInput.java @@ -69,7 +69,7 @@ OptionalInt testIntStreamMin() { return IntStream.of(1).sorted().findFirst(); } - ImmutableSet testIntStreamNoneMatch() { + ImmutableSet testIntStreamNoneMatchIntPredicate() { IntPredicate pred = i -> i > 0; return ImmutableSet.of( !IntStream.of(1).anyMatch(n -> n > 1), @@ -77,7 +77,7 @@ ImmutableSet testIntStreamNoneMatch() { IntStream.of(3).filter(pred).findAny().isEmpty()); } - boolean testIntStreamNoneMatch2() { + boolean testIntStreamNoneMatch() { return IntStream.of(1).allMatch(n -> !(n > 1)); } @@ -87,12 +87,12 @@ ImmutableSet testIntStreamAnyMatch() { IntStream.of(2).filter(n -> n > 2).findAny().isPresent()); } - boolean testIntStreamAllMatch() { + boolean testIntStreamAllMatchIntPredicate() { IntPredicate pred = i -> i > 0; return IntStream.of(1).noneMatch(pred.negate()); } - boolean testIntStreamAllMatch2() { + boolean testIntStreamAllMatch() { return IntStream.of(1).noneMatch(n -> !(n > 1)); } } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/IntStreamTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/IntStreamTemplatesTestOutput.java index 7e27f12bd80..ade6f3540ba 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/IntStreamTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/IntStreamTemplatesTestOutput.java @@ -69,7 +69,7 @@ OptionalInt testIntStreamMin() { return IntStream.of(1).min(); } - ImmutableSet testIntStreamNoneMatch() { + ImmutableSet testIntStreamNoneMatchIntPredicate() { IntPredicate pred = i -> i > 0; return ImmutableSet.of( IntStream.of(1).noneMatch(n -> n > 1), @@ -77,7 +77,7 @@ ImmutableSet testIntStreamNoneMatch() { IntStream.of(3).noneMatch(pred)); } - boolean testIntStreamNoneMatch2() { + boolean testIntStreamNoneMatch() { return IntStream.of(1).noneMatch(n -> n > 1); } @@ -86,12 +86,12 @@ ImmutableSet testIntStreamAnyMatch() { IntStream.of(1).anyMatch(n -> n > 1), IntStream.of(2).anyMatch(n -> n > 2)); } - boolean testIntStreamAllMatch() { + boolean testIntStreamAllMatchIntPredicate() { IntPredicate pred = i -> i > 0; return IntStream.of(1).allMatch(pred); } - boolean testIntStreamAllMatch2() { + boolean testIntStreamAllMatch() { return IntStream.of(1).allMatch(n -> n > 1); } } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/LongStreamTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/LongStreamTemplatesTestInput.java index 8d3ccd69ea9..49f6f6c3b26 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/LongStreamTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/LongStreamTemplatesTestInput.java @@ -69,7 +69,7 @@ OptionalLong testLongStreamMin() { return LongStream.of(1).sorted().findFirst(); } - ImmutableSet testLongStreamNoneMatch() { + ImmutableSet testLongStreamNoneMatchLongPredicate() { LongPredicate pred = i -> i > 0; return ImmutableSet.of( !LongStream.of(1).anyMatch(n -> n > 1), @@ -77,7 +77,7 @@ ImmutableSet testLongStreamNoneMatch() { LongStream.of(3).filter(pred).findAny().isEmpty()); } - boolean testLongStreamNoneMatch2() { + boolean testLongStreamNoneMatch() { return LongStream.of(1).allMatch(n -> !(n > 1)); } @@ -87,12 +87,12 @@ ImmutableSet testLongStreamAnyMatch() { LongStream.of(2).filter(n -> n > 2).findAny().isPresent()); } - boolean testLongStreamAllMatch() { + boolean testLongStreamAllMatchLongPredicate() { LongPredicate pred = i -> i > 0; return LongStream.of(1).noneMatch(pred.negate()); } - boolean testLongStreamAllMatch2() { + boolean testLongStreamAllMatch() { return LongStream.of(1).noneMatch(n -> !(n > 1)); } } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/LongStreamTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/LongStreamTemplatesTestOutput.java index f44c3281eb7..c60d7873397 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/LongStreamTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/LongStreamTemplatesTestOutput.java @@ -69,7 +69,7 @@ OptionalLong testLongStreamMin() { return LongStream.of(1).min(); } - ImmutableSet testLongStreamNoneMatch() { + ImmutableSet testLongStreamNoneMatchLongPredicate() { LongPredicate pred = i -> i > 0; return ImmutableSet.of( LongStream.of(1).noneMatch(n -> n > 1), @@ -77,7 +77,7 @@ ImmutableSet testLongStreamNoneMatch() { LongStream.of(3).noneMatch(pred)); } - boolean testLongStreamNoneMatch2() { + boolean testLongStreamNoneMatch() { return LongStream.of(1).noneMatch(n -> n > 1); } @@ -86,12 +86,12 @@ ImmutableSet testLongStreamAnyMatch() { LongStream.of(1).anyMatch(n -> n > 1), LongStream.of(2).anyMatch(n -> n > 2)); } - boolean testLongStreamAllMatch() { + boolean testLongStreamAllMatchLongPredicate() { LongPredicate pred = i -> i > 0; return LongStream.of(1).allMatch(pred); } - boolean testLongStreamAllMatch2() { + boolean testLongStreamAllMatch() { return LongStream.of(1).allMatch(n -> n > 1); } } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/StreamTemplatesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/StreamTemplatesTestInput.java index 46175bbf694..c5f9de3832f 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/StreamTemplatesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/StreamTemplatesTestInput.java @@ -94,7 +94,7 @@ ImmutableSet> testStreamMaxNaturalOrder() { Stream.of("foo").min(reverseOrder()), Streams.findLast(Stream.of("bar").sorted())); } - ImmutableSet testStreamNoneMatch() { + ImmutableSet testStreamNoneMatchPredicate() { Predicate pred = String::isBlank; return ImmutableSet.of( !Stream.of("foo").anyMatch(s -> s.length() > 1), @@ -103,7 +103,7 @@ ImmutableSet testStreamNoneMatch() { Stream.of("qux").filter(String::isEmpty).findAny().isEmpty()); } - ImmutableSet testStreamNoneMatch2() { + ImmutableSet testStreamNoneMatch() { return ImmutableSet.of( Stream.of("foo").allMatch(s -> !s.isBlank()), Stream.of(Boolean.TRUE).allMatch(b -> !b)); } @@ -114,14 +114,14 @@ ImmutableSet testStreamAnyMatch() { Stream.of("bar").filter(String::isEmpty).findAny().isPresent()); } - ImmutableSet testStreamAllMatch() { + ImmutableSet testStreamAllMatchPredicate() { Predicate pred = String::isBlank; return ImmutableSet.of( Stream.of("foo").noneMatch(not(String::isBlank)), Stream.of("bar").noneMatch(pred.negate())); } - boolean testStreamAllMatch2() { + boolean testStreamAllMatch() { return Stream.of("foo").noneMatch(s -> !s.isBlank()); } } diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/StreamTemplatesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/StreamTemplatesTestOutput.java index 2a224d4af92..ad0234fa654 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/StreamTemplatesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/bugpatterns/StreamTemplatesTestOutput.java @@ -95,7 +95,7 @@ ImmutableSet> testStreamMaxNaturalOrder() { Stream.of("foo").max(naturalOrder()), Stream.of("bar").max(naturalOrder())); } - ImmutableSet testStreamNoneMatch() { + ImmutableSet testStreamNoneMatchPredicate() { Predicate pred = String::isBlank; return ImmutableSet.of( Stream.of("foo").noneMatch(s -> s.length() > 1), @@ -104,7 +104,7 @@ ImmutableSet testStreamNoneMatch() { Stream.of("qux").noneMatch(String::isEmpty)); } - ImmutableSet testStreamNoneMatch2() { + ImmutableSet testStreamNoneMatch() { return ImmutableSet.of( Stream.of("foo").noneMatch(s -> s.isBlank()), Stream.of(Boolean.TRUE).noneMatch(b -> b)); } @@ -114,13 +114,13 @@ ImmutableSet testStreamAnyMatch() { Stream.of("foo").anyMatch(s -> s.length() > 1), Stream.of("bar").anyMatch(String::isEmpty)); } - ImmutableSet testStreamAllMatch() { + ImmutableSet testStreamAllMatchPredicate() { Predicate pred = String::isBlank; return ImmutableSet.of( Stream.of("foo").allMatch(String::isBlank), Stream.of("bar").allMatch(pred)); } - boolean testStreamAllMatch2() { + boolean testStreamAllMatch() { return Stream.of("foo").allMatch(s -> s.isBlank()); } }