|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.squawk.util.Assert
public class Assert
Provides support for assertions that can be removed on demand in order for building a release version. If the preprocessor is running with showLineNumbers=true, it will call the versions of these methods that take a filename and linenumber argument.
Field Summary | |
---|---|
static boolean |
ASSERT_ALWAYS_IS_FATAL
Whether Assert.always is a fatal error or throws an exception (usually TRUE) |
static boolean |
ASSERTS_ENABLED
Whether assertions are included in the bytecodes or not. |
static boolean |
SHOULD_NOT_REACH_HERE_ALWAYS_ENABLED
Flag to always enable shouldNotReachHere(). |
Method Summary | |
---|---|
static void |
always(boolean cond)
Asserts that the specified condition is true. |
static void |
always(boolean cond,
String msg)
Asserts that the specified condition is true. |
static void |
always(boolean cond,
String filename,
int lineno)
|
static void |
always(boolean cond,
String msg,
String filename,
int lineno)
|
static RuntimeException |
shouldNotReachHere()
Asserts that the compiler should never reach this point. |
static RuntimeException |
shouldNotReachHere(String msg)
Asserts that the compiler should never reach this point. |
static RuntimeException |
shouldNotReachHere(String filename,
int lineno)
|
static RuntimeException |
shouldNotReachHere(String msg,
String filename,
int lineno)
|
static RuntimeException |
shouldNotReachHereFatal()
Asserts that the compiler should never reach this point. |
static RuntimeException |
shouldNotReachHereFatal(String msg)
Asserts that the compiler should never reach this point. |
static RuntimeException |
shouldNotReachHereFatal(String filename,
int lineno)
|
static RuntimeException |
shouldNotReachHereFatal(String msg,
String filename,
int lineno)
|
static void |
that(boolean cond)
Asserts that the specified condition is true. |
static void |
that(boolean cond,
String msg)
Asserts that the specified condition is true. |
static void |
that(boolean cond,
String filename,
int lineno)
|
static void |
that(boolean cond,
String msg,
String filename,
int lineno)
|
static void |
thatFatal(boolean cond)
Asserts that the specified condition is true. |
static void |
thatFatal(boolean cond,
String msg)
Asserts that the specified condition is true. |
static void |
thatFatal(boolean cond,
String filename,
int lineno)
|
static void |
thatFatal(boolean cond,
String msg,
String filename,
int lineno)
|
protected static void |
throwAssertFailedException(String message)
Create one centralized place where an exception is thrown in case of Assert failure. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean ASSERTS_ENABLED
public static final boolean SHOULD_NOT_REACH_HERE_ALWAYS_ENABLED
public static final boolean ASSERT_ALWAYS_IS_FATAL
Method Detail |
---|
protected static void throwAssertFailedException(String message) throws NotInlinedPragma
message
-
NotInlinedPragma
public static void that(boolean cond, String msg)
cond
- condition to be testedmsg
- message that explains the failurepublic static void that(boolean cond, String msg, String filename, int lineno)
public static void that(boolean cond)
cond
- condition to be testedpublic static void that(boolean cond, String filename, int lineno)
public static RuntimeException shouldNotReachHere(String msg) throws NotInlinedPragma
msg
- message that explains the failure
throw !Assert.SHOULD_NOT_REACH_HERE_ALWAYS_ENABLED ? (RuntimeException)null : Assert.shouldNotReachHere()
will
be legal and thus avoid the need to return meaningless
values from functions that have failed.
NotInlinedPragma
public static RuntimeException shouldNotReachHere(String msg, String filename, int lineno) throws NotInlinedPragma
NotInlinedPragma
public static RuntimeException shouldNotReachHere()
throw !Assert.SHOULD_NOT_REACH_HERE_ALWAYS_ENABLED ? (RuntimeException)null : Assert.shouldNotReachHere()
will
be legal and thus avoid the need to return meaningless
values from functions that have failed.public static RuntimeException shouldNotReachHere(String filename, int lineno)
public static void thatFatal(boolean cond, String msg)
cond
- condition to be testedmsg
- message that explains the failurepublic static void thatFatal(boolean cond, String msg, String filename, int lineno)
public static void thatFatal(boolean cond)
cond
- condition to be testedpublic static void thatFatal(boolean cond, String filename, int lineno)
public static RuntimeException shouldNotReachHereFatal(String msg)
msg
- message that explains the failure
throw !Assert.SHOULD_NOT_REACH_HERE_ALWAYS_ENABLED ? (RuntimeException)null : Assert.shouldNotReachHere()
will
be legal and thus avoid the need to return meaningless
values from functions that have failed.public static RuntimeException shouldNotReachHereFatal(String msg, String filename, int lineno)
public static RuntimeException shouldNotReachHereFatal()
throw !Assert.SHOULD_NOT_REACH_HERE_ALWAYS_ENABLED ? (RuntimeException)null : Assert.shouldNotReachHere()
will
be legal and thus avoid the need to return meaningless
values from functions that have failed.public static RuntimeException shouldNotReachHereFatal(String filename, int lineno)
public static void always(boolean cond, String msg)
cond
- condition to be testedmsg
- message that explains the failurepublic static void always(boolean cond, String msg, String filename, int lineno)
public static void always(boolean cond)
cond
- condition to be testedpublic static void always(boolean cond, String filename, int lineno)
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |