com.novell.xsl.debug
Class Assert

java.lang.Object
  extended bycom.novell.xsl.debug.Assert

public final class Assert
extends Object

A simple assertion class.


Field Summary
static boolean ENABLED
          Flag that enables or disables assertions.
 
Method Summary
static void assertCondition(boolean condition, String description)
          Asserts that the specified condition is true.
static void assertNotReached()
          Asserts that the calling statement is never reached.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENABLED

public static final boolean ENABLED
Flag that enables or disables assertions. When this flag is false, most compilers' optimizers, including javac -O, should be able to eliminate any runtime cost.

See Also:
Constant Field Values
Method Detail

assertCondition

public static void assertCondition(boolean condition,
                                   String description)
Asserts that the specified condition is true.

Parameters:
condition - the condition that must be satisfied
description - a description of the potential failure
Throws:
AssertionException - if the condition is false

assertNotReached

public static void assertNotReached()
Asserts that the calling statement is never reached.

Throws:
AssertionException - always thrown