Bug 573601 - ArrayIndexOutOfBoundsException in AbstractMethodDeclaration.createArgumentBinding()
Summary: ArrayIndexOutOfBoundsException in AbstractMethodDeclaration.createArgumentBin...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2021-05-18 04:54 EDT by Robert Sermak CLA
Modified: 2023-05-31 16:59 EDT (History)
1 user (show)

See Also:


Attachments
variables (53.44 KB, image/png)
2021-05-18 04:54 EDT, Robert Sermak CLA
no flags Details
variables2 (62.50 KB, image/png)
2021-05-18 04:54 EDT, Robert Sermak CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Sermak CLA 2021-05-18 04:54:01 EDT
Created attachment 286408 [details]
variables

Hi,
happens on org.eclipse.jdt.core_3.23.100.v20201001-0636_JAVA15_PATCH.jar

We are using JDT stand-alone parser and occasionally from time to time, we got the following ArrayIndexOfOutBound exception when we try to get the binding key for a type.
Unfortunately, the problem is not easy to reproduce, but I just caught this issue on my debugger, and in the attachments, you may find the variables screenshots from IDE. Maybe you may find it helpful.  
One more thing we are processing the files in the parallel mode, so maybe there is some threads conflict while resolving the bindings? this could explain why it happens only from time to time. 


java.lang.ArrayIndexOutOfBoundsException: 0
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.createArgumentBindings(AbstractMethodDeclaration.java:113)
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.createArgumentBindings(AbstractMethodDeclaration.java:105)
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.createArgumentBindings(SourceTypeBinding.java:2869)
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesWithSuspendedTempErrorHandlingPolicy(SourceTypeBinding.java:2828)
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:2598)
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:2155)
org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.computeUniqueKey(TypeVariableBinding.java:387)
org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.computeUniqueKey(ParameterizedTypeBinding.java:372)
org.eclipse.jdt.internal.compiler.lookup.Binding.computeUniqueKey(Binding.java:136)
org.eclipse.jdt.core.dom.TypeBinding.getKey(TypeBinding.java:607)
Comment 1 Robert Sermak CLA 2021-05-18 04:54:23 EDT
Created attachment 286409 [details]
variables2
Comment 2 Manoj N Palat CLA 2021-05-19 06:33:18 EDT
Could you please attach a representative source code which causes the issue?
Comment 3 Robert Sermak CLA 2021-05-26 09:13:42 EDT
Hi Manoj,
Well, I afraid that I won't be able to prepare a simple example that could demonstrate the issue. Our system which uses the JDT parser is quite complicated and the bug occurs occasionally on different source files. 
Maybe in this case it will be possible just to protect the SourceTypeBinding or AbstractMethodDeclaration in a way that such exception will not be exposed?
Comment 4 Eclipse Genie CLA 2023-05-31 16:59:10 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.