From ea8f63161a205162907f1a65e41810ee35b2808c Mon Sep 17 00:00:00 2001 From: svc-excavator-bot Date: Wed, 4 Dec 2019 20:19:05 +0000 Subject: [PATCH 1/2] Excavator: Upgrades Baseline to the latest version --- .../errorprone/StringBuilderConstantParameters.java | 8 ++++---- .../refaster/AssertjCollectionHasSizeExactly.java | 2 +- .../AssertjCollectionHasSizeExactlyWithDescription.java | 2 +- .../refaster/AssertjCollectionHasSizeGreaterThan.java | 2 +- ...ssertjCollectionHasSizeGreaterThanWithDescription.java | 2 +- .../baseline/refaster/AssertjCollectionIsEmpty.java | 2 +- .../refaster/AssertjCollectionIsEmptyWithDescription.java | 2 +- .../baseline/refaster/AssertjCollectionIsNotEmpty.java | 4 ++-- .../AssertjCollectionIsNotEmptyWithDescription.java | 4 ++-- .../baseline/refaster/AssertjMapHasSizeExactly.java | 2 +- .../refaster/AssertjMapHasSizeExactlyWithDescription.java | 2 +- .../com/palantir/baseline/refaster/AssertjMapIsEmpty.java | 2 +- .../refaster/AssertjMapIsEmptyWithDescription.java | 2 +- .../com/palantir/baseline/refaster/CompilerUtility.java | 2 +- build.gradle | 2 +- .../palantir/gradle/junit/XmlReportFailuresSupplier.java | 2 +- 16 files changed, 21 insertions(+), 21 deletions(-) diff --git a/baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/StringBuilderConstantParameters.java b/baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/StringBuilderConstantParameters.java index 862fc56ed..d24074ff6 100644 --- a/baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/StringBuilderConstantParameters.java +++ b/baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/StringBuilderConstantParameters.java @@ -83,11 +83,11 @@ public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState .build(); } List arguments = result.get(); - Stream prefixStream = arguments.stream().findFirst() + Stream prefixStream = arguments.stream() + .findFirst() .map(ASTHelpers::getType) - .filter(type -> - ASTHelpers.isSameType(type, state.getTypeFromString("java.lang.String"), state)) - .map(ignored -> Stream.of()) + .filter(type -> ASTHelpers.isSameType(type, state.getTypeFromString("java.lang.String"), state)) + .map(ignored -> Stream.empty()) .orElseGet(() -> Stream.of("\"\"")); return buildDescription(tree) diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactly.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactly.java index 47df1e693..6750e7a0a 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactly.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactly.java @@ -28,7 +28,7 @@ public final class AssertjCollectionHasSizeExactly { @BeforeTemplate void bad1(Collection things, int size) { - assertThat(things.size() == size).isTrue(); + assertThat(things.size()).isEqualTo(size); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactlyWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactlyWithDescription.java index d5f6bbc85..38585bdad 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactlyWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactlyWithDescription.java @@ -29,7 +29,7 @@ public final class AssertjCollectionHasSizeExactlyWithDescription { @BeforeTemplate void bad1(Collection things, int size, String description, @Repeated Object descriptionArgs) { - assertThat(things.size() == size).describedAs(description, descriptionArgs).isTrue(); + assertThat(things.size()).describedAs(description, descriptionArgs).isEqualTo(size); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThan.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThan.java index 5ad513fa9..3e81f11cc 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThan.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThan.java @@ -28,7 +28,7 @@ public final class AssertjCollectionHasSizeGreaterThan { @BeforeTemplate void before1(Collection things, int size) { - assertThat(things.size() > size).isTrue(); + assertThat(things.size()).isGreaterThan(size); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThanWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThanWithDescription.java index 619fcea0b..854b43b9e 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThanWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThanWithDescription.java @@ -29,7 +29,7 @@ public final class AssertjCollectionHasSizeGreaterThanWithDescription { @BeforeTemplate void before1(Collection things, int size, String description, @Repeated Object descriptionArgs) { - assertThat(things.size() > size).describedAs(description, descriptionArgs).isTrue(); + assertThat(things.size()).describedAs(description, descriptionArgs).isGreaterThan(size); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmpty.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmpty.java index 833f6ac38..ba83b4dac 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmpty.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmpty.java @@ -28,7 +28,7 @@ public final class AssertjCollectionIsEmpty { @BeforeTemplate void bad1(Collection things) { - assertThat(things.size() == 0).isTrue(); + assertThat(things.size()).isEqualTo(0); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmptyWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmptyWithDescription.java index e1b9b5fd1..860b6420d 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmptyWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmptyWithDescription.java @@ -29,7 +29,7 @@ public final class AssertjCollectionIsEmptyWithDescription { @BeforeTemplate void bad1(Collection things, String description, @Repeated Object descriptionArgs) { - assertThat(things.size() == 0).describedAs(description, descriptionArgs).isTrue(); + assertThat(things.size()).describedAs(description, descriptionArgs).isEqualTo(0); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmpty.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmpty.java index 6c08e8b65..872b914f6 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmpty.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmpty.java @@ -31,12 +31,12 @@ public final class AssertjCollectionIsNotEmpty { @BeforeTemplate void bad1(Collection things) { - assertThat(things.size() != 0).isTrue(); + assertThat(things.size()).isNotEqualTo(0); } @BeforeTemplate void bad2(Collection things) { - assertThat(things.size() == 0).isFalse(); + assertThat(things.size()).isNotEqualTo(0); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmptyWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmptyWithDescription.java index c64f3166b..c7db02fc5 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmptyWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmptyWithDescription.java @@ -32,12 +32,12 @@ public final class AssertjCollectionIsNotEmptyWithDescription { @BeforeTemplate void bad1(Collection things, String description, @Repeated Object descriptionArgs) { - assertThat(things.size() != 0).describedAs(description, descriptionArgs).isTrue(); + assertThat(things.size()).describedAs(description, descriptionArgs).isNotEqualTo(0); } @BeforeTemplate void bad2(Collection things, String description, @Repeated Object descriptionArgs) { - assertThat(things.size() == 0).describedAs(description, descriptionArgs).isFalse(); + assertThat(things.size()).describedAs(description, descriptionArgs).isNotEqualTo(0); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactly.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactly.java index fbd6997f6..a6fdb767e 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactly.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactly.java @@ -28,7 +28,7 @@ public final class AssertjMapHasSizeExactly { @BeforeTemplate void before1(Map things, int size) { - assertThat(things.size() == size).isTrue(); + assertThat(things.size()).isEqualTo(size); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactlyWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactlyWithDescription.java index 2e41f72e3..83b2b0fd6 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactlyWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactlyWithDescription.java @@ -29,7 +29,7 @@ public final class AssertjMapHasSizeExactlyWithDescription { @BeforeTemplate void before1(Map things, int size, String description, @Repeated Object descriptionArgs) { - assertThat(things.size() == size).describedAs(description, descriptionArgs).isTrue(); + assertThat(things.size()).describedAs(description, descriptionArgs).isEqualTo(size); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmpty.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmpty.java index 429db8848..cb6e9a7c8 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmpty.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmpty.java @@ -28,7 +28,7 @@ public final class AssertjMapIsEmpty { @BeforeTemplate void before1(Map things) { - assertThat(things.size() == 0).isTrue(); + assertThat(things.size()).isEqualTo(0); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmptyWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmptyWithDescription.java index dcc659950..a4266200a 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmptyWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmptyWithDescription.java @@ -29,7 +29,7 @@ public final class AssertjMapIsEmptyWithDescription { @BeforeTemplate void before1(Map things, String description, @Repeated Object descriptionArgs) { - assertThat(things.size() == 0).describedAs(description, descriptionArgs).isTrue(); + assertThat(things.size()).describedAs(description, descriptionArgs).isEqualTo(0); } @BeforeTemplate diff --git a/baseline-refaster-testing/src/main/java/com/palantir/baseline/refaster/CompilerUtility.java b/baseline-refaster-testing/src/main/java/com/palantir/baseline/refaster/CompilerUtility.java index 9d3c829ea..50af9ed09 100644 --- a/baseline-refaster-testing/src/main/java/com/palantir/baseline/refaster/CompilerUtility.java +++ b/baseline-refaster-testing/src/main/java/com/palantir/baseline/refaster/CompilerUtility.java @@ -53,7 +53,7 @@ static CompilerResult compile(JavaFileObject javaFileObject) { try { trees = task.parse(); task.analyze(); - } catch (Exception e) { + } catch (RuntimeException e) { throw new RuntimeException(e); } diff --git a/build.gradle b/build.gradle index e38bbeb2a..fec0b415e 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:nebula-publishing-plugin:14.1.1' classpath 'com.netflix.nebula:gradle-info-plugin:5.2.0' - classpath 'com.palantir.baseline:gradle-baseline-java:2.38.0' + classpath 'com.palantir.baseline:gradle-baseline-java:2.40.0' } } diff --git a/gradle-junit-reports/src/main/java/com/palantir/gradle/junit/XmlReportFailuresSupplier.java b/gradle-junit-reports/src/main/java/com/palantir/gradle/junit/XmlReportFailuresSupplier.java index 68d5a70a2..57c2e6ed2 100644 --- a/gradle-junit-reports/src/main/java/com/palantir/gradle/junit/XmlReportFailuresSupplier.java +++ b/gradle-junit-reports/src/main/java/com/palantir/gradle/junit/XmlReportFailuresSupplier.java @@ -58,7 +58,7 @@ public List getFailures() throws IOException { File sourceReport = reporting.getReports().findByName("xml").getDestination(); try { return XmlUtils.parseXml(reportHandler, new FileInputStream(sourceReport)).failures(); - } catch (Exception e) { + } catch (IOException | RuntimeException e) { throw new RuntimeException(String.format("Failed to parse failures XML: %s", sourceReport), e); } } From 456ac85bfcb33d423a90989334f5911d6b125c64 Mon Sep 17 00:00:00 2001 From: forozco Date: Thu, 5 Dec 2019 10:54:17 +0000 Subject: [PATCH 2/2] revert refaster changes --- .../baseline/refaster/AssertjCollectionHasSizeExactly.java | 2 +- .../AssertjCollectionHasSizeExactlyWithDescription.java | 2 +- .../refaster/AssertjCollectionHasSizeGreaterThan.java | 2 +- .../AssertjCollectionHasSizeGreaterThanWithDescription.java | 2 +- .../palantir/baseline/refaster/AssertjCollectionIsEmpty.java | 2 +- .../refaster/AssertjCollectionIsEmptyWithDescription.java | 2 +- .../baseline/refaster/AssertjCollectionIsNotEmpty.java | 4 ++-- .../refaster/AssertjCollectionIsNotEmptyWithDescription.java | 4 ++-- .../palantir/baseline/refaster/AssertjMapHasSizeExactly.java | 2 +- .../refaster/AssertjMapHasSizeExactlyWithDescription.java | 2 +- .../com/palantir/baseline/refaster/AssertjMapIsEmpty.java | 2 +- .../baseline/refaster/AssertjMapIsEmptyWithDescription.java | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactly.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactly.java index 6750e7a0a..47df1e693 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactly.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactly.java @@ -28,7 +28,7 @@ public final class AssertjCollectionHasSizeExactly { @BeforeTemplate void bad1(Collection things, int size) { - assertThat(things.size()).isEqualTo(size); + assertThat(things.size() == size).isTrue(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactlyWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactlyWithDescription.java index 38585bdad..d5f6bbc85 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactlyWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeExactlyWithDescription.java @@ -29,7 +29,7 @@ public final class AssertjCollectionHasSizeExactlyWithDescription { @BeforeTemplate void bad1(Collection things, int size, String description, @Repeated Object descriptionArgs) { - assertThat(things.size()).describedAs(description, descriptionArgs).isEqualTo(size); + assertThat(things.size() == size).describedAs(description, descriptionArgs).isTrue(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThan.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThan.java index 3e81f11cc..5ad513fa9 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThan.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThan.java @@ -28,7 +28,7 @@ public final class AssertjCollectionHasSizeGreaterThan { @BeforeTemplate void before1(Collection things, int size) { - assertThat(things.size()).isGreaterThan(size); + assertThat(things.size() > size).isTrue(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThanWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThanWithDescription.java index 854b43b9e..619fcea0b 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThanWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionHasSizeGreaterThanWithDescription.java @@ -29,7 +29,7 @@ public final class AssertjCollectionHasSizeGreaterThanWithDescription { @BeforeTemplate void before1(Collection things, int size, String description, @Repeated Object descriptionArgs) { - assertThat(things.size()).describedAs(description, descriptionArgs).isGreaterThan(size); + assertThat(things.size() > size).describedAs(description, descriptionArgs).isTrue(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmpty.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmpty.java index ba83b4dac..833f6ac38 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmpty.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmpty.java @@ -28,7 +28,7 @@ public final class AssertjCollectionIsEmpty { @BeforeTemplate void bad1(Collection things) { - assertThat(things.size()).isEqualTo(0); + assertThat(things.size() == 0).isTrue(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmptyWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmptyWithDescription.java index 860b6420d..e1b9b5fd1 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmptyWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsEmptyWithDescription.java @@ -29,7 +29,7 @@ public final class AssertjCollectionIsEmptyWithDescription { @BeforeTemplate void bad1(Collection things, String description, @Repeated Object descriptionArgs) { - assertThat(things.size()).describedAs(description, descriptionArgs).isEqualTo(0); + assertThat(things.size() == 0).describedAs(description, descriptionArgs).isTrue(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmpty.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmpty.java index 872b914f6..6c08e8b65 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmpty.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmpty.java @@ -31,12 +31,12 @@ public final class AssertjCollectionIsNotEmpty { @BeforeTemplate void bad1(Collection things) { - assertThat(things.size()).isNotEqualTo(0); + assertThat(things.size() != 0).isTrue(); } @BeforeTemplate void bad2(Collection things) { - assertThat(things.size()).isNotEqualTo(0); + assertThat(things.size() == 0).isFalse(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmptyWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmptyWithDescription.java index c7db02fc5..c64f3166b 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmptyWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjCollectionIsNotEmptyWithDescription.java @@ -32,12 +32,12 @@ public final class AssertjCollectionIsNotEmptyWithDescription { @BeforeTemplate void bad1(Collection things, String description, @Repeated Object descriptionArgs) { - assertThat(things.size()).describedAs(description, descriptionArgs).isNotEqualTo(0); + assertThat(things.size() != 0).describedAs(description, descriptionArgs).isTrue(); } @BeforeTemplate void bad2(Collection things, String description, @Repeated Object descriptionArgs) { - assertThat(things.size()).describedAs(description, descriptionArgs).isNotEqualTo(0); + assertThat(things.size() == 0).describedAs(description, descriptionArgs).isFalse(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactly.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactly.java index a6fdb767e..fbd6997f6 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactly.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactly.java @@ -28,7 +28,7 @@ public final class AssertjMapHasSizeExactly { @BeforeTemplate void before1(Map things, int size) { - assertThat(things.size()).isEqualTo(size); + assertThat(things.size() == size).isTrue(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactlyWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactlyWithDescription.java index 83b2b0fd6..2e41f72e3 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactlyWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapHasSizeExactlyWithDescription.java @@ -29,7 +29,7 @@ public final class AssertjMapHasSizeExactlyWithDescription { @BeforeTemplate void before1(Map things, int size, String description, @Repeated Object descriptionArgs) { - assertThat(things.size()).describedAs(description, descriptionArgs).isEqualTo(size); + assertThat(things.size() == size).describedAs(description, descriptionArgs).isTrue(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmpty.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmpty.java index cb6e9a7c8..429db8848 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmpty.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmpty.java @@ -28,7 +28,7 @@ public final class AssertjMapIsEmpty { @BeforeTemplate void before1(Map things) { - assertThat(things.size()).isEqualTo(0); + assertThat(things.size() == 0).isTrue(); } @BeforeTemplate diff --git a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmptyWithDescription.java b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmptyWithDescription.java index a4266200a..dcc659950 100644 --- a/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmptyWithDescription.java +++ b/baseline-refaster-rules/src/main/java/com/palantir/baseline/refaster/AssertjMapIsEmptyWithDescription.java @@ -29,7 +29,7 @@ public final class AssertjMapIsEmptyWithDescription { @BeforeTemplate void before1(Map things, String description, @Repeated Object descriptionArgs) { - assertThat(things.size()).describedAs(description, descriptionArgs).isEqualTo(0); + assertThat(things.size() == 0).describedAs(description, descriptionArgs).isTrue(); } @BeforeTemplate