Index: remoting/android/java/src/org/chromium/chromoting/Preconditions.java |
diff --git a/remoting/android/java/src/org/chromium/chromoting/Preconditions.java b/remoting/android/java/src/org/chromium/chromoting/Preconditions.java |
index 5df5b781704c74fafabf88aa308c686246b8ce8b..963153754043460bce79b2cfa4b5f8d9b5b52bec 100644 |
--- a/remoting/android/java/src/org/chromium/chromoting/Preconditions.java |
+++ b/remoting/android/java/src/org/chromium/chromoting/Preconditions.java |
@@ -25,7 +25,7 @@ public final class Preconditions { |
} |
/** |
- * Checks whether input |ref| is not a null reference, and return its value. Throws |
+ * Checks whether input |ref| is not a null reference, and returns its value. Throws |
* {@link NullPointerException} if |ref| is null. |
*/ |
public static final <T> T notNull(T ref) { |
@@ -34,4 +34,15 @@ public final class Preconditions { |
} |
return ref; |
} |
+ |
+ /** |
+ * Checks whether input |ref| is a null reference, and returns its value. Throws |
+ * {@link IllegalArgumentException} if |ref| is not null. |
+ */ |
+ public static final <T> T isNull(T ref) { |
+ if (ref != null) { |
+ throw new IllegalArgumentException(); |
+ } |
+ return ref; |
+ } |
} |