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.
Product Version = NetBeans IDE Dev (Build 201402010001) Operating System = Windows 7 version 6.1 running on amd64 Java; VM; Vendor = 1.8.0 Runtime = Java HotSpot(TM) 64-Bit Server VM 25.0-b69 I had an initializer block in an anonymous inner class implementing a MouseEvent handler: private void instalEventListener(final SplitPane splitPane) { splitPane.addEventFilter(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() { Timeline timeline; private double [] lastPos; private double [] hidePos; { int divs = splitPane.getDividers().size(); lastPos = new double[divs]; hidePos = new double[divs]; hidePos[0] = 0; for (int i = 1; i < hidePos.length; i++) { hidePos[i] = 1; } } @Override public void handle(MouseEvent t) { ... (EventHandler, MouseEvent, SplitPane and Timeline classes are from JavaFX) The line below "private double [] hidePos;" was marked with the hint "Initializer can be static". But it can't be static. The initializer refers to instance member variables, e.g. "lastPos", "hidePos". Invoking the hint places the "static" keyword in front of the opening { of the initializer and subsequently the code within is highlighted with error markers indicating "non-static variable lastPos cannot be referenced from a static context", etc.
Fixed in jet-main#5727663a01ea
Integrated into 'main-silver', will be available in build *201402140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/5727663a01ea User: Svata Dedic <sdedic@netbeans.org> Log: #241344: enclosing type is correctly initialized for initializer blocks; referenced param of enclosing class' method
*** Bug 241837 has been marked as a duplicate of this bug. ***
*** Bug 245742 has been marked as a duplicate of this bug. ***
*** Bug 243363 has been marked as a duplicate of this bug. ***