From joe.darcy at oracle.com Thu Nov 4 11:53:04 2010 From: joe.darcy at oracle.com (Joe Darcy) Date: Thu, 04 Nov 2010 11:53:04 -0700 Subject: Planned improvements to multi-catch and more precise rethrow In-Reply-To: <4CC9BA9D.1030507@oracle.com> References: <4CC9BA9D.1030507@oracle.com> Message-ID: <4CD30110.9020901@oracle.com> Joe Darcy wrote: > We've been working on some improvements to the multi-catch with more > precise rethrow feature [1] and are planning to push the changes soon. Maurizio has now pushed the changes into the JDK 7 TL repo: 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters http://hg.openjdk.java.net/jdk7/tl/langtools/rev/f2048d9c666e -Joe From joe.darcy at oracle.com Fri Nov 12 01:12:41 2010 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 12 Nov 2010 01:12:41 -0800 Subject: Hmm... Suppressed Exceptions are Throwables[] In-Reply-To: <4CA56420.7090203@oracle.com> References: <4CA4CDDD.5050701@gmail.com> <4CA56420.7090203@oracle.com> Message-ID: <4CDD0509.60700@oracle.com> Joe Darcy wrote: > Osvaldo Pinali Doederlein wrote: >> My $0.02: getSupressed(). >> > > Hopefully the method name would not be misinterpreted as a command! > >> - It's sufficiently clear (from both the context of the containing >> class and the return static type), so this is terse without being >> obscure; >> - There is a BIG precedent: we already have getCause(), not >> getCauseException() or getCauseThrowable(). >> > > Good point; I'll consider this renaming. > FYI, this method renaming along with some other changes to Throwable is out for review on core-libs-dev: http://mail.openjdk.java.net/pipermail/core-libs-dev/2010-November/005193.html -Joe From markmahieu at gmail.com Fri Nov 12 05:28:05 2010 From: markmahieu at gmail.com (Mark Mahieu) Date: Fri, 12 Nov 2010 13:28:05 +0000 Subject: javac crash in multi-catch Message-ID: <316762D9-6143-4CF7-9DF8-867AD8147239@gmail.com> Hi, I crashed javac whilst trying the latest multi-catch code. (Also, following on from a thread on lambda-dev, please shout if Coin bugs are better submitted elsewhere) class Crash { interface Foo {} static class X1 extends Exception implements Foo {} static class X2 extends Exception implements Foo {} public static void main(String[] args) { try { if (args.length == 0) throw new X1(); else throw new X2(); } catch (X1|X2 ex) { } } } $ javac Crash.java An exception has occurred in the compiler (1.7.0-internal). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. java.lang.AssertionError at com.sun.tools.javac.jvm.ClassWriter.enterInner(ClassWriter.java:996) at com.sun.tools.javac.jvm.ClassWriter.writePool(ClassWriter.java:533) at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1698) at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1579) at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:685) at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1413) at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1381) at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:836) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:795) at com.sun.tools.javac.main.Main.compile(Main.java:418) at com.sun.tools.javac.main.Main.compile(Main.java:336) at com.sun.tools.javac.main.Main.compile(Main.java:327) at com.sun.tools.javac.Main.compile(Main.java:82) at com.sun.tools.javac.Main.main(Main.java:67) Mark From Ulf.Zibis at gmx.de Fri Nov 12 05:48:21 2010 From: Ulf.Zibis at gmx.de (Ulf Zibis) Date: Fri, 12 Nov 2010 14:48:21 +0100 Subject: javac crash in multi-catch In-Reply-To: <316762D9-6143-4CF7-9DF8-867AD8147239@gmail.com> References: <316762D9-6143-4CF7-9DF8-867AD8147239@gmail.com> Message-ID: <4CDD45A5.7070901@gmx.de> Additionally the link http://java.sun.com/webapps/bugreport is wrong. Correct is (?): http://bugs.sun.com/bugdatabase/login.do -Ulf Am 12.11.2010 14:28, schrieb Mark Mahieu: > Hi, > > I crashed javac whilst trying the latest multi-catch code. > > (Also, following on from a thread on lambda-dev, please shout if Coin bugs are better submitted elsewhere) > > > class Crash { > > interface Foo {} > static class X1 extends Exception implements Foo {} > static class X2 extends Exception implements Foo {} > > public static void main(String[] args) { > try { > if (args.length == 0) > throw new X1(); > else > throw new X2(); > } > catch (X1|X2 ex) { > } > } > } > > $ javac Crash.java > An exception has occurred in the compiler (1.7.0-internal). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. > java.lang.AssertionError > at com.sun.tools.javac.jvm.ClassWriter.enterInner(ClassWriter.java:996) > at com.sun.tools.javac.jvm.ClassWriter.writePool(ClassWriter.java:533) > at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1698) > at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1579) > at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:685) > at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1413) > at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1381) > at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:836) > at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:795) > at com.sun.tools.javac.main.Main.compile(Main.java:418) > at com.sun.tools.javac.main.Main.compile(Main.java:336) > at com.sun.tools.javac.main.Main.compile(Main.java:327) > at com.sun.tools.javac.Main.compile(Main.java:82) > at com.sun.tools.javac.Main.main(Main.java:67) > > > > Mark > > >