This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: java/5794: gcj fails to verify .class file generated by Sun JDK 1.4 compiler


> I don't get this.  First, the testcases in question don't have any
> synchronization, so I don't see the relevance.  Secondly. I find it
> hard to see how an exception handler that handles itself makes the
> code more robust and safe.

See Sun's bug 4414101 for an example of code that produces an
exception handler that targets itself when compiled with JDK 1.4.1 or
with jikes 1.16 or greater, and Sun's official reasoning why it is
necessary for the nested handler.  Nested handlers also occur in
try-finally and try-catch-finally blocks in code compiled by javac.

http://developer.java.sun.com/developer/bugParade/bugs/4414101.html

Sun's argument at the above link is that JLS 17.13 require the
compiler to guarantee that the monitor is exited exactly once. If an
asynchronous IllegalMonitorStateException occurs, Sun would rather
have the thread enter an infinite loop than improperly exit the monitor.

----
Eric Blake


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]