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 12357 - Add all needed catch statements
Summary: Add all needed catch statements
Status: RESOLVED DUPLICATE of bug 28971
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
: 21296 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-05-23 12:27 UTC by David Konecny
Modified: 2007-04-03 18:02 UTC (History)
1 user (show)

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 David Konecny 2001-05-23 12:27:40 UTC
Originator: Doug Fields <dfields@interpage.net>

Here's an interesting possible feature:

ALT-SHIFT-C

Adds all catch statements to the current enclosing try-catch-finally block 
for the identifier under the point.

If no enclosing try-catch-finally block, add one enclosing the current 
statement or fragment.

Parser database of course must be able to identify it.

For example (assume ^ means the insert point is here):

        number = Integer.par^seInt(someString);

then hit ALT-SHIFT-C, will result in:

        try {
                number = Integer.par^seInt(someString);
        } catch (NumberFormatException nfe) {
        }

Or, alternately

        try {
                ...some code...
                number = Integer.par^seInt(someString);
                ...some code...
        } catch (NullPointerException npe) {
                ... some exception handling code...
        }

then hit ALT-SHIFT-C, will result in:

        try {
                ...some code...
                number = Integer.par^seInt(someString);
                ...some code...
        } catch (NullPointerException npe) {
                ... some exception handling code...
        } catch (NumberFormatException nfe) {
        }

then hitting ALT-SHIFT-C again will result in no changes.
Comment 1 Jan Chalupa 2001-11-27 12:26:40 UTC
Target milestone -> 3.3.1.
Comment 2 Marek Grummich 2002-07-22 12:14:51 UTC
Set target milestone to TBD
Comment 3 Marek Grummich 2002-07-22 12:19:55 UTC
Set target milestone to TBD
Comment 4 Roman Strobl 2005-01-21 12:34:25 UTC
Changed subcomponent to code completion.
Comment 5 Roman Strobl 2005-01-21 13:36:06 UTC
*** Issue 21296 has been marked as a duplicate of this issue. ***
Comment 6 psuk 2005-04-04 09:53:46 UTC
Moving under refactoring.
Comment 7 Jan Becicka 2005-05-20 09:42:15 UTC

*** This issue has been marked as a duplicate of 28971 ***