Community
Participate
Working Groups
This class generates a compile error in the IDE but javac compiles successfully. public class ExceptionTest { public void doStuff() throws Exception { } public void test() { final Exception ex; try { doStuff(); return; } catch (NullPointerException e) { ex = e; } catch (Exception e) { // compile error here, only in the IDE ex = e; } ex.printStackTrace(); } }
Thanks for the report. The program is rejected for the same reason by these compiler versions: ecj: all versions since at least 3.2.2 javac: all versions <= jdk1.8.0-lambda-b69 Ergo: javac 1.8.0 (GA) is the first compiler I could find on my disk, that accepts the program; which makes this a fairly recent bug fix in javac. We should fix accordingly. There might even be a spec change behind this, which slipped our attention? OTOH, javac 1.8 with -source 1.7 accepts the program, too, so oracle didn't bother about compatibility between old compiler and new compiler at -source 1.7. I'm still not sure if we should fix it for all versions or only for 1.8 (for bug-compatibility with old oracle compilers)?
bulk move out of 4.8
Bulk move out of 4.9
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.