Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
Product Version: Apache NetBeans IDE DEV (Build dev-0b4f99558376e32461217a83611de4d0787b6ad9)
Java: 16-internal; Java HotSpot(TM) 64-Bit Server VM 16-internal+0-2020-10-29-1334179
Runtime: Java(TM) SE Runtime Environment 16-internal+0-2020-10-29-1334179
System: Windows 10 version 10.0 running on amd64; Cp1252; en_IN (nb)
User directory: C:\projects\netbeans\main1\netbeans\nbbuild\testuserdir
Cache directory: C:\projects\netbeans\main1\netbeans\nbbuild\testuserdir\var\cacheProduct Version: Apache NetBeans IDE DEV (Build dev-0b4f99558376e32461217a83611de4d0787b6ad9) Java: 16-internal; Java HotSpot(TM) 64-Bit Server VM 16-internal+0-2020-10-29-1334179 Runtime: Java(TM) SE Runtime Environment 16-internal+0-2020-10-29-1334179 System: Windows 10 version 10.0 running on amd64; Cp1252; en_IN (nb) User directory: C:\projects\netbeans\main1\netbeans\nbbuild\testuserdir Cache directory: C:\projects\netbeans\main1\netbeans\nbbuild\testuserdir\var\cache
Description
Write below code on java editor and save
-------------------------------------------------
public class PatternMatchingFinalizationTest {/**
{{ * @param args the command line arguments}}
{{ */}}
{{ public static void main(String[] args) {}}
{{ // TODO code application logic here }}
{{ Object o = new String("Hello Java ");}}
{{ if(o instanceof String s){}}
{{ System.out.println(s);}}
{{ }}}
{{ }}}
}
-----------------------------------------------------------
Below exception thrown on editor
-------------------------------------
java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "org.netbeans.modules.java.editor.base.semantic.TreeShims.getBinding(com.sun.source.tree.Tree)" is nulljava.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "org.netbeans.modules.java.editor.base.semantic.TreeShims.getBinding(com.sun.source.tree.Tree)" is null at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:1017) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:280) at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:94) at jdk.compiler/com.sun.source.util.TreeScanner.visitInstanceOf(TreeScanner.java:677) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCInstanceOf.accept(JCTree.java:2178) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:1021) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:280) at jdk.compiler/com.sun.source.util.TreeScanner.visitParenthesized(TreeScanner.java:595) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCParens.accept(JCTree.java:1970) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:1021) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:280) at jdk.compiler/com.sun.source.util.TreeScanner.visitIf(TreeScanner.java:441) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1513) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:1021) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:280) at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:94) at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:109) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:78) at jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:254) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1059) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:1021) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.visitMethod(SemanticHighlighterBase.java:836) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.visitMethod(SemanticHighlighterBase.java:280) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:925) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:1021) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:280) at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:94) at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:109) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:78) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.visitClass(SemanticHighlighterBase.java:944) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.visitClass(SemanticHighlighterBase.java:280) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:832) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:1021) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:280) at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:109) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:78) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.visitCompilationUnit(SemanticHighlighterBase.java:561) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.visitCompilationUnit(SemanticHighlighterBase.java:280) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:603) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:86) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase$DetectorVisitor.scan(SemanticHighlighterBase.java:1021) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase.process(SemanticHighlighterBase.java:156) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter.process(SemanticHighlighter.java:56) at org.netbeans.modules.java.editor.base.semantic.SemanticHighlighterBase.run(SemanticHighlighterBase.java:112) at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:561)[catch] at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:786) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:279) at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 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)