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 20677 - Exception handling: insert try catch block around selected code
Summary: Exception handling: insert try catch block around selected code
Status: RESOLVED DUPLICATE of bug 28971
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P4 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-19 15:25 UTC by Ben Hutchison
Modified: 2007-09-26 09:14 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 Ben Hutchison 2002-02-19 15:25:15 UTC
I would like an action I could trigger that would insert a try-catch block 
around the selected line or lines of code, indenting the code approriately.

A good start would be just to add the braces and brackets and not fill in any 
exception type, just move the cursor to the catch clause. This alone would be 
very useful. 

However, it could be extended to detect and add exception catch clauses (Not 
worth the effort in the near future):
1. Catch the lowest common superclass of all checked exceptions thrown in the 
code.
2. Create a seperate catch clause for each exception type thrown.
Comment 1 Svata Dedic 2002-05-21 17:47:56 UTC
Cleaning up before 4.0 planning
Comment 2 Marek Grummich 2002-07-19 17:23:01 UTC
Target milestone was changed from not determined to TBD
Comment 3 Martin Matula 2004-11-11 16:14:00 UTC

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