From 63f57279174e8ef3141dbaf259af9e34ee989384 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Tue, 26 Nov 2024 09:15:48 -0800 Subject: [PATCH] Bump Error Prone to 2.36.0, including setting `--should-stop=ifError=FLOW`. Fixes https://github.com/google/jimfs/pull/383 In Guava, resolve a https://errorprone.info/bugpattern/DuplicateBranches error (though that will [soon be only a warning](https://github.com/google/error-prone/pull/4700)) by just eliminating the branch. Hopefully that is fine. RELNOTES=n/a PiperOrigin-RevId: 700364699 --- .../test/com/google/common/math/DoubleMathTest.java | 9 ++------- android/pom.xml | 5 +++-- .../test/com/google/common/math/DoubleMathTest.java | 9 ++------- integration-tests/gradle/build.gradle.kts | 4 ++-- pom.xml | 5 +++-- 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/android/guava-tests/test/com/google/common/math/DoubleMathTest.java b/android/guava-tests/test/com/google/common/math/DoubleMathTest.java index 8b3742ee454f..c9c12c8194d6 100644 --- a/android/guava-tests/test/com/google/common/math/DoubleMathTest.java +++ b/android/guava-tests/test/com/google/common/math/DoubleMathTest.java @@ -356,13 +356,8 @@ public void testRoundLog2Half() { for (RoundingMode mode : asList(HALF_EVEN, HALF_UP, HALF_DOWN)) { double x = Math.scalb(Math.sqrt(2) + 0.001, exp); double y = Math.scalb(Math.sqrt(2) - 0.001, exp); - if (exp < 0) { - assertEquals(exp + 1, DoubleMath.log2(x, mode)); - assertEquals(exp, DoubleMath.log2(y, mode)); - } else { - assertEquals(exp + 1, DoubleMath.log2(x, mode)); - assertEquals(exp, DoubleMath.log2(y, mode)); - } + assertEquals(exp + 1, DoubleMath.log2(x, mode)); + assertEquals(exp, DoubleMath.log2(y, mode)); } } } diff --git a/android/pom.xml b/android/pom.xml index 7f5b28ef6f2c..ae6f9a117a1f 100644 --- a/android/pom.xml +++ b/android/pom.xml @@ -23,7 +23,7 @@ 1.4.4 3.0.2 3.43.0 - 2.28.0 + 2.36.0 3.0.0 @@ -144,6 +144,7 @@ doesnotexist -XDcompilePolicy=simple + --should-stop=ifError=FLOW diff --git a/guava-tests/test/com/google/common/math/DoubleMathTest.java b/guava-tests/test/com/google/common/math/DoubleMathTest.java index 8b3742ee454f..c9c12c8194d6 100644 --- a/guava-tests/test/com/google/common/math/DoubleMathTest.java +++ b/guava-tests/test/com/google/common/math/DoubleMathTest.java @@ -356,13 +356,8 @@ public void testRoundLog2Half() { for (RoundingMode mode : asList(HALF_EVEN, HALF_UP, HALF_DOWN)) { double x = Math.scalb(Math.sqrt(2) + 0.001, exp); double y = Math.scalb(Math.sqrt(2) - 0.001, exp); - if (exp < 0) { - assertEquals(exp + 1, DoubleMath.log2(x, mode)); - assertEquals(exp, DoubleMath.log2(y, mode)); - } else { - assertEquals(exp + 1, DoubleMath.log2(x, mode)); - assertEquals(exp, DoubleMath.log2(y, mode)); - } + assertEquals(exp + 1, DoubleMath.log2(x, mode)); + assertEquals(exp, DoubleMath.log2(y, mode)); } } } diff --git a/integration-tests/gradle/build.gradle.kts b/integration-tests/gradle/build.gradle.kts index f2830db76f36..94f74f77831e 100644 --- a/integration-tests/gradle/build.gradle.kts +++ b/integration-tests/gradle/build.gradle.kts @@ -11,7 +11,7 @@ val expectedReducedRuntimeClasspathAndroidVersion = "j2objc-annotations-3.0.0.jar", "jsr305-3.0.2.jar", "checker-qual-3.43.0.jar", - "error_prone_annotations-2.28.0.jar", + "error_prone_annotations-2.36.0.jar", "listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" ) val expectedReducedRuntimeClasspathJreVersion = @@ -21,7 +21,7 @@ val expectedReducedRuntimeClasspathJreVersion = "j2objc-annotations-3.0.0.jar", "jsr305-3.0.2.jar", "checker-qual-3.43.0.jar", - "error_prone_annotations-2.28.0.jar", + "error_prone_annotations-2.36.0.jar", "listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" ) val expectedCompileClasspathAndroidVersion = expectedReducedRuntimeClasspathAndroidVersion diff --git a/pom.xml b/pom.xml index c61eb8bf645d..ab2fa84833b9 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ 1.4.4 3.0.2 3.43.0 - 2.28.0 + 2.36.0 3.0.0 @@ -145,6 +145,7 @@ doesnotexist -XDcompilePolicy=simple + --should-stop=ifError=FLOW