Skip to content

Commit 9a406e7

Browse files
cushonGoogle Java Core Libraries
authored andcommitted
Fix a compilation error caused by https://bugs.openjdk.org/browse/JDK-8357219
RELNOTES=n/a PiperOrigin-RevId: 811351810
1 parent d7240c0 commit 9a406e7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

android/guava/src/com/google/common/primitives/Booleans.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import static com.google.common.base.Preconditions.checkElementIndex;
1919
import static com.google.common.base.Preconditions.checkNotNull;
2020
import static com.google.common.base.Preconditions.checkPositionIndexes;
21-
import static java.lang.Math.min;
2221

2322
import com.google.common.annotations.GwtCompatible;
2423
import com.google.common.annotations.GwtIncompatible;
@@ -321,7 +320,9 @@ private enum LexicographicalComparator implements Comparator<boolean[]> {
321320

322321
@Override
323322
public int compare(boolean[] left, boolean[] right) {
324-
int minLength = min(left.length, right.length);
323+
// do not static import Math.min due to https://bugs.openjdk.org/browse/JDK-8357219
324+
@SuppressWarnings("StaticImportPreferred")
325+
int minLength = Math.min(left.length, right.length);
325326
for (int i = 0; i < minLength; i++) {
326327
int result = Boolean.compare(left[i], right[i]);
327328
if (result != 0) {

guava/src/com/google/common/primitives/Booleans.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import static com.google.common.base.Preconditions.checkElementIndex;
1919
import static com.google.common.base.Preconditions.checkNotNull;
2020
import static com.google.common.base.Preconditions.checkPositionIndexes;
21-
import static java.lang.Math.min;
2221

2322
import com.google.common.annotations.GwtCompatible;
2423
import com.google.common.annotations.GwtIncompatible;
@@ -321,7 +320,9 @@ private enum LexicographicalComparator implements Comparator<boolean[]> {
321320

322321
@Override
323322
public int compare(boolean[] left, boolean[] right) {
324-
int minLength = min(left.length, right.length);
323+
// do not static import Math.min due to https://bugs.openjdk.org/browse/JDK-8357219
324+
@SuppressWarnings("StaticImportPreferred")
325+
int minLength = Math.min(left.length, right.length);
325326
for (int i = 0; i < minLength; i++) {
326327
int result = Boolean.compare(left[i], right[i]);
327328
if (result != 0) {

0 commit comments

Comments
 (0)