Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Unified Diff: remoting/android/java/src/org/chromium/chromoting/Preconditions.java

Issue 2035303002: [Chromoting] Decouple DesktopView and TouchInputHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync latest changes Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698