You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Boris Heithecker (Jira)" <ji...@apache.org> on 2020/07/10 10:30:00 UTC

[jira] [Commented] (NETBEANS-4569) Format Java code throws NullPointerException

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

Boris Heithecker commented on NETBEANS-4569:
--------------------------------------------

This affects switch clauses which include a default case.

> Format Java code throws NullPointerException
> --------------------------------------------
>
>                 Key: NETBEANS-4569
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-4569
>             Project: NetBeans
>          Issue Type: Bug
>    Affects Versions: 12.0
>            Reporter: Boris Heithecker
>            Priority: Major
>
> Action Format code (Alt+Shift-F) sometimes fails due to a NullPointerException thrown.
> Affects Java code. 
> I could not determine the exact pattern to reproduce this, but it definitely depends on pieces of the source code. Commenting out parts of the affected class sometimes helps. 
> I've been working with the same sources in 11.3 and didn't notice anything like it.
> Stack trace: 
> java.lang.NullPointerExceptionjava.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)
>  
> Maybe it can be fixed easily by checking for null. 



--
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