]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_4_2-src/main/classes/core/src/com/ibm/icu/impl/Assert.java
go
[Dictionary.git] / jars / icu4j-4_4_2-src / main / classes / core / src / com / ibm / icu / impl / Assert.java
1 /*\r
2 *******************************************************************************\r
3 *   Copyright (C) 2005-2006, International Business Machines\r
4 *   Corporation and others.  All Rights Reserved.\r
5 *******************************************************************************\r
6 */\r
7 package com.ibm.icu.impl;\r
8 \r
9 // 1.3 compatibility layer\r
10 public class Assert {\r
11     public static void fail(Exception e) {\r
12         fail(e.toString()); // can't wrap exceptions in jdk 1.3\r
13     }\r
14     public static void fail(String msg) {\r
15         throw new IllegalStateException("failure '" + msg + "'");\r
16     }\r
17     public static void assrt(boolean val) {\r
18         if (!val) throw new IllegalStateException("assert failed");\r
19     }\r
20     public static void assrt(String msg, boolean val) {\r
21         if (!val) throw new IllegalStateException("assert '" + msg + "' failed");\r
22     }\r
23 }\r