Community
Participate
Working Groups
We should provide 2 new quick assists - Convert to a single multi-catch block - offered on catch blocks with identical body - Convert to multiple catch blocks - offered on a multi-catch block I suppose these should also be available as clean-ups, but this can be done at a later stage.
I will attach a patch.
Created attachment 197665 [details] fix + tests
Fixed in BETA_JAVA7
verified. An example snippet to test with: import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class MultiCatch { public static void main(String[] args) { File file = new File(""); try (BufferedReader reader = new BufferedReader(new FileReader(file))) { System.err.println("reading..."); } catch(IOException | NullPointerException ex){} catch(IllegalArgumentException iae){} file = new File(""); try (BufferedReader reader = new BufferedReader(new FileReader(file))) { System.err.println("reading..."); } catch(IOException ioe){} catch(NullPointerException npe){} catch(IllegalArgumentException iae){} } }