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

No sample code ans NPE when accessing java wrapping format options

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Critical
    • Resolution: Unresolved
    • 12.0
    • None
    • editor - Options
    • AdoptJDK 11
      Ubuntu 20.04
      no javac

    Description

      No preview code is displayed and a NullPointerException is thrown when navigating to Options / Editor / Formatting / Java / Wrapping.

       

      I use OpenJdk 11 on Ubuntu 20.04 and did not have javac  installed.

       

      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:539)
      	at org.netbeans.modules.java.source.save.Reformatter.reformat(Reformatter.java:119)
      	at org.netbeans.modules.java.source.save.Reformatter.reformat(Reformatter.java:106)
      	at org.netbeans.modules.java.ui.CategorySupport$2.run(CategorySupport.java:280)
      	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)

      Attachments

        Activity

          People

            Unassigned Unassigned
            ghislaingeffroy Ghislain G.
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: