J
Jan Burse
Dear All,
I have the following code deep down in a
recursion which eats up a lot of stack.
The recursion is not shown but only
the code:
Class<?> class;
try {
class = Class.forName(str);
} catch (ClassNotFoundException x) {
class = null;
}
Will it every time I call it for a
non-existing class build the whole stack
trace for the exception x and then
immediately forget about it?
Now I see in JDK 1.7 (*) a protected
constructor:
package java.lang;
protected Throwable(String message,
Throwable cause,
boolean enableSuppression,
boolean writableStackTrace)
If I were to write my own forName()
method I would set the writableStackTrace
to false if the exception is only needed
to immediately notify the callee about
something.
But what if I have JDK 1.6 only available
and not JDK 1.7. Can I instruct an exception
to not fill the stack trace? And way
arround?
Bye
(*)
http://download.oracle.com/javase/7/docs/api/
I have the following code deep down in a
recursion which eats up a lot of stack.
The recursion is not shown but only
the code:
Class<?> class;
try {
class = Class.forName(str);
} catch (ClassNotFoundException x) {
class = null;
}
Will it every time I call it for a
non-existing class build the whole stack
trace for the exception x and then
immediately forget about it?
Now I see in JDK 1.7 (*) a protected
constructor:
package java.lang;
protected Throwable(String message,
Throwable cause,
boolean enableSuppression,
boolean writableStackTrace)
If I were to write my own forName()
method I would set the writableStackTrace
to false if the exception is only needed
to immediately notify the callee about
something.
But what if I have JDK 1.6 only available
and not JDK 1.7. Can I instruct an exception
to not fill the stack trace? And way
arround?
Bye
(*)
http://download.oracle.com/javase/7/docs/api/