Community
Participate
Working Groups
BETA_JAVA7 public class Snippet { static void m(int n) throws IllegalArgumentException, MyException { if (n == 1) throw new IllegalArgumentException(); else throw new MyException(); } void foo(String name, boolean b) { try (FileInputStream fis = new FileInputStream(name)) { // use quick fix here m(1); } System.out.println("SUCCESS"); } } class MyException extends Exception{ } Using quick fix at the location marked above i.e. for the error "unhandled exception type FileNotFoundException" adds the thrown exceptions from method 'm(int)' instead of adding FileNotFoundException. Since the exception still remains, again see the available quick fixes for correcting the error. This time, the "add throws declaration" quick fix is not even available. The latter also happens in case the call m(1) is removed.
I will take a look.
*** Bug 348867 has been marked as a duplicate of this bug. ***
Created attachment 198074 [details] fix + tests Fixed in BETA_JAVA7
.
verified