michael@0: package org.mozilla.gecko; michael@0: michael@0: public class Assert michael@0: { michael@0: private Assert() {} michael@0: michael@0: public static void equals(Object a, Object b) michael@0: { michael@0: equals(a, b, null); michael@0: } michael@0: michael@0: public static void equals(Object a, Object b, String message) michael@0: { michael@0: Assert.isTrue(a.equals(b), message); michael@0: } michael@0: michael@0: public static void isTrue(boolean a) michael@0: { michael@0: isTrue(a, null); michael@0: } michael@0: michael@0: public static void isTrue(boolean a, String message) michael@0: { michael@0: if (!AppConstants.DEBUG_BUILD) { michael@0: return; michael@0: } michael@0: michael@0: if (!a) { michael@0: throw new AssertException(message); michael@0: } michael@0: } michael@0: michael@0: public static class AssertException extends RuntimeException michael@0: { michael@0: private static final long serialVersionUID = 0L; michael@0: michael@0: public AssertException(String message) { michael@0: super(message); michael@0: } michael@0: } michael@0: }