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.
Summary: | Incorrect "The 'throw' statement in 'finally' block may hide the original exception" hint | ||
---|---|---|---|
Product: | java | Reporter: | in-ws5 |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | matthies |
Priority: | P3 | ||
Version: | 8.0.2 | ||
Hardware: | PC | ||
OS: | Windows 8.1 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
in-ws5
2015-10-01 07:26:49 UTC
ACK, re-throwing is not handled. Should we add this as blocking to 249320? No; the hint checks that the 'ex' value is "properly" used (i.e. assigned, passed somewhere else, logged...). Rethrowing the value is another (not yet handled) case. One correction: if the nested try block is more complex, it can also produce some exceptions. Those 'nested' exceptions would be masked by the throw ex statement. This may or may not be intentional, depending on coding style. I'll add additional logic, which (depending on option) suppresses the hint if the thrown value can only come from an enclosing exception handler parameter. Implemented in jet-main#cf89e55cb774 *** Bug 262556 has been marked as a duplicate of this bug. *** Integrated into 'main-silver', will be available in build *201607140002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/cf89e55cb774 User: Svata Dedic <sdedic@netbeans.org> Log: #255635: rethrowing exception in nested finally needs special handling |