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.

Bug 267463

Summary: Update the "replace with multicatch" hint to support ReflectiveOperationException.
Product: java Reporter: schulte2004 <schulte2004>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 8.0.2   
Hardware: PC   
OS: Other   
Issue Type: ENHANCEMENT Exception Reporter:

Description schulte2004 2016-08-06 13:56:58 UTC
Converting a Java 5 codebase to Java 7, I started using the "replace with multicatch" hint. I would like to request that hint to support ReflectiveOperationException. Instead of converting multiple catch statements to something like:

catch ( ClassNotFoundException | InstantiationException | IllegalAccessException e )

the hint should generate just one catch statement like: 

catch ( ReflectiveOperationException e )

Maybe that better be a new hint. So that instead of just the "replace with multicatch" hint two hints are provided "replace with multicatch" and "replace with catch ReflectiveOperationException".
Comment 1 Svata Dedic 2016-08-06 19:53:38 UTC
Interesting enhancement. Should be configurable, though - an automatic heuristic is used to guess the "appropriate" common supertype to catch may produce very funny results.