Preconditions.checkState() now throws IllegalStateException instead of IllegalArgumentException. This will potentiallly break backwards compatibility.

Removed unhelpful message while constructing exceptions.
This commit is contained in:
Inderjeet Singh 2011-03-10 23:19:58 +00:00
parent 52288d7127
commit 4e4f9b3a69

View File

@ -36,13 +36,13 @@ final class Preconditions {
public static void checkArgument(boolean condition) {
if (!condition) {
throw new IllegalArgumentException("condition failed: " + condition);
throw new IllegalArgumentException();
}
}
public static void checkState(boolean condition) {
if (!condition) {
throw new IllegalArgumentException("condition failed: " + condition);
throw new IllegalStateException();
}
}
}