Bump docs and compatibility checking for API Level 24. Also, remove a `SubjectTest` workaround that became unnecessary not because of that bump but because of https://github.com/google/truth/commit/68d13aaddeb2bc29850fb13cba4654bf20197f22. (It involves `StringBuilder`, which doesn't become `Comparable` [until Android14 / API Level 34](https://developer.android.com/reference/java/lang/StringBuilder#compareTo%28java.lang.StringBuilder%29) ([before](https://cs.android.com/android/platform/superproject/+/android-13.0.0_r84:libcore/ojluni/src/main/java/java/lang/StringBuilder.java;l=79;drc=8b7796fe566e14dd434ea42aa69bfa32aee3b98e), [after](https://cs.android.com/android/platform/superproject/+/android-14.0.0_r1:libcore/ojluni/src/main/java/java/lang/StringBuilder.java;l=89;drc=026512bc686b4f40c0fa276298732618f769409a)).) This `minSdkVersion` bump follows [other Google foundational libraries](https://issuetracker.google.com/issues/474169350), and we expect the bump itself to have no practical impact on users. RELNOTES=Our Android `minSdkVersion` is now 24 (Nougat). This follows the minimum of Google's foundational Android libraries, and we expect it to have no practical impact on users. PiperOrigin-RevId: 953631364
diff --git a/core/src/test/java/com/google/common/truth/SubjectTest.java b/core/src/test/java/com/google/common/truth/SubjectTest.java index 397e944..f81a256 100644 --- a/core/src/test/java/com/google/common/truth/SubjectTest.java +++ b/core/src/test/java/com/google/common/truth/SubjectTest.java
@@ -813,16 +813,10 @@ "UnnecessaryStringBuilder", // We need a type that doesn't implement value-based equals(). }) public void disambiguationWithSameToString() { - /* - * We use `Object` instead of `StringBuilder` to force the compiler to choose that(Object) over - * that(Comparable): StringBuilder does not implement Comparable under Android Marshmallow, so - * the test would fail there at runtime. - */ - Object stringBuilderAsObject = new StringBuilder("foo"); AssertionError e = expectFailure( whenTesting -> - whenTesting.that(stringBuilderAsObject).isEqualTo(new StringBuilder("foo"))); + whenTesting.that(new StringBuilder("foo")).isEqualTo(new StringBuilder("foo"))); assertFailureKeys(e, "expected", "but was"); assertFailureValue(e, "expected", "foo"); assertFailureValue(
diff --git a/pom.xml b/pom.xml index fb34361..4c8cce7 100644 --- a/pom.xml +++ b/pom.xml
@@ -290,8 +290,8 @@ <annotations>com.google.common.truth.IgnoreJRERequirement</annotations> <signature> <groupId>com.toasttab.android</groupId> - <artifactId>gummy-bears-api-23</artifactId> - <version>0.12.0</version> + <artifactId>gummy-bears-api-24</artifactId> + <version>0.15.0</version> <!-- TODO(cpovirk): In principle, it would make sense to *also* test compatibility with JDK 1.8, since Truth also has JRE users. --> </signature> </configuration>