This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
NetBeans IDE 7.3 Beta (Build 201209272333) JDK 7u7 64-bit When applying the "Replace with multicatch", you end up with a lot of unnecessary spaces. For example (LAF name removed for readability): try { UIManager.setLookAndFeel(""); } catch (ClassNotFoundException ex) { Exceptions.printStackTrace(ex); } catch (InstantiationException ex) { Exceptions.printStackTrace(ex); } catch (IllegalAccessException ex) { Exceptions.printStackTrace(ex); } catch (UnsupportedLookAndFeelException ex) { Exceptions.printStackTrace(ex); } is transformed into try { UIManager.setLookAndFeel(""); } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { Exceptions.printStackTrace(ex); } Note the spaces after catch (. The number of spaces appear to be independent of the number of exceptions. Nothing a quick code format can't fix, but it is still annoying.
reproducible. This happens when the try-catch is located deeper in the block (e.g. it is not directly in class method) Sample code: if (true) { if (true) { try { m(); } catch (FileNotFoundException exception) { Logger.getLogger(ClassB.class.getCanonicalName()).log(Level.SEVERE, "", exception); } catch (MalformedURLException exception) { Logger.getLogger(ClassB.class.getCanonicalName()).log(Level.SEVERE, "", exception); } } }
*** This bug has been marked as a duplicate of bug 238215 ***