You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Buddy Foren (Jira)" <ji...@apache.org> on 2021/11/01 11:50:00 UTC

[jira] [Commented] (NETBEANS-4456) No sample code ans NPE when accessing java wrapping format options

    [ https://issues.apache.org/jira/browse/NETBEANS-4456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17436777#comment-17436777 ] 

Buddy Foren commented on NETBEANS-4456:
---------------------------------------

I had this exact error, too.

 

I realized it when I tried to format code in the editor and it didn't so I switched on the ide log. Also got the nullpointer inside the options where you found it.

 

Funny thing was that the formatter only gave this nullpointer in the editor in a specific file after a specific line number. If I selected some lines before it could successfully format the code. No special code was there. This demarcation line was not fixed. When I edited some lines the demarcation moved up and down in the code unrelated to the line number.

 

Very annoying.

 

Netbeans now gave me the info to install the plugin nb-javac which I did and now I can format again in the former bad file. Also in the options no more nullpointer. I have no idea if it has something to do with the plugin or just with me restarting Netbeans although I tried to restart Netbeans before and it did not help.

 

I may mention I am not directly using Netbeans but the Jmonkey engine which practically is enhanced Netbeans.

 

> No sample code ans NPE when accessing java wrapping format options
> ------------------------------------------------------------------
>
>                 Key: NETBEANS-4456
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-4456
>             Project: NetBeans
>          Issue Type: Bug
>          Components: editor - Options
>    Affects Versions: 12.0
>         Environment: AdoptJDK 11
> Ubuntu 20.04
> no javac
>            Reporter: Ghislain G.
>            Priority: Critical
>              Labels: bug
>         Attachments: image-2020-06-16-15-33-16-088.png
>
>
> 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.
>  
> !image-2020-06-16-15-33-16-088.png|width=530,height=473!
> {noformat}
> 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){noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

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