http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html

A very nice document on the usage and motivations behind assertions in JDK 1.4


assert(sqlQuoteTranslator != null);

assert(sqlQuoteTranslator != null):"Cannot get Quote Translator object";

How do I log an assert failure in java

Search for: How do I log an assert failure in java

Another hitch: assertions are disabled by default :(. Read this link

Then probably one shouldn't be using them for program behavior!


Utils.massert(this,
            commaSeparatedColumnNames != null,
            "No value for key akcListColumnNames ");

The "m" stands for "my" or you can just call it for what it is "myassert()"


static public void massert(Object srcObject, boolean expression, String msg)
   {
      if (expression == true) return;
      AppObjects.error(srcObject, "Assertion Failed: %1s",msg);
      throw new RuntimeException("Assertion exception:" + msg);
   }

You first log the error just in case. Then throw a run time error exception.