diff --git a/android/guava/src/com/google/common/collect/MoreCollectors.java b/android/guava/src/com/google/common/collect/MoreCollectors.java index 02b254d2d54c..f010eea73b5e 100644 --- a/android/guava/src/com/google/common/collect/MoreCollectors.java +++ b/android/guava/src/com/google/common/collect/MoreCollectors.java @@ -103,7 +103,7 @@ private static final class ToOptionalState { extras = emptyList(); } - IllegalArgumentException multiples(boolean overflow) { + void multiples(boolean overflow) { StringBuilder sb = new StringBuilder().append("expected one element but was: <").append(element); for (Object o : extras) { @@ -127,7 +127,7 @@ void add(Object o) { } else if (extras.size() < MAX_EXTRAS) { extras.add(o); } else { - throw multiples(true); + multiples(true); } } @@ -145,7 +145,7 @@ ToOptionalState combine(ToOptionalState other) { extras.addAll(other.extras); if (extras.size() > MAX_EXTRAS) { extras.subList(MAX_EXTRAS, extras.size()).clear(); - throw multiples(true); + multiples(true); } return this; } @@ -156,7 +156,7 @@ Optional getOptional() { if (extras.isEmpty()) { return Optional.ofNullable(element); } else { - throw multiples(false); + multiples(false); } } @@ -166,7 +166,7 @@ Object getElement() { } else if (extras.isEmpty()) { return element; } else { - throw multiples(false); + multiples(false); } } } diff --git a/guava/src/com/google/common/collect/MoreCollectors.java b/guava/src/com/google/common/collect/MoreCollectors.java index 3c57ea0a9388..027fc7ff8c89 100644 --- a/guava/src/com/google/common/collect/MoreCollectors.java +++ b/guava/src/com/google/common/collect/MoreCollectors.java @@ -102,7 +102,7 @@ private static final class ToOptionalState { extras = emptyList(); } - IllegalArgumentException multiples(boolean overflow) { + void multiples(boolean overflow) { StringBuilder sb = new StringBuilder().append("expected one element but was: <").append(element); for (Object o : extras) { @@ -126,7 +126,7 @@ void add(Object o) { } else if (extras.size() < MAX_EXTRAS) { extras.add(o); } else { - throw multiples(true); + multiples(true); } } @@ -144,7 +144,7 @@ ToOptionalState combine(ToOptionalState other) { extras.addAll(other.extras); if (extras.size() > MAX_EXTRAS) { extras.subList(MAX_EXTRAS, extras.size()).clear(); - throw multiples(true); + multiples(true); } return this; } @@ -154,7 +154,7 @@ Optional getOptional() { if (extras.isEmpty()) { return Optional.ofNullable(element); } else { - throw multiples(false); + multiples(false); } } @@ -164,7 +164,7 @@ Object getElement() { } else if (extras.isEmpty()) { return element; } else { - throw multiples(false); + multiples(false); } } }