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 - Update the "replace with multicatch" hint to support ReflectiveOperationException.
Summary: Update the "replace with multicatch" hint to support ReflectiveOperationExcep...
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Other
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-06 13:56 UTC by schulte2004
Modified: 2016-08-06 19:53 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.