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.
NB7.1, JDK 1.6 Select an expression inside method body in anonymous class and run 'introduce constant' refactoring. 'public static final Foo FOO = ...' is created in this inner class and this is not allowed by Java specification.
More generally I remember problems with introduce constant/field trying to add a static member to a nonstatic nested class (anonymous, local, or member); perhaps some of those have been fixed separately.
http://hg.netbeans.org/jet-main/rev/73c14c29e972
Integrated into 'main-golden', will be available in build *201204030400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/73c14c29e972 User: Jan Lahoda <jlahoda@netbeans.org> Log: #204373: prevent adding static fields into non-static contexts.