Top Description Fields Constructors Methods
com.mysql.cj.exceptions

public Class AssertionFailedException

extends CJException
Class Inheritance
Imports
com.mysql.cj.Messages

Assertions for empty code paths that should never be executed.

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from com.mysql.cj.exceptions.CJException:
exceptionMessage

Constructor Summary

AccessConstructor and Description
public
AssertionFailedException(Exception
the exception that should never have been thrown.
ex
)

Creates an AssertionFailedException for the given exception that should never have been thrown.

public
AssertionFailedException(String
a description of the assertion that failed
assertion
)

Creates an AssertionFailedException for the reason given.

Method Summary

Modifier and TypeMethod and Description
public static AssertionFailedException
shouldNotHappen(Exception
the exception that should never have been thrown.
ex
)

Convenience method.

public static AssertionFailedException

Returns:

the exception. exception should be thrown by the caller to satisfy compiler checks for data-flow, etc
shouldNotHappen
(String
message
assertion
)

Create (and caller should subsequently throw) an AssertionFailedException.

Inherited from com.mysql.cj.exceptions.CJException:
appendMessagegetMessagegetSQLStategetVendorCodeisTransientsetSQLStatesetTransientsetVendorCode

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.mysql.cj.exceptions.CJException.serialVersionUID.

Constructor Detail

AssertionFailedExceptionback to summary
public AssertionFailedException(Exception ex)

Creates an AssertionFailedException for the given exception that should never have been thrown.

Parameters
ex:Exception

the exception that should never have been thrown.

AssertionFailedExceptionback to summary
public AssertionFailedException(String assertion)

Creates an AssertionFailedException for the reason given.

Parameters
assertion:String

a description of the assertion that failed

Method Detail

shouldNotHappenback to summary
public static AssertionFailedException shouldNotHappen(Exception ex) throws AssertionFailedException

Convenience method.

Parameters
ex:Exception

the exception that should never have been thrown.

Returns:AssertionFailedException

AssertionFailedException

Exceptions
AssertionFailedException:
for the exception ex.
shouldNotHappenback to summary
public static AssertionFailedException shouldNotHappen(String assertion) throws AssertionFailedException

Create (and caller should subsequently throw) an AssertionFailedException.

Typical use is as follows:

if (something == null) {
    throw AssertionFailedException.shouldNotHappen("Something cannot be null");
}
Parameters
assertion:String

message

Returns:AssertionFailedException

the exception. exception should be thrown by the caller to satisfy compiler checks for data-flow, etc

Exceptions
AssertionFailedException:
if exception occurs