Enrico Olivelli created NETBEANS-814:
----------------------------------------

             Summary: NullPointerException while editing Java file
                 Key: NETBEANS-814
                 URL: https://issues.apache.org/jira/browse/NETBEANS-814
             Project: NetBeans
          Issue Type: Bug
    Affects Versions: 9.0
         Environment: Linux Fedora 27
NetBeans 9 RC1
NetBeans running on Java 10 without nb-javac
Java Maven Project with source version 1.8
            Reporter: Enrico Olivelli


I periodically get this error while having a Java file opened in the editor.

I did not find a duplicate in JIRA
{code:java}
java.lang.NullPointerException
    at 
jdk.compiler/com.sun.tools.javac.api.JavacTrees.getElement(JavacTrees.java:386)
    at 
jdk.compiler/com.sun.tools.javac.api.JavacTrees.getElement(JavacTrees.java:163)
    at 
org.netbeans.modules.java.hints.jdk.mapreduce.PreconditionsChecker$VariablesVisitor.isLocalVariable(PreconditionsChecker.java:226)
    at 
org.netbeans.modules.java.hints.jdk.mapreduce.PreconditionsChecker$VariablesVisitor.visitIdentifier(PreconditionsChecker.java:218)
    at 
org.netbeans.modules.java.hints.jdk.mapreduce.PreconditionsChecker$VariablesVisitor.visitIdentifier(PreconditionsChecker.java:192)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2251)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:86)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitVariable(TreeScanner.java:221)
    at 
org.netbeans.modules.java.hints.jdk.mapreduce.PreconditionsChecker$VariablesVisitor.visitVariable(PreconditionsChecker.java:213)
    at 
org.netbeans.modules.java.hints.jdk.mapreduce.PreconditionsChecker$VariablesVisitor.visitVariable(PreconditionsChecker.java:192)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:974)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:86)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:248)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1032)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:86)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
    at 
org.netbeans.api.java.source.support.ErrorAwareTreeScanner.visitErroneous(ErrorAwareTreeScanner.java:32)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCErroneous.accept(JCTree.java:2927)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:86)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitExpressionStatement(TreeScanner.java:433)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1460)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:86)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitIf(TreeScanner.java:419)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1433)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:86)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:248)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1032)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:86)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitIf(TreeScanner.java:419)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1433)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:86)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:248)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1032)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:86)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitEnhancedForLoop(TreeScanner.java:306)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCEnhancedForLoop.accept(JCTree.java:1172)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:86)
    at 
org.netbeans.modules.java.hints.jdk.mapreduce.PreconditionsChecker.getInnerVariables(PreconditionsChecker.java:90)
    at 
org.netbeans.modules.java.hints.jdk.mapreduce.PreconditionsChecker.<init>(PreconditionsChecker.java:75)
    at 
org.netbeans.modules.java.hints.jdk.mapreduce.ForLoopToFunctionalHint.computeWarning(ForLoopToFunctionalHint.java:55)
    at jdk.internal.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)
    at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[catch] at 
org.netbeans.modules.java.hints.providers.code.CodeHintProviderImpl$WorkerImpl.createErrors(CodeHintProviderImpl.java:317)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.runHint(HintsInvoker.java:798)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.access$400(HintsInvoker.java:90)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.runAndAdd(HintsInvoker.java:657)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:676)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:610)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
    at 
org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:78)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:248)
    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.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:682)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:610)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitTry(TreeScanner.java:374)
    at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCTry.accept(JCTree.java:1328)
    at 
jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
    at 
org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:682)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:610)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
    at 
org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:78)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:248)
    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.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:682)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:610)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:206)
    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.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:682)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:610)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
    at 
org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:78)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:187)
    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.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:69)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:682)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:610)
    at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
    at 
org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:78)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
    at 
jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:144)
    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.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:701)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHintsImpl(HintsInvoker.java:245)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:228)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:193)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:166)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:128)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:114)
    at 
org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:65)
    at 
org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:273)
    at 
org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:561)
    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:514)
    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)

{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to