mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 04:18:53 +01:00
Add requireNull() utility method.
This commit is contained in:
@@ -22,4 +22,11 @@ public class NullSafety {
|
|||||||
@Nullable Object b) {
|
@Nullable Object b) {
|
||||||
if ((a == null) == (b == null)) throw new AssertionError();
|
if ((a == null) == (b == null)) throw new AssertionError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks that the argument is null.
|
||||||
|
*/
|
||||||
|
public static void requireNull(@Nullable Object o) {
|
||||||
|
if (o != null) throw new AssertionError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user