Community
Participate
Working Groups
Build Identifier: M20090917-0800 When using quick assist on the "catch" row below, it suggests replacing the catch with a throws clause. In the example, this leads to compile errors, since run() cannot be redeclared to throw an IOException. This fact is probably known by the IDE when quick assist is invoked, so the option should be removed. import java.io.IOException; public class Test extends Thread { @Override public void run() { try { } catch (IOException e) { } } } Reproducible: Always Steps to Reproduce: 1. Create a class like the following: import java.io.IOException; public class Test extends Thread { @Override public void run() { try { } catch (IOException e) { } } } 2. Run quick assist on the error and select "replace catch clause with throws". 3. Observe the new compile error.
Move to JDT/UI
We could test overridden methods and not show the quick fix if the exception is checked, and there is an overridden method that is not in source and that does not include the given exception in its throws clause. In other cases, we should still keep it, because the user may in fact also want to update the overridden method later.