Bug 351179 - [1.7] [clean up] to convert multiple catch blocks to a single multi-catch block and vice versa
Summary: [1.7] [clean up] to convert multiple catch blocks to a single multi-catch blo...
Status: CLOSED DUPLICATE of bug 569879
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Fabrice Tiercelin CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2011-07-05 09:03 EDT by Deepak Azad CLA
Modified: 2021-01-16 09:54 EST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2011-07-05 09:03:18 EDT
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.
Comment 1 Paul Benedict CLA 2012-01-05 10:51:33 EST
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.
Comment 2 Lars Vogel CLA 2020-05-05 04:20:46 EDT
Adding Carsen, who did such cleanups (manual or maybe via Netbeans) in the past for the Eclipse code base.
Comment 3 Fabrice Tiercelin CLA 2021-01-16 09:54:44 EST

*** This bug has been marked as a duplicate of bug 569879 ***