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.
This is with 6.0beta2 Refactoring "Move inner to outer level" does not alter the class passed to Logger.getLogger(). When NB generates a try-catch block in an inner class, the first argument to Logger.getLogger() is outerclass.class.getName(). If the inner is refactored to an outer class, the argument remains unchanged and the class winds up logging as its former outer class. So, given the code below, if "Inner" is refactored to "Outer", the first argument to getLogger will remain Main.class.getName(). Your call whether this is a bug in the refactoring or a bug in the try-catch generation. The fact that if I change the argument to getLogger() to read "Inner.class.getName()", then refactoring changes it to "Outer.class.getName()", make me think it's more likely a try-catch generation bug. package test; public class Main { public static class Inner { public Inner() {} public void exampleMethod() { try { // statements... } catch (Exception ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } } } }
Overtake.
Reassigning all moonko's java/source bugs to myself.
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