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 225778 - Allow editing of template for code inserted with hints..
Summary: Allow editing of template for code inserted with hints..
Status: REOPENED
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 7.4
Hardware: PC Windows 8 x64
: P3 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-06 08:28 UTC by akobberup
Modified: 2016-07-07 07:51 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 akobberup 2013-02-06 08:28:14 UTC
If i type the following in the java editor:

throw new Exception(); // this could be any method invocation that throw a checked exception.

i get an error on the line and a hint where i can select to surround statement/block with a try catch block.
When i select to surround the statement with a try catch block the result is this:

try {
	throw new Exception();
} catch ( Exception ex ) {
	Logger.getLogger(EventVoucherServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
}

This is a great functionality, just one detail is a nag - i do not use java.util.logging - i use commons logging.
So i have to alter the code to this:

try {
	throw new Exception();
} catch ( Exception ex ) {
	LogFactory.getLog(EventVoucherServiceImpl.class).error(ex);
}


I would love to have the oppertunity to edit the content of the catch block - or the full code template that is applied, much like i now have the opperunity to customize method bodies:
http://wiki.netbeans.org/NewAndNoteworthyNB73#Customizable_Method_Bodies
Comment 1 Martin Balin 2016-07-07 07:29:47 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 2 akobberup 2016-07-07 07:51:31 UTC
Still relevant past nb 8.2