42
The Expression in a throw statement must denote a variable or value of a reference type which is assignable (�5.2) to the type Throwable, or a compile-time error occurs. Moreover, at least one of the following three conditions must be true, or a compile-time error occurs:
The exception is not a checked exception (�11.2)-specifically, one of the following situations is true:
The type of the Expression is the class RuntimeException or a subclass of RuntimeException.
The type of the Expression is the class Error or a subclass of Error.
The throw statement is contained in the try block of a try statement (�14.19) and the type of the Expression is assignable (�5.2) to the type of the parameter of at least one catch clause of the try statement. (In this case we say the thrown value is caught by the try statement.)
The throw statement is contained in a method or constructor declaration and the type of the Expression is assignable (�5.2) to at least one type listed in the throws clause (�8.4.4, �8.8.4) of the declaration.
Every exception is represented by an instance of the class Throwable or one of its subclasses; such an object can be used to carry information from the point at which an exception occurs to the handler that catches it. Handlers are established by catch clauses of try statements (�14.19).
A try statement may have catch clauses (also called exception handlers). A catch clause must have exactly one parameter (which is called an exception parameter); the declared type of the exception parameter must be the class Throwable or a subclass of Throwable, or a compile-time error occurs. The scope of the parameter variable is the Block of the catch clause.
42
Originally posted by Eugene Kononov:
com.crystaldecisions.sdk.framework
Class CrystalEnterprise
java.lang.Object
|
+--com.crystaldecisions.sdk.framework.CrystalEnterprise
static ISessionMgr getSessionMgr()
Returns the singleton ISessionMgr object.
Well, in this javadoc, there is no mention of any kind of exception thrown from the getSessionMgr() method. Looks like
some people call it as such, outside of the try-catch block, and without declaring the specifying it in the "throws" clause.
Perhaps SDKException is not really an exception in a JLS sense, but rather a misnamed class that has some "exceptional" purpose?
The getSessionMgr() method throws SDKException which extends AbsstractException which in turn extends java.lang.Object - not Exception, not even Throwable.
Tony Morris
Java Q&A (FAQ, Trivia)
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|