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 - Generate code menu allows inserting static logger into non-static inner class
Summary: Generate code menu allows inserting static logger into non-static inner class
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-14 09:18 UTC by Jiri Prox
Modified: 2016-12-14 09:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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