Discussion:
[Cucumber] Eclipse JDT compiler NPE, using io.cucumber.datatable.DataTableType
(too old to reply)
Martin Tržický
2018-08-21 10:54:08 UTC
Permalink
Hi,

is anyone having issue with Eclipse IDE, trying to compile this
(simplified):
DataTableType dtt = new DataTableType(Integer.class, (Map<String, String>
row) -> new Integer(0));

Eclipse (latest Photon release) cannot compile it, giving this error:

!MESSAGE Error in JDT Core during AST creation
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.analyseCode(AllocationExpression.java:95)
at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:95)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:125)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.internalAnalyseCode(TypeDeclaration.java:761)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode(TypeDeclaration.java:265)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:125)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1249)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:711)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1208)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:823)
at org.eclipse.jdt.core.manipulation.CoreASTProvider$1.run(CoreASTProvider.java:268)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.core.manipulation.CoreASTProvider.createAST(CoreASTProvider.java:260)
at org.eclipse.jdt.core.manipulation.CoreASTProvider.getAST(CoreASTProvider.java:193)
at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:135)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:173)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:158)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)

Thanks,
Martin
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
aslak hellesoy
2018-08-22 22:09:04 UTC
Permalink
I think questions about Eclipse are better directed at the Eclipse team.

Cheers,
Aslak
Post by Martin Tržický
Hi,
is anyone having issue with Eclipse IDE, trying to compile this
DataTableType dtt = new DataTableType(Integer.class, (Map<String, String>
row) -> new Integer(0));
!MESSAGE Error in JDT Core during AST creation
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.analyseCode(AllocationExpression.java:95)
at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:95)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:125)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.internalAnalyseCode(TypeDeclaration.java:761)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode(TypeDeclaration.java:265)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:125)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1249)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:711)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1208)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:823)
at org.eclipse.jdt.core.manipulation.CoreASTProvider$1.run(CoreASTProvider.java:268)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.core.manipulation.CoreASTProvider.createAST(CoreASTProvider.java:260)
at org.eclipse.jdt.core.manipulation.CoreASTProvider.getAST(CoreASTProvider.java:193)
at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:135)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:173)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:158)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Thanks,
Martin
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Martin Tržický
2018-08-23 12:03:28 UTC
Permalink
Hi Aslak,

sure, I've filled a bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=538192

And the code can be rewritten as well:
DataTableType dtt = new DataTableType(Integer.class, (TableEntryTransformer<
Integer>) entry -> new Integer(0));

So it is just for the record, if anyone runs into it.

Thanks,
Martin
Post by aslak hellesoy
I think questions about Eclipse are better directed at the Eclipse team.
Cheers,
Aslak
Post by Martin Tržický
Hi,
is anyone having issue with Eclipse IDE, trying to compile this
DataTableType dtt = new DataTableType(Integer.class, (Map<String, String>
row) -> new Integer(0));
!MESSAGE Error in JDT Core during AST creation
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.analyseCode(AllocationExpression.java:95)
at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:95)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:125)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.internalAnalyseCode(TypeDeclaration.java:761)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode(TypeDeclaration.java:265)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:125)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1249)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:711)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1208)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:823)
at org.eclipse.jdt.core.manipulation.CoreASTProvider$1.run(CoreASTProvider.java:268)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.core.manipulation.CoreASTProvider.createAST(CoreASTProvider.java:260)
at org.eclipse.jdt.core.manipulation.CoreASTProvider.getAST(CoreASTProvider.java:193)
at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:135)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:173)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:158)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Thanks,
Martin
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...