SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:Use a loop until getCause() returns null. Once that's the case you've found the root cause.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:But if that's the case then it's impossible to get the root.
Paul Clapham wrote:And to indulge in even wilder speculation, it looks like it's possible to put infinite loops into the chain of Exception causes:
Although I haven't tried this to see whether it's actually forbidden in some way; the documentation doesn't appear to forbid that code.
Rob Spoor wrote:Use a loop until getCause() returns null. Once that's the case you've found the root cause.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:Hmm, that's actually quite bad of Sun / Oracle to not prevent that. yang.initCause(yin) should throw an IllegalArgumentException because yang is already an ancestor cause of yin.
Mike Simmons wrote:I have used initCause() just a few times, mostly for IOException I think - they never added a constructor there that takes a cause, so you need initCause() to initialize the cause for any exception class that wasn't fully retrofitted when they added nested exceptions.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:Those constructors were added in Java 6.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Can you smell this for me? I think this tiny ad smells like blueberry pie!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
|