Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-4570

Formatting fails in NB 12.0 with openjdk 11

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Workaround
    • 12.0
    • None
    • None

    Description

      Using NB 12.0 running openjdk 11.0, when a switch statement is added to the file the formatting (Alt-Shift-F) throws NullPointerException.

       

      Validated same behavior on both Windows and Linux.

       

       

      SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.progress.ui.RunOffEDTImpl$1
      java.lang.NullPointerException
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:586)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCase(Reformatter.java:2919)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCase(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCase.accept(JCTree.java:1258)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.handleSwitch(Reformatter.java:2870)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitSwitch(Reformatter.java:2771)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitSwitch(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:1967)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1032)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitMethod(Reformatter.java:1540)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitMethod(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:898)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitClass(Reformatter.java:1046)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitClass(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCompilationUnit(Reformatter.java:647)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCompilationUnit(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.reformat(Reformatter.java:513)
      at org.netbeans.modules.java.source.save.Reformatter.reformatImpl(Reformatter.java:227)
      at org.netbeans.modules.java.source.save.Reformatter.reformat(Reformatter.java:100)
      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)
      [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
      SEVERE [null]: Last record repeated 2 more times.
      SEVERE [null]: Last record repeated 2 more times.
      SEVERE [null]: Last record repeated 2 more times.
      SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.progress.ui.RunOffEDTImpl$1
      java.lang.NullPointerException
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:586)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCase(Reformatter.java:2919)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCase(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCase.accept(JCTree.java:1258)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.handleSwitch(Reformatter.java:2870)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitSwitch(Reformatter.java:2771)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitSwitch(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:1967)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1032)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.reformat(Reformatter.java:513)
      at org.netbeans.modules.java.source.save.Reformatter.reformatImpl(Reformatter.java:227)
      at org.netbeans.modules.java.source.save.Reformatter.reformat(Reformatter.java:100)
      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)
      [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
      SEVERE [null]: Last record repeated again.
      SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.progress.ui.RunOffEDTImpl$1
      java.lang.NullPointerException
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:586)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCase(Reformatter.java:2919)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCase(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCase.accept(JCTree.java:1258)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.handleSwitch(Reformatter.java:2870)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitSwitch(Reformatter.java:2771)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitSwitch(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:1967)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1032)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitMethod(Reformatter.java:1540)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitMethod(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:898)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitClass(Reformatter.java:1046)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitClass(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCompilationUnit(Reformatter.java:647)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCompilationUnit(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.reformat(Reformatter.java:513)
      at org.netbeans.modules.java.source.save.Reformatter.reformatImpl(Reformatter.java:227)
      at org.netbeans.modules.java.source.save.Reformatter.reformat(Reformatter.java:100)
      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)
      [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
      INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: CancelableTaskWrapper[task: org.netbeans.modules.web.beans.analysis.WebBeansEditorAnalysisTask@2ee2768f, phase: RESOLVED, priority: 500] : class org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper ignored cancel for 60 ms.
      SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.progress.ui.RunOffEDTImpl$1
      java.lang.NullPointerException
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:586)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCase(Reformatter.java:2919)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCase(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCase.accept(JCTree.java:1258)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.handleSwitch(Reformatter.java:2870)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitSwitch(Reformatter.java:2771)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitSwitch(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitch.accept(JCTree.java:1229)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:1967)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1032)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitMethod(Reformatter.java:1540)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitMethod(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:898)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitClass(Reformatter.java:1046)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitClass(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.scan(Reformatter.java:600)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCompilationUnit(Reformatter.java:647)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitCompilationUnit(Reformatter.java:396)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591)
      at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
      at org.netbeans.modules.java.source.save.Reformatter$Pretty.reformat(Reformatter.java:513)
      at org.netbeans.modules.java.source.save.Reformatter.reformatImpl(Reformatter.java:227)
      at org.netbeans.modules.java.source.save.Reformatter.reformat(Reformatter.java:100)
      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)
      [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
      SEVERE [null]: Last record repeated again.
      SEVERE [null]: Last record repeated again.
      SEVERE [null]: Last record repeated 2 more times.

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            ndthayer Nicholas D. Thayer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: