You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "makiam (via GitHub)" <gi...@apache.org> on 2025/12/01 11:22:17 UTC

[I] IDE throws NullPointerException from javac on opening file [netbeans]

makiam opened a new issue, #9055:
URL: https://github.com/apache/netbeans/issues/9055

   ### Apache NetBeans version
   
   Apache NetBeans 29 latest daily build
   
   ### What happened
   
   Opening some files in Java + Kotlin multi-module Gradle project throws NPE from nbjavac code:
   Caused: java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Symbol.flags()" because "sym" is null
   	at com.sun.tools.javac.code.Types.memberType(Types.java:2304)
   	at com.sun.tools.javac.comp.Attr.isBooleanOrNumeric(Attr.java:2141)
   	at com.sun.tools.javac.comp.Attr.isBooleanOrNumeric(Attr.java:2130)
   	at com.sun.tools.javac.comp.Attr.visitConditional(Attr.java:2068)
   	at com.sun.tools.javac.tree.JCTree$JCConditional.accept(JCTree.java:1580)
   	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
   	at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:723)
   	at com.sun.tools.javac.comp.Attr.visitVarDef(Attr.java:1317)
   	at org.netbeans.lib.nbjavac.services.NBAttr.visitVarDef(NBAttr.java:99)
   	at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1066)
   	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
   	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
   	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:770)
   	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1463)
   	at org.netbeans.lib.nbjavac.services.NBAttr.visitBlock(NBAttr.java:92)
   	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1136)
   	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
   	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
   	at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1244)
   	at org.netbeans.lib.nbjavac.services.NBAttr.visitMethodDef(NBAttr.java:86)
   	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:960)
   	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:677)
   	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:751)
   	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:5664)
   	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5550)
   	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5365)
   	at org.netbeans.lib.nbjavac.services.NBAttr.attribClass(NBAttr.java:74)
   	at com.sun.tools.javac.comp.Attr.attrib(Attr.java:5302)
   	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1346)
   	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1319)
   	at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:404)
   	at com.sun.tools.javac.api.JavacTaskImpl.lambda$analyze$1(JavacTaskImpl.java:379)
   	at com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
   	at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:379)
   Caused: java.lang.IllegalStateException
   	at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:383)
   	at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:765)
   	at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:536)
   	at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:140)
   	at org.netbeans.modules.parsing.impl.TaskProcessor.callGetResult(TaskProcessor.java:608)
   	at org.netbeans.modules.parsing.impl.SourceCache.getResult(SourceCache.java:241)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:775)
   	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:288)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
   [catch] at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663)
   	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
   	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
   	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
   	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
   
   ### Language / Project Type / NetBeans Component
   
   Java + Kotlin multi-module Gradle project
   
   ### How to reproduce
   
   Open GH project: https://github.com/makiam/Tokonga
   Module: Translators 
   Open File OBJExporter.java
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Ubuntu and/or Windows
   
   ### JDK
   
   Java: 17.0.10; OpenJDK 64-Bit Server VM 17.0.10+13-LTS
   
   ### Apache NetBeans packaging
   
   Other
   
   ### Anything else
   
   IDE dump file
   [OBJExporter_2.zip](https://github.com/user-attachments/files/23852197/OBJExporter_2.zip)
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

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


Re: [I] IDE throws NullPointerException from javac on opening file [netbeans]

Posted by "lahodaj (via GitHub)" <gi...@apache.org>.
lahodaj commented on issue #9055:
URL: https://github.com/apache/netbeans/issues/9055#issuecomment-3597923798

   FWIW, a recent fix that fixes an NPE on the same place:
   https://github.com/openjdk/jdk/commit/ac046628edaee66d1469c49864b70bdefee6570e
   it is hard to tell if it is the same as here, but certainly possible. Will be adopted when we start to use JDK 26's javac.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

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


Re: [I] IDE throws NullPointerException from javac on opening file [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #9055:
URL: https://github.com/apache/netbeans/issues/9055#issuecomment-3596646147

   can't reproduce it. The last time I found a reference to this exception was in a NB 19 log file. Probably a sporadic failure and/or lombok related


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

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