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: | "Surround Statement with try-catch" should pick available logger | ||
---|---|---|---|
Product: | java | Reporter: | err <err> |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | NEW --- | ||
Severity: | normal | CC: | cezariusz, jpokorsky, wadechandler |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 252708 | ||
Bug Blocks: |
Description
err
2010-03-15 16:15:47 UTC
I will see what can be done. If I may add a request. When it is necessary to create/get the default logger I'd rather see this.getClass().getName() used instead of MyClass.class.getName(). I find I sometimes copy/paste then edit. Since the results are equivalent but class independent, I think it'll be a wee bit better. Sadly "this.getClass().getName()" can only be used in instance context, and not in static context. Most of the time we already have a defined logger in the class, usualy it can be found in : - a static field named LOGGER - by a method .getLogger() So if the automatic try{} catch could check if those exist that would be great. I just noticed this as well, and was going to add a bug and saw it was already here :-). Adding myself to the cc. Actually an enhancement; the generated code is valid, although not optimal. *** Bug 208460 has been marked as a duplicate of this bug. *** (In reply to eclesia from comment #4) > usualy it can be found in : It could be defined as an option. See bug 252708. |