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 269331

Summary: Generate code menu allows inserting static logger into non-static inner class
Product: java Reporter: Jiri Prox <jiriprox>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description Jiri Prox 2016-12-14 09:18:03 UTC
Generate code menu allows inserting static logger into non-static inner class

Steps to reproduce:
1) have non-static inner class
2) put cursor in it and press Alt-insert
3) select logger

-> the code is invalid

public class Outer {
     class Inner {

        private static final Logger LOG = Logger.getLogger(Inner.class.getName());
        
    }
}


Product Version: NetBeans IDE 8.2 (Build 201609300101)
Updates: NetBeans IDE is updated to version NetBeans 8.2 Patch 1
Java: 1.8.0_111; Java HotSpot(TM) 64-Bit Server VM 25.111-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_111-b14
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\8.2
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\8.2