Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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 }