diff options
Diffstat (limited to 'guava/src/com/google/common/collect/CollectPreconditions.java')
-rw-r--r-- | guava/src/com/google/common/collect/CollectPreconditions.java | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/guava/src/com/google/common/collect/CollectPreconditions.java b/guava/src/com/google/common/collect/CollectPreconditions.java index 98b30c6d5..e3e1cbece 100644 --- a/guava/src/com/google/common/collect/CollectPreconditions.java +++ b/guava/src/com/google/common/collect/CollectPreconditions.java @@ -19,9 +19,10 @@ package com.google.common.collect; import static com.google.common.base.Preconditions.checkState; import com.google.common.annotations.GwtCompatible; -import com.google.errorprone.annotations.CanIgnoreReturnValue; -/** Precondition checks useful in collection implementations. */ +/** + * Precondition checks useful in collection implementations. + */ @GwtCompatible final class CollectPreconditions { @@ -33,7 +34,6 @@ final class CollectPreconditions { } } - @CanIgnoreReturnValue static int checkNonnegative(int value, String name) { if (value < 0) { throw new IllegalArgumentException(name + " cannot be negative but was: " + value); @@ -41,20 +41,6 @@ final class CollectPreconditions { return value; } - @CanIgnoreReturnValue - static long checkNonnegative(long value, String name) { - if (value < 0) { - throw new IllegalArgumentException(name + " cannot be negative but was: " + value); - } - return value; - } - - static void checkPositive(int value, String name) { - if (value <= 0) { - throw new IllegalArgumentException(name + " must be positive but was: " + value); - } - } - /** * Precondition tester for {@code Iterator.remove()} that throws an exception with a consistent * error message. |