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 173945 - Code formating throws NPE JFXReformatTask$Pretty.scan
Summary: Code formating throws NPE JFXReformatTask$Pretty.scan
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Anton Chechel
URL:
Keywords:
Depends on:
Blocks: 173487
  Show dependency tree
 
Reported: 2009-10-07 10:14 UTC by Alexandr Scherbatiy
Modified: 2009-10-09 11:38 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 Alexandr Scherbatiy 2009-10-07 10:14:33 UTC
Product Version         = NetBeans IDE Dev (Build 200910061401) (#941078cbc4d4)
  Operating System        = Windows XP version 5.1 running on x86
  Java; VM; Vendor        = 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02; Sun Microsystems Inc.

 - Copy the code to the editor
------------------------------------------------------
import javafx.scene.CustomNode;

var action:function ();

function run() {

}
------------------------------------------------------

- Format the code
The NPE pops up 

java.lang.NullPointerException
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask$Pretty.scan(JFXReformatTask.java:436)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask$Pretty.visitVariable(JFXReformatTask.java:738)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask$Pretty.visitVariable(JFXReformatTask.java:288)
	at com.sun.tools.javafx.tree.JFXVar.accept(JFXVar.java:145)
	at com.sun.javafx.api.tree.JavaFXTreePathScanner.scan(JavaFXTreePathScanner.java:63)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask$Pretty.scan(JFXReformatTask.java:436)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask$Pretty.visitClassDeclaration(JFXReformatTask.java:606)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask$Pretty.visitClassDeclaration(JFXReformatTask.java:288)
	at com.sun.tools.javafx.tree.JFXClassDeclaration.accept(JFXClassDeclaration.java:149)
	at com.sun.javafx.api.tree.JavaFXTreePathScanner.scan(JavaFXTreePathScanner.java:63)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask$Pretty.scan(JFXReformatTask.java:436)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask$Pretty.visitCompilationUnit(JFXReformatTask.java:471)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask$Pretty.visitCompilationUnit(JFXReformatTask.java:288)
	at com.sun.tools.javafx.tree.JFXScript.accept(JFXScript.java:143)
	at com.sun.javafx.api.tree.JavaFXTreePathScanner.scan(JavaFXTreePathScanner.java:45)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask$Pretty.reformat(JFXReformatTask.java:372)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask.reformatImpl(JFXReformatTask.java:139)
	at org.netbeans.modules.javafx.editor.format.JFXReformatTask.reformat(JFXReformatTask.java:114)
	at org.netbeans.modules.editor.indent.TaskHandler$MimeItem.runTask(TaskHandler.java:547)
	at org.netbeans.modules.editor.indent.TaskHandler.runTasks(TaskHandler.java:314)
	at org.netbeans.modules.editor.indent.IndentImpl.reformat(IndentImpl.java:293)
	at org.netbeans.modules.editor.indent.FormatterImpl.reformat(FormatterImpl.java:187)
	at org.netbeans.editor.ActionFactory$FormatAction$1.run(ActionFactory.java:1673)
	at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:354)
	at org.netbeans.editor.ActionFactory$FormatAction.actionPerformed(ActionFactory.java:1644)
	at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:336)
	at org.openide.awt.AlwaysEnabledAction$1.run(AlwaysEnabledAction.java:162)
	at org.netbeans.modules.openide.util.ActionsBridge.implPerformAction(ActionsBridge.java:83)
	at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:67)
	at org.openide.awt.AlwaysEnabledAction.actionPerformed(AlwaysEnabledAction.java:165)
	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636)
	at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
	at javax.swing.JComponent.processKeyBindings(JComponent.java:2886)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
	at java.awt.Component.processEvent(Component.java:6040)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4630)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:704)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:969)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:841)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:668)
	at java.awt.Component.dispatchEventImpl(Component.java:4502)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Window.dispatchEventImpl(Window.java:2475)
	at java.awt.Component.dispatchEvent(Component.java:4460)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:117)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 1 Anton Chechel 2009-10-07 15:17:55 UTC
fixed
http://hg.netbeans.org/javafx/rev/b2ec8290a63b
Comment 2 Alexandr Scherbatiy 2009-10-09 11:38:44 UTC
verified in netbeans-trunk-nightly-200910080418-javafx-full.zip