Skip to content

Commit

Permalink
Remove some references to Java 7.
Browse files Browse the repository at this point in the history
Guava has required Java 8 for a while now.

Note also that the APIs in question are available even under Android [even without opt-in library desugaring](https://r8.googlesource.com/r8/+/refs/heads/main/src/main/java/com/android/tools/r8/ir/desugar/BackportedMethodRewriter.java).

RELNOTES=n/a
PiperOrigin-RevId: 654844953
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Jul 22, 2024
1 parent e449414 commit 5ccc169
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions android/guava/src/com/google/common/base/Objects.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private Objects() {}
* <p>This assumes that any non-null objects passed to this function conform to the {@code
* equals()} contract.
*
* <p><b>Java 7+ users:</b> This method should be treated as deprecated; use {@link
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use {@link
* java.util.Objects#equals} instead.
*/
public static boolean equal(@CheckForNull Object a, @CheckForNull Object b) {
Expand All @@ -72,7 +72,7 @@ public static boolean equal(@CheckForNull Object a, @CheckForNull Object b) {
* <p><b>Warning:</b> When a single object is supplied, the returned hash code does not equal the
* hash code of that object.
*
* <p><b>Java 7+ users:</b> This method should be treated as deprecated; use {@link
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use {@link
* java.util.Objects#hash} instead.
*/
public static int hashCode(@CheckForNull @Nullable Object... objects) {
Expand Down
8 changes: 4 additions & 4 deletions android/guava/src/com/google/common/io/Files.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,10 @@ public static boolean equal(File file1, File file2) throws IOException {
* context.getCacheDir()}), and create your own directory under that. (For example, you might
* use {@code new File(context.getCacheDir(), "directoryname").mkdir()}, or, if you need an
* arbitrary number of temporary directories, you might have to generate multiple directory
* names in a loop until {@code mkdir()} returns {@code true}.) For Java 7+ users, prefer
* {@link java.nio.file.Files#createTempDirectory}, transforming it to a {@link File} using
* {@link java.nio.file.Path#toFile() toFile()} if needed. To restrict permissions as this
* method does, pass {@code
* names in a loop until {@code mkdir()} returns {@code true}.) For JRE users, prefer {@link
* java.nio.file.Files#createTempDirectory}, transforming it to a {@link File} using {@link
* java.nio.file.Path#toFile() toFile()} if needed. To restrict permissions as this method
* does, pass {@code
* PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwx------"))} to your
* call to {@code createTempDirectory}.
*/
Expand Down
4 changes: 2 additions & 2 deletions android/guava/src/com/google/common/primitives/Booleans.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public static int hashCode(boolean value) {
* considered less than {@code true}). The sign of the value returned is the same as that of
* {@code ((Boolean) a).compareTo(b)}.
*
* <p><b>Java 7+ users:</b> this method should be treated as deprecated; use the equivalent {@link
* Boolean#compare} method instead.
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
* equivalent {@link Boolean#compare} method instead.
*
* @param a the first {@code boolean} to compare
* @param b the second {@code boolean} to compare
Expand Down
4 changes: 2 additions & 2 deletions android/guava/src/com/google/common/primitives/Chars.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public static char saturatedCast(long value) {
* Compares the two specified {@code char} values. The sign of the value returned is the same as
* that of {@code ((Character) a).compareTo(b)}.
*
* <p><b>Java 7+ users:</b> this method should be treated as deprecated; use the equivalent {@link
* Character#compare} method instead.
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
* equivalent {@link Character#compare} method instead.
*
* @param a the first {@code char} to compare
* @param b the second {@code char} to compare
Expand Down
4 changes: 2 additions & 2 deletions android/guava/src/com/google/common/primitives/Ints.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public static int saturatedCast(long value) {
* Compares the two specified {@code int} values. The sign of the value returned is the same as
* that of {@code ((Integer) a).compareTo(b)}.
*
* <p><b>Java 7+ users:</b> this method should be treated as deprecated; use the equivalent {@link
* Integer#compare} method instead.
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
* equivalent {@link Integer#compare} method instead.
*
* @param a the first {@code int} to compare
* @param b the second {@code int} to compare
Expand Down
4 changes: 2 additions & 2 deletions android/guava/src/com/google/common/primitives/Longs.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public static int hashCode(long value) {
* Compares the two specified {@code long} values. The sign of the value returned is the same as
* that of {@code ((Long) a).compareTo(b)}.
*
* <p><b>Java 7+ users:</b> this method should be treated as deprecated; use the equivalent {@link
* Long#compare} method instead.
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
* equivalent {@link Long#compare} method instead.
*
* @param a the first {@code long} to compare
* @param b the second {@code long} to compare
Expand Down
4 changes: 2 additions & 2 deletions android/guava/src/com/google/common/primitives/Shorts.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public static short saturatedCast(long value) {
* Compares the two specified {@code short} values. The sign of the value returned is the same as
* that of {@code ((Short) a).compareTo(b)}.
*
* <p><b>Java 7+ users:</b> this method should be treated as deprecated; use the equivalent {@link
* Short#compare} method instead.
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
* equivalent {@link Short#compare} method instead.
*
* @param a the first {@code short} to compare
* @param b the second {@code short} to compare
Expand Down
4 changes: 2 additions & 2 deletions guava/src/com/google/common/base/Objects.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private Objects() {}
* <p>This assumes that any non-null objects passed to this function conform to the {@code
* equals()} contract.
*
* <p><b>Java 7+ users:</b> This method should be treated as deprecated; use {@link
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use {@link
* java.util.Objects#equals} instead.
*/
public static boolean equal(@CheckForNull Object a, @CheckForNull Object b) {
Expand All @@ -72,7 +72,7 @@ public static boolean equal(@CheckForNull Object a, @CheckForNull Object b) {
* <p><b>Warning:</b> When a single object is supplied, the returned hash code does not equal the
* hash code of that object.
*
* <p><b>Java 7+ users:</b> This method should be treated as deprecated; use {@link
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use {@link
* java.util.Objects#hash} instead.
*/
public static int hashCode(@CheckForNull @Nullable Object... objects) {
Expand Down
8 changes: 4 additions & 4 deletions guava/src/com/google/common/io/Files.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,10 @@ public static boolean equal(File file1, File file2) throws IOException {
* context.getCacheDir()}), and create your own directory under that. (For example, you might
* use {@code new File(context.getCacheDir(), "directoryname").mkdir()}, or, if you need an
* arbitrary number of temporary directories, you might have to generate multiple directory
* names in a loop until {@code mkdir()} returns {@code true}.) For Java 7+ users, prefer
* {@link java.nio.file.Files#createTempDirectory}, transforming it to a {@link File} using
* {@link java.nio.file.Path#toFile() toFile()} if needed. To restrict permissions as this
* method does, pass {@code
* names in a loop until {@code mkdir()} returns {@code true}.) For JRE users, prefer {@link
* java.nio.file.Files#createTempDirectory}, transforming it to a {@link File} using {@link
* java.nio.file.Path#toFile() toFile()} if needed. To restrict permissions as this method
* does, pass {@code
* PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwx------"))} to your
* call to {@code createTempDirectory}.
*/
Expand Down
4 changes: 2 additions & 2 deletions guava/src/com/google/common/primitives/Booleans.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public static int hashCode(boolean value) {
* considered less than {@code true}). The sign of the value returned is the same as that of
* {@code ((Boolean) a).compareTo(b)}.
*
* <p><b>Java 7+ users:</b> this method should be treated as deprecated; use the equivalent {@link
* Boolean#compare} method instead.
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
* equivalent {@link Boolean#compare} method instead.
*
* @param a the first {@code boolean} to compare
* @param b the second {@code boolean} to compare
Expand Down
4 changes: 2 additions & 2 deletions guava/src/com/google/common/primitives/Chars.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public static char saturatedCast(long value) {
* Compares the two specified {@code char} values. The sign of the value returned is the same as
* that of {@code ((Character) a).compareTo(b)}.
*
* <p><b>Java 7+ users:</b> this method should be treated as deprecated; use the equivalent {@link
* Character#compare} method instead.
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
* equivalent {@link Character#compare} method instead.
*
* @param a the first {@code char} to compare
* @param b the second {@code char} to compare
Expand Down
4 changes: 2 additions & 2 deletions guava/src/com/google/common/primitives/Ints.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public static int saturatedCast(long value) {
* Compares the two specified {@code int} values. The sign of the value returned is the same as
* that of {@code ((Integer) a).compareTo(b)}.
*
* <p><b>Java 7+ users:</b> this method should be treated as deprecated; use the equivalent {@link
* Integer#compare} method instead.
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
* equivalent {@link Integer#compare} method instead.
*
* @param a the first {@code int} to compare
* @param b the second {@code int} to compare
Expand Down
4 changes: 2 additions & 2 deletions guava/src/com/google/common/primitives/Longs.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public static int hashCode(long value) {
* Compares the two specified {@code long} values. The sign of the value returned is the same as
* that of {@code ((Long) a).compareTo(b)}.
*
* <p><b>Java 7+ users:</b> this method should be treated as deprecated; use the equivalent {@link
* Long#compare} method instead.
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
* equivalent {@link Long#compare} method instead.
*
* @param a the first {@code long} to compare
* @param b the second {@code long} to compare
Expand Down
4 changes: 2 additions & 2 deletions guava/src/com/google/common/primitives/Shorts.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public static short saturatedCast(long value) {
* Compares the two specified {@code short} values. The sign of the value returned is the same as
* that of {@code ((Short) a).compareTo(b)}.
*
* <p><b>Java 7+ users:</b> this method should be treated as deprecated; use the equivalent {@link
* Short#compare} method instead.
* <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
* equivalent {@link Short#compare} method instead.
*
* @param a the first {@code short} to compare
* @param b the second {@code short} to compare
Expand Down

0 comments on commit 5ccc169

Please sign in to comment.