Community
Participate
Working Groups
Sample method: import java.io.File; import java.net.MalformedURLException; public class TestClass { void somemethod() { File f = new File("", ""); try { f.toURL(); File.createTempFile("", ""); } catch (MalformedURLException e) { e.printStackTrace(); } // some comment } } If you load that code in Eclipse, there will be red squiggle under the createTempFile line and a proposed quick fix "add catch clause to surrounding try" . If you select that quick fix, you end up wiuth the following incorrect output, where the newly generated catch cluase has been added ad the end of the //some comment line: import java.io.File; import java.io.IOException; import java.net.MalformedURLException; public class TestClass { void somemethod() { File f = new File("", ""); try { f.toURL(); File.createTempFile("", ""); } catch (MalformedURLException e) { e.printStackTrace(); } // some comment catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
reason is bug 95839 *** This bug has been marked as a duplicate of 95839 ***