> From: Berin Loritsch [mailto:[EMAIL PROTECTED]] > > > From: Corey Jewett [mailto:[EMAIL PROTECTED]] > > > > A question on the strategy of creating exceptions to just > > float around. > > > > It's my understanding that throwing exceptions causes a lot > > of work in the JVM. What I'm unclear on is if this work is > > from the throw, or from the Exception instantiation. If it's > > from the instantiation then it would probably be a good idea > > to bury this strategy under a debugging flag. Can anybody > > clear this up for me? > > Creating is just creating.
I take that back. I checked the source code for Throwable, it does fill in the stack trace on creation. Exceptions cause a strain on the JVM in all respects. Both creation and throwing. Keep in mind that if you "precreate" your exception to throw later, you incurr the fillInStackTrace() call twice. You have to call it again later to make sure it makes sense. BTW, fillInStackTrace() is a native method (AKA a JNI method). -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
