You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "frankvdh (via GitHub)" <gi...@apache.org> on 2024/05/23 04:48:01 UTC
[I] An error occurred during parsing of 'C:\home\frank\NetBeansProjects\PdfTables\test\frankv\pdftables\test\MultipleTablesTest.java'. Please report a bug against java/source and attach dump file 'C:\Users\frank\AppData\Roaming\NetBeans\21\var\log\MultipleTablesTest_92.dump'. [netbeans]
frankvdh opened a new issue, #7397:
URL: https://github.com/apache/netbeans/issues/7397
### Apache NetBeans version
Apache NetBeans 21
### What happened
I received this notification...
Annotation: An error occurred during parsing of 'C:\home\frank\NetBeansProjects\PdfTables\test\frankv\pdftables\test\MultipleTablesTest.java'. Please report a bug against java/source and attach dump file 'C:\Users\frank\AppData\Roaming\NetBeans\21\var\log\MultipleTablesTest_92.dump'.
Annotation: An error occurred during parsing of 'C:\home\frank\NetBeansProjects\PdfTables\test\frankv\pdftables\test\MultipleTablesTest.java'. Please report a bug against java/source and attach dump file 'C:\Users\frank\AppData\Roaming\NetBeans\21\var\log\MultipleTablesTest_92.dump'.
Annotation: An error occurred during parsing of 'C:\home\frank\NetBeansProjects\PdfTables\test\frankv\pdftables\test\MultipleTablesTest.java'. Please report a bug against java/source and attach dump file 'C:\Users\frank\AppData\Roaming\NetBeans\21\var\log\MultipleTablesTest_92.dump'.
An error occurred during parsing of 'C:\home\frank\NetBeansProjects\PdfTables\test\frankv\pdftables\test\MultipleTablesTest.java'. Please report a bug against java/source and attach dump file 'C:\Users\frank\AppData\Roaming\NetBeans\21\var\log\MultipleTablesTest_92.dump'.
An error occurred during parsing of 'C:\home\frank\NetBeansProjects\PdfTables\test\frankv\pdftables\test\MultipleTablesTest.java'. Please report a bug against java/source and attach dump file 'C:\Users\frank\AppData\Roaming\NetBeans\21\var\log\MultipleTablesTest_92.dump'.
Caused: java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.tree.JCTree.accept(com.sun.tools.javac.tree.JCTree$Visitor)" because "tree" is null
at com.sun.tools.javac.comp.ArgumentAttr.attribArg(ArgumentAttr.java:198)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:660)
at com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:763)
at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2608)
at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1816)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:715)
at com.sun.tools.javac.comp.Attr.visitExec(Attr.java:2326)
at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1603)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:736)
at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:755)
at com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:3223)
at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1993)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.DeferredAttr$DeferredType.complete(DeferredAttr.java:316)
at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:355)
at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:339)
at com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:1073)
at com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:900)
at com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:788)
at com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:909)
at com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:175)
at com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:618)
at com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:657)
at com.sun.tools.javac.comp.Attr.checkMethod(Attr.java:4949)
at com.sun.tools.javac.comp.AttrRecover.doRecovery(AttrRecover.java:193)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:738)
at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:755)
at com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:3197)
at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1993)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:515)
at com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:495)
at com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:466)
at com.sun.tools.javac.comp.DeferredAttr$DeferredType.complete(DeferredAttr.java:311)
at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:355)
at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:339)
at com.sun.tools.javac.comp.DeferredAttr$RecoveryDeferredTypeMap.recover(DeferredAttr.java:1094)
at com.sun.tools.javac.comp.DeferredAttr$RecoveryDeferredTypeMap.typeOf(DeferredAttr.java:1060)
at com.sun.tools.javac.comp.DeferredAttr$RecoveryDeferredTypeMap.typeOf(DeferredAttr.java:1050)
at com.sun.tools.javac.comp.DeferredAttr$DeferredTypeMap.visitType(DeferredAttr.java:1027)
at com.sun.tools.javac.comp.DeferredAttr$RecoveryDeferredTypeMap.visitType(DeferredAttr.java:1050)
at com.sun.tools.javac.comp.DeferredAttr$DeferredTypeMap.visitType(DeferredAttr.java:1013)
at com.sun.tools.javac.code.Type.accept(Type.java:223)
at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4894)
at com.sun.tools.javac.code.Types$TypeMapping.lambda$visit$0(Types.java:5002)
at com.sun.tools.javac.util.List.map(List.java:428)
at com.sun.tools.javac.code.Types$TypeMapping.visit(Types.java:5002)
at com.sun.tools.javac.code.Type$StructuralTypeMapping.visitMethodType(Type.java:290)
at com.sun.tools.javac.comp.DeferredAttr$RecoveryDeferredTypeMap.visitMethodType(DeferredAttr.java:1078)
at com.sun.tools.javac.comp.DeferredAttr$RecoveryDeferredTypeMap.visitMethodType(DeferredAttr.java:1050)
at com.sun.tools.javac.code.Type$MethodType.accept(Type.java:1495)
at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4894)
at com.sun.tools.javac.code.Type$StructuralTypeMapping.visitForAll(Type.java:306)
at com.sun.tools.javac.code.Type$StructuralTypeMapping.visitForAll(Type.java:239)
at com.sun.tools.javac.code.Type$ForAll.accept(Type.java:1854)
at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4894)
at com.sun.tools.javac.code.Type.map(Type.java:319)
at com.sun.tools.javac.comp.AttrRecover.basicMethodInvocationRecovery(AttrRecover.java:223)
at com.sun.tools.javac.comp.AttrRecover.recoverMethodInvocation(AttrRecover.java:214)
at com.sun.tools.javac.comp.Attr.checkMethodIdInternal(Attr.java:4644)
at com.sun.tools.javac.comp.Attr.checkId(Attr.java:4634)
at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:4527)
at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2581)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2617)
at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1816)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:715)
at com.sun.tools.javac.comp.Attr.visitExec(Attr.java:2326)
at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1603)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:736)
at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:755)
at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1439)
at org.netbeans.lib.nbjavac.services.NBAttr.visitBlock(NBAttr.java:90)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1092)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:736)
at com.sun.tools.javac.comp.Attr.visitTry(Attr.java:1963)
at com.sun.tools.javac.tree.JCTree$JCTry.accept(JCTree.java:1465)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:736)
at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:755)
at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1439)
at org.netbeans.lib.nbjavac.services.NBAttr.visitBlock(NBAttr.java:90)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1092)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:736)
at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1229)
at org.netbeans.lib.nbjavac.services.NBAttr.visitMethodDef(NBAttr.java:84)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:916)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:662)
at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:736)
at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:5655)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5543)
at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5367)
at org.netbeans.lib.nbjavac.services.NBAttr.attribClass(NBAttr.java:72)
at com.sun.tools.javac.comp.Attr.attrib(Attr.java:5306)
at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1359)
at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1332)
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:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1420)
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:2035)
[MultipleTablesTest_92.zip](https://github.com/apache/netbeans/files/15411577/MultipleTablesTest_92.zip)
### Language / Project Type / NetBeans Component
_No response_
### How to reproduce
Occurs when I try to build or rebuild my project. Reloading Netbeans doesn't help.
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Win11
### JDK
jdk21
### Apache NetBeans packaging
Apache NetBeans provided installer
### Anything else
_No response_
### 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] Parsing of java code with broken lambdas fails [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on issue #7397:
URL: https://github.com/apache/netbeans/issues/7397#issuecomment-2133943592
This is reproducible standalone with the supplied file. I took that as base and distilled it down to:
```java
import java.util.ArrayList;
public class Dummy {
private void main() {
ArrayList<ArrayList<String[]>> result = new ArrayList<>();
result.stream().map((table) -> {
table.stream().map((row) -> {
return null;
}).forEachOrdered((_item) -> System.out.println();
}).forEachOrdered((_item) -> System.out.println("---"))
);
}
}
```
The compiler rightfully complains about this:
```
Dummy.java:10: error: ')' or ',' expected
}).forEachOrdered((_item) -> System.out.println();
^
Dummy.java:11: error: ';' expected
}).forEachOrdered((_item) -> System.out.println("---"))
^
2 errors
```
But NB raises an Exception as already shown.
I used by debugging-fu and found, that the `JCMethodInvocation` instance that for the lambda is indeed constructed with an argument list and all arguments are non-null. So I figured, that some later stage must destroy the tree for the argument and indeed I got a hit in `com.sun.tools.javac.tree.TreeTranslator.translate(List<T>)`/`com.sun.tools.javac.tree.TreeTranslator.visitApply(JCMethodInvocation)`. The transformation that is applied there is an anonymous class in `com.sun.tools.javac.comp.AttrRecover.AttrRecover(Context)`.
This comment:
https://github.com/openjdk/jdk/blob/617edf3f0dea2b73e4b444e085de2ad282826e31/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrRecover.java#L151-L154
makes no sense from my POV as the TreeTranslator expects the translated tree in `result`. If the translation result must not be null, the caller could be modified to check for null and only replace the tree if the translation is non-null (line 59 and following):
https://github.com/openjdk/jdk/blob/617edf3f0dea2b73e4b444e085de2ad282826e31/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java#L54-L63
Or the `AttrRecover` class needs to be adjusted to return set `result` to the input tree if it shall not be touched.
@lahodaj would you mind having a look at this? I try to reason my way around this, but maybe this the right analysis and you can whip up the right fix?!
--
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] Parsing of java code with broken lambdas fails [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #7397:
URL: https://github.com/apache/netbeans/issues/7397#issuecomment-2168334989
should be fixed via https://github.com/apache/netbeans/pull/7484
--
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] Parsing of java code with broken lambdas fails [netbeans]
Posted by "lahodaj (via GitHub)" <gi...@apache.org>.
lahodaj commented on issue #7397:
URL: https://github.com/apache/netbeans/issues/7397#issuecomment-2135843898
@matthiasblaesing, uh. You are right, of course. Thanks for diagnosing it so deeply. I've filled:
https://bugs.openjdk.org/browse/JDK-8333107
--
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] Parsing of java code with broken lambdas fails [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on issue #7397:
URL: https://github.com/apache/netbeans/issues/7397#issuecomment-2144008967
@lahodaj thank you! As the fix made it already into 23, I assume next nb-javac update should fix this issue.
--
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] An error occurred during parsing of attached file [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #7397:
URL: https://github.com/apache/netbeans/issues/7397#issuecomment-2126261944
lets use a more reasonable issue title
--
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] Parsing of java code with broken lambdas fails [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien closed issue #7397: Parsing of java code with broken lambdas fails
URL: https://github.com/apache/netbeans/issues/7397
--
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