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.
Consider a method as: private PreparedStatement getStatement() throws ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException { ... } When this method is invoked in another method as: private void updateDB() { ... getStatement() ... } NetBeans IDE shows yellow bulb on "getStatement()" invocation and all the four exceptions need to be explicitly added to throws clause or surround statement/block with try/catch. An additional hint "Add all exceptions in throws clause" will be useful. On the same notes, when the statement/block is surrounded with try/catch then the following statement is included in the catch block: Logger.getLogger(SQLPreparedStatement.class.getName()).log(Level.SEVERE, null, ex); This is a perfect candidate for using multi-catch. It could be an additional hint or the default as well.
I support this bug track. I had the same situation today. The following code throws two kinds of exception, MalformedURLException and IOException URL url = new URL(input); URLConnection uRLConnection = url.openConnection(); uRLConnection.connect(); netbeans shows two hints: surround statement with try-catch surround block with try-catch but no "surround with multi try-catch" it would be nice to get something like: try { URL url = new URL(input); URLConnection uRLConnection = url.openConnection(); uRLConnection.connect(); } catch (MalformedURLException ex) { Logger.getLogger(Service.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(Service.class.getName()).log(Level.SEVERE, null, ex); } after a single quick fix.