Community
Participate
Working Groups
We already have quick assists to convert multiple catch blocks to a single multi-catch block and vice versa (bug 348061) and these could be made available as a cleanup. The clean-up options will go under 'Code Style' tab.
Before you implement this, I think bug 366453 and this should be fixed. Place your cursor on the second catch block and combine them via quick assist. Before: try { new FileWriter(""); } catch (FileNotFoundException e) { } catch (IOException e) { } Result: try { new FileWriter(""); } catch (FileNotFoundException | IOException e) { } This is a compiler error; it is not valid for catch blocks to have a union of types that are in a subtype/supertype relationship.
Adding Carsen, who did such cleanups (manual or maybe via Netbeans) in the past for the Eclipse code base.
*** This bug has been marked as a duplicate of bug 569879 ***