Community
Participate
Working Groups
I want lines 4 and 6 to execute even if line 5 throws an exception. So I select line 5 and use the Source menu to surround it with a try/catch block. But the generated catch block doesn't catch ClassNotFoundException, even though it's a checked exception thrown by line 5. ------------- Bug.java ---------------- class Bug { { try { Bug.class.getFields()[0].get(null); // LINE 4 Class.forName("?"); // LINE 5 Bug.class.getFields()[0].get(null); // LINE 6 } catch (Throwable crash) { crash.printStackTrace(); } } }
The reason is that the ClassNotFoundException is already catched by catch (Throwable crash). The was a long discussion whether surround with should always catch "all" exceptions or only those not catch by an outer block or propagated by the method. Honoring both scenarios will require new UI. Simply changing it will definitelly cause PRs complaining about the new behaviour.