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 121963

Summary: [60cat] Surround with try-catch feature is too greedy
Product: editor Reporter: johnemb <johnemb>
Component: Completion & TemplatesAssignee: Dusan Balek <dbalek>
Status: CLOSED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: Sun   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:

Description johnemb 2007-11-15 08:18:02 UTC
In NB 6.0 beta2, the "Surround with try-catch" tool tip function is too greedy, in the sense that it includes more code
in the try{} block than necessary. 

Actually, the entire code block is included in the try block both when leaving the caret position on a specific code
line throwing an Exception and using the light bulb tip to surround the statement with try-catch. Also when using this
feature of a selection of code, the editor ignores the selection and includes the entire code block in the try block.

This, in addition to the non-configurable automatic logging code in the catch block (see issue 116818) makes this
feature almost unusable. 

See nbuser mailing list threads at http://www.nabble.com/try-catch-Surround-t4807218.html and
http://www.nabble.com/Where-did-%22surround-with-try-catch%22-go--t4765557.html .
Comment 1 Vitezslav Stejskal 2007-11-15 09:59:43 UTC

*** This issue has been marked as a duplicate of 121932 ***
Comment 2 johnemb 2007-11-15 11:56:31 UTC
OK, I missed that issue when I searched prior to filing this issue. Please do monitor the mailing list threads for user
opinions.