With this environment:
eclipse.buildId=4.27.0.20230309-1200
java.version=17.0.5
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=fr_FR
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
I get this error:
org.eclipse.jdt.groovy.core
Error
Thu May 18 09:03:27 CEST 2023
Groovy-Eclipse Type Inferencing: Error visiting method run in class OrderStats
java.lang.NullPointerException
Stack trace:
java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because "this.listKeys[i]" is null
at org.codehaus.groovy.util.ListHashMap.get(ListHashMap.java:115)
at org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData(NodeMetaDataHandler.java:44)
at org.eclipse.jdt.groovy.search.GenericsMapper.gatherGenerics(GenericsMapper.java:94)
at org.eclipse.jdt.groovy.search.TypeLookupResult.resolveTypeParameterization(TypeLookupResult.java:177)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.lookupExpressionType(TypeInferencingVisitorWithRequestor.java:2839)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.getMethodCallArgumentTypes(TypeInferencingVisitorWithRequestor.java:2388)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.handleSimpleExpression(TypeInferencingVisitorWithRequestor.java:2063)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.handleSimpleExpression(TypeInferencingVisitorWithRequestor.java:2074)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitConstantExpression(TypeInferencingVisitorWithRequestor.java:1010)
at org.codehaus.groovy.ast.expr.ConstantExpression.visit(ConstantExpression.java:86)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1516)
at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:77)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitListExpression(TypeInferencingVisitorWithRequestor.java:1360)
at org.codehaus.groovy.ast.expr.ListExpression.visit(ListExpression.java:62)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitTupleExpression(TypeInferencingVisitorWithRequestor.java:1888)
at org.codehaus.groovy.ast.CodeVisitorSupport.visitArgumentlistExpression(CodeVisitorSupport.java:367)
at org.codehaus.groovy.ast.expr.ArgumentListExpression.visit(ArgumentListExpression.java:73)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1547)
at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:77)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitBinaryExpression(TypeInferencingVisitorWithRequestor.java:786)
at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:58)
at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:117)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:252)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitExpressionStatement(TypeInferencingVisitorWithRequestor.java:1152)
at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:216)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitBlockStatement(TypeInferencingVisitorWithRequestor.java:874)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:165)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitConstructorOrMethod(TypeInferencingVisitorWithRequestor.java:1117)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodInternal(TypeInferencingVisitorWithRequestor.java:662)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitJDT(TypeInferencingVisitorWithRequestor.java:475)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitJDT(TypeInferencingVisitorWithRequestor.java:376)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitCompilationUnit(TypeInferencingVisitorWithRequestor.java:257)
at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.internalFindOccurences(GroovyOccurrencesFinder.java:138)
at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.getOccurrences(GroovyOccurrencesFinder.java:86)
at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.findOccurrences(GroovyOccurrencesFinder.java:194)
at org.codehaus.groovy.eclipse.editor.GroovyEditor.updateOccurrenceAnnotations(GroovyEditor.java:1259)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.lambda$4(JavaEditor.java:3363)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:175)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$1.run(SelectionListenerWithASTManager.java:151)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
If that can help, OrderStats class is https://github.com/apache/ofbiz-framework/blob/1d92963d8d02e9ed09312b25da4a819fa731a160/applications/order/groovyScripts/order/OrderStats.groovy
TIA
Jacques
With this environment:
I get this error:
Stack trace:
If that can help, OrderStats class is https://github.com/apache/ofbiz-framework/blob/1d92963d8d02e9ed09312b25da4a819fa731a160/applications/order/groovyScripts/order/OrderStats.groovy
TIA
Jacques