Community
Participate
Working Groups
Build Identifier: I20110805-1200 The following snippet will compile without warning on JDK7. private static void closeThat(Closeable that) throws IOException { try (Closeable toClose = that) { // closes toClose } } Though, on Eclipse, it will output a warning ("The declared exception IOException is not actually thrown..."). Removing the exception : private static void closeThat(Closeable that) { try (Closeable toClose = that) { // closes toClose } } will pass the compiler check on Eclipse, but will fail to compile with the JDK7. It is indeed translateable to : private static void closeThat(Closeable that) { Closeable toClose = that; try { } finally { toClose.close(); // throws IOException } } Reproducible: Always Steps to Reproduce: 1. Input provided code in Eclipse Java editor
This seems to be fixed in HEAD and 3.7 maintenance. Could you please provide the org.eclipse.jdt.core bundle id ? You can find it into Help>About Eclipse SDK>Installation Details>Plugins.
Closing as WORKSFORME. Satyam, if you can find the duplicate, you can close it as a dup.
I am not able to reproduce even with the build of I20110802-2000. Verified for 3.8M2 with build I20110911-2000