Home | History | Annotate | Download | only in impl
      1 //  2016 and later: Unicode, Inc. and others.
      2 // License & terms of use: http://www.unicode.org/copyright.html#License
      3 /*
      4 *******************************************************************************
      5 *   Copyright (C) 2005-2006, International Business Machines
      6 *   Corporation and others.  All Rights Reserved.
      7 *******************************************************************************
      8 */
      9 package com.ibm.icu.impl;
     10 
     11 // 1.3 compatibility layer
     12 public class Assert {
     13     public static void fail(Exception e) {
     14         fail(e.toString()); // can't wrap exceptions in jdk 1.3
     15     }
     16     public static void fail(String msg) {
     17         throw new IllegalStateException("failure '" + msg + "'");
     18     }
     19     public static void assrt(boolean val) {
     20         if (!val) throw new IllegalStateException("assert failed");
     21     }
     22     public static void assrt(String msg, boolean val) {
     23         if (!val) throw new IllegalStateException("assert '" + msg + "' failed");
     24     }
     25 }
     26