Fri, 16 Jan 2015 04:50:19 +0100
Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32
1 package org.mozilla.gecko;
3 public class Assert
4 {
5 private Assert() {}
7 public static void equals(Object a, Object b)
8 {
9 equals(a, b, null);
10 }
12 public static void equals(Object a, Object b, String message)
13 {
14 Assert.isTrue(a.equals(b), message);
15 }
17 public static void isTrue(boolean a)
18 {
19 isTrue(a, null);
20 }
22 public static void isTrue(boolean a, String message)
23 {
24 if (!AppConstants.DEBUG_BUILD) {
25 return;
26 }
28 if (!a) {
29 throw new AssertException(message);
30 }
31 }
33 public static class AssertException extends RuntimeException
34 {
35 private static final long serialVersionUID = 0L;
37 public AssertException(String message) {
38 super(message);
39 }
40 }
41 }