From 4e4f9b3a69ec8560c126c0abba99032f9b89e245 Mon Sep 17 00:00:00 2001 From: Inderjeet Singh Date: Thu, 10 Mar 2011 23:19:58 +0000 Subject: [PATCH] Preconditions.checkState() now throws IllegalStateException instead of IllegalArgumentException. This will potentiallly break backwards compatibility. Removed unhelpful message while constructing exceptions. --- gson/src/main/java/com/google/gson/Preconditions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gson/src/main/java/com/google/gson/Preconditions.java b/gson/src/main/java/com/google/gson/Preconditions.java index a37477f7..3ca2dfbe 100644 --- a/gson/src/main/java/com/google/gson/Preconditions.java +++ b/gson/src/main/java/com/google/gson/Preconditions.java @@ -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(); } } }