Hello Ceki,<br><br><div><span class="gmail_quote">2005/10/26, Ceki Gülcü <<a href="mailto:listid@qos.ch">listid@qos.ch</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think it is a great idea. When you say it would be easy in case of<br>JDK 1.4, are you thinking of the Throwable.fillInStackTrace() method<br>introduced in JDK 1.4? The javadoc for that method states:<br><br> Some virtual machines may, under some circumstances, omit one or
<br> more stack frames from the stack trace. In the extreme case, a virtual<br> machine that has no stack trace information concerning this throwable<br> is permitted to return a zero-length array from this method. Generally
<br> speaking, the array returned by this method will contain one element<br> for every frame that would be printed by printStackTrace.<br><br>If the said "omitted stack frame" is the one identifying the caller,
<br>then the logger name computed by LoggerFactory.getLogger() would be<br>wrong, with potentially very unpleasant results. :-)<br><br>Would you concur?</blockquote><div><br>It seems like the quoted documentation is for 'getStackTrace()' method. :)
<br><br>Anyway, you're right. But what about parsing stack trace strings to find out the class name? This should work for most virtual machines. In case of failure we could throw a RuntimeException to trigger ExceptionInitializerError.
<br><br></div></div>Trustin<br>-- <br>what we call human nature is actually human habit<br>--<br><a href="http://gleamynode.net/">http://gleamynode.net/</a>