Skip to content

ArrayIndexOutOfBoundsException - Type Inference #826

@shawnweeks

Description

@shawnweeks

This looks similar to #808 but when trying to auto complete org.apache.avro.SchemaBuilder you get the following exception. I'm running Eclipse 4.10 latest and Eclipse Groovy Development Tools 3.3.0.xx-201902260000-e48. You can take a look at the groovy script at shawnweeks/nifi-groovy-testing on github.

java.lang.RuntimeException: Failed to initialize members for type org.apache.avro.SchemaBuilder
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initializeMembers(JDTClassNode.java:306)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initialize(JDTClassNode.java:202)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.lazyClassInit(JDTClassNode.java:169)
	at org.codehaus.groovy.ast.ClassNode.getAnnotations(ClassNode.java:1607)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.getAnnotations(JDTClassNode.java:501)
	at org.codehaus.groovy.transform.trait.Traits.isAnnotatedWithTrait(Traits.java:177)
	at org.codehaus.groovy.transform.trait.Traits.isTrait(Traits.java:158)
	at org.eclipse.jdt.groovy.core.util.GroovyUtils.lambda$6(GroovyUtils.java:467)
	at java.util.Map.computeIfAbsent(Unknown Source)
	at org.codehaus.groovy.ast.ASTNode.getNodeMetaData(ASTNode.java:157)
	at org.eclipse.jdt.groovy.core.util.GroovyUtils.implementsTrait(GroovyUtils.java:464)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.findMethodDeclaration(SimpleTypeLookup.java:664)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.findDeclaration(SimpleTypeLookup.java:590)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.findTypeForNameWithKnownObjectExpression(SimpleTypeLookup.java:363)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.findTypeForNameWithKnownObjectExpression(SimpleTypeLookup.java:443)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.findType(SimpleTypeLookup.java:222)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.lookupType(SimpleTypeLookup.java:85)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.lookupExpressionType(TypeInferencingVisitorWithRequestor.java:2353)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.handleSimpleExpression(TypeInferencingVisitorWithRequestor.java:1801)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitConstantExpression(TypeInferencingVisitorWithRequestor.java:956)
	at org.codehaus.groovy.ast.expr.ConstantExpression.visit(ConstantExpression.java:85)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1373)
	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1357)
	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1357)
	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1357)
	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1357)
	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1357)
	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1357)
	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitBinaryExpression(TypeInferencingVisitorWithRequestor.java:745)
	at org.codehaus.groovy.ast.CodeVisitorSupport.visitDeclarationExpression(CodeVisitorSupport.java:298)
	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitDeclarationExpression(ClassCodeVisitorSupport.java:150)
	at org.codehaus.groovy.ast.expr.DeclarationExpression.visit(DeclarationExpression.java:89)
	at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:122)
	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:263)
	at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
	at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:88)
	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:233)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitBlockStatement(TypeInferencingVisitorWithRequestor.java:820)
	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:145)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitConstructorOrMethod(TypeInferencingVisitorWithRequestor.java:1051)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodInternal(TypeInferencingVisitorWithRequestor.java:616)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitJDT(TypeInferencingVisitorWithRequestor.java:454)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitJDT(TypeInferencingVisitorWithRequestor.java:345)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitCompilationUnit(TypeInferencingVisitorWithRequestor.java:251)
	at org.codehaus.groovy.eclipse.codebrowsing.requestor.CodeSelectHelper.selectASTNode(CodeSelectHelper.java:127)
	at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.initialize(GroovyOccurrencesFinder.java:167)
	at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.findOccurrences(GroovyOccurrencesFinder.java:196)
	at org.codehaus.groovy.eclipse.editor.GroovyEditor.updateOccurrenceAnnotations(GroovyEditor.java:1309)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$6.selectionChanged(JavaEditor.java:3392)
	at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:182)
	at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:158)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.IllegalStateException: Failed to resolve method node for org.apache.avro.SchemaBuilder.array
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.methodBindingToMethodNode(JDTClassNode.java:337)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initializeMembers(JDTClassNode.java:247)
	... 59 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 281
	at org.eclipse.jdt.internal.compiler.lookup.TypeSystem.getUnannotatedType(TypeSystem.java:227)
	at org.eclipse.jdt.internal.compiler.lookup.TypeSystem.getRawType(TypeSystem.java:346)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createRawType(LookupEnvironment.java:1411)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.convertToRawType(LookupEnvironment.java:888)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.toRawType(JDTClassNodeBuilder.java:351)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.configureParameterizedType(JDTClassNodeBuilder.java:227)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.configureType(JDTClassNodeBuilder.java:85)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.createJDTClassNode(JDTResolver.java:488)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.convertToClassNode(JDTResolver.java:457)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.methodBindingToMethodNode(JDTClassNode.java:317)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions