org.exist.util.sanity
Class SanityCheck

java.lang.Object
  extended byorg.exist.util.sanity.SanityCheck

public class SanityCheck
extends java.lang.Object

Utility class for sanity checks. Provides static methods ASSERT, THROW_ASSERT which can be used in the code to react to unexpected conditions. ASSERT(boolean) logs a stack trace to the log4j log output. THROW_ASSERT(boolean) throws an additional runtime exception.

Author:
wolf

Constructor Summary
SanityCheck()
           
 
Method Summary
static void ASSERT(boolean mustBeTrue)
           
static void ASSERT(boolean mustBeTrue, java.lang.String failureMsg)
           
static void PRINT_STACK(int level)
           
static void THROW_ASSERT(boolean mustBeTrue)
           
static void THROW_ASSERT(boolean mustBeTrue, java.lang.String failureMsg)
           
static void TRACE(java.lang.String msg)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SanityCheck

public SanityCheck()
Method Detail

ASSERT

public static final void ASSERT(boolean mustBeTrue)

ASSERT

public static final void ASSERT(boolean mustBeTrue,
                                java.lang.String failureMsg)

THROW_ASSERT

public static final void THROW_ASSERT(boolean mustBeTrue)

THROW_ASSERT

public static final void THROW_ASSERT(boolean mustBeTrue,
                                      java.lang.String failureMsg)

TRACE

public static final void TRACE(java.lang.String msg)

PRINT_STACK

public static final void PRINT_STACK(int level)


Copyright (C) Wolfgang Meier. All rights reserved.