Peter Steele created NETBEANS-536:
-------------------------------------

             Summary: Error while trying to reformat a specific file
                 Key: NETBEANS-536
                 URL: https://issues.apache.org/jira/browse/NETBEANS-536
             Project: NetBeans
          Issue Type: Bug
          Components: cnd - Editor
    Affects Versions: 9.0
            Reporter: Peter Steele


Certain files that I have can't be reformatted using the reformat command while 
others can. The error I get is below


java.lang.NullPointerException
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitForLoop(Reformatter.java:2512)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitForLoop(Reformatter.java:395)
 at com.sun.tools.javac.tree.JCTree$JCForLoop.accept(JCTree.java:1144)
 at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:580)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:1760)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:395)
 at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1038)
 at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:580)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.wrapStatement(Reformatter.java:4247)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.wrapStatement(Reformatter.java:4200)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitEnhancedForLoop(Reformatter.java:2542)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitEnhancedForLoop(Reformatter.java:395)
 at com.sun.tools.javac.tree.JCTree$JCEnhancedForLoop.accept(JCTree.java:1178)
 at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:580)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:1760)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:395)
 at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1038)
 at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:580)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.wrapStatement(Reformatter.java:4247)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.wrapStatement(Reformatter.java:4200)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitEnhancedForLoop(Reformatter.java:2542)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitEnhancedForLoop(Reformatter.java:395)
 at com.sun.tools.javac.tree.JCTree$JCEnhancedForLoop.accept(JCTree.java:1178)
 at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:580)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:1760)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:395)
 at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1038)
 at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:580)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitMethod(Reformatter.java:1333)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitMethod(Reformatter.java:395)
 at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:904)
 at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:580)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitClass(Reformatter.java:1026)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitClass(Reformatter.java:395)
 at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:812)
 at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:580)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCompilationUnit(Reformatter.java:627)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCompilationUnit(Reformatter.java:395)
 at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:593)
 at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
 at 
org.netbeans.modules.java.source.save.Reformatter$Pretty.reformat(Reformatter.java:512)
 at 
org.netbeans.modules.java.source.save.Reformatter.reformatImpl(Reformatter.java:226)
 at 
org.netbeans.modules.java.source.save.Reformatter.reformat(Reformatter.java:99)
 at 
org.netbeans.modules.editor.indent.TaskHandler$MimeItem.runTask(TaskHandler.java:550)
 at 
org.netbeans.modules.editor.indent.TaskHandler.runTasks(TaskHandler.java:309)
 at org.netbeans.modules.editor.indent.IndentImpl.reformat(IndentImpl.java:349)
 at org.netbeans.modules.editor.indent.api.Reformat.reformat(Reformat.java:129)
 at 
org.netbeans.editor.ActionFactory$FormatAction$1$1.run(ActionFactory.java:1854)
 at 
org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:333)
 at 
org.netbeans.editor.ActionFactory$FormatAction$1.run(ActionFactory.java:1833)
 at org.netbeans.modules.progress.ui.RunOffEDTImpl$1.run(RunOffEDTImpl.java:146)
 at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
 at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
 at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
 at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
Caused: org.openide.util.RequestProcessor$SlowItem: task failed due to
 at org.openide.util.RequestProcessor.post(RequestProcessor.java:395)
 at 
org.netbeans.modules.progress.ui.RunOffEDTImpl.runOffEventDispatchThreadImpl(RunOffEDTImpl.java:140)
 at 
org.netbeans.modules.progress.ui.RunOffEDTImpl.runOffEventDispatchThread(RunOffEDTImpl.java:83)
 at 
org.netbeans.api.progress.BaseProgressUtils.runOffEventDispatchThread(BaseProgressUtils.java:90)
 at 
org.netbeans.api.progress.ProgressUtils.runOffEventDispatchThread(ProgressUtils.java:67)
 at 
org.netbeans.editor.ActionFactory$FormatAction.actionPerformed(ActionFactory.java:1821)
 at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:322)
 at 
org.netbeans.spi.editor.AbstractEditorAction.actionPerformed(AbstractEditorAction.java:445)
 at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1663)
 at javax.swing.JComponent.processKeyBinding(JComponent.java:2882)
 at javax.swing.JComponent.processKeyBindings(JComponent.java:2929)
 at javax.swing.JComponent.processKeyEvent(JComponent.java:2845)
 at java.awt.Component.processEvent(Component.java:6310)
 at java.awt.Container.processEvent(Container.java:2237)
 at java.awt.Component.dispatchEventImpl(Component.java:4889)
 at java.awt.Container.dispatchEventImpl(Container.java:2295)
 at java.awt.Component.dispatchEvent(Component.java:4711)
 at 
java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
 at 
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
 at 
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
 at 
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
 at 
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
 at java.awt.Component.dispatchEventImpl(Component.java:4760)
 at java.awt.Container.dispatchEventImpl(Container.java:2295)
 at java.awt.Window.dispatchEventImpl(Window.java:2746)
 at java.awt.Component.dispatchEvent(Component.java:4711)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
 at java.awt.EventQueue.access$500(EventQueue.java:97)
 at java.awt.EventQueue$3.run(EventQueue.java:709)
 at java.awt.EventQueue$3.run(EventQueue.java:703)
 at java.security.AccessController.doPrivileged(Native Method)
 at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
 at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
 at java.awt.EventQueue$4.run(EventQueue.java:731)
 at java.awt.EventQueue$4.run(EventQueue.java:729)
 at java.security.AccessController.doPrivileged(Native Method)
 at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
 at 
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
 at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
 at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
 at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
[catch] at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to