1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.jdo.impl.enhancer.util;
20
21
22 /***
23 * Support for signalling internal implementation errors.
24 */
25 public class Assertion {
26
27 static protected final void affirm(boolean condition) {
28 if (!condition)
29 throw new InternalError("assertion failed.");
30 }
31
32 static protected final void affirm(boolean condition, String msg) {
33 if (!condition)
34 throw new InternalError("assertion failed: " + msg);
35 }
36
37 static protected final void affirm(Object object) {
38 if (object == null)
39 throw new InternalError("assertion failed.");
40 }
41
42 static protected final void affirm(Object object, String msg) {
43 if (object == null)
44 throw new InternalError("assertion failed: " + msg);
45 }
46 }