Summary: | StackOverflowError during completion | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Christopher G. Stach II <cstach-eclipse> | ||||||
Component: | Core | Assignee: | David Audel <david_audel> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | major | ||||||||
Priority: | P3 | CC: | daniel_megert | ||||||
Version: | 3.1 | ||||||||
Target Milestone: | 3.1 RC3 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Christopher G. Stach II
2005-06-15 16:32:43 EDT
The local type binding of entry has the following type: Entry#RAW[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] entry[pos: unused][id:1] This could easily provoque a StackOverFlowError. I will try to understand why we get this type binding. We have a bug in the assist parser where the dimension of the local entry is 235. The problem occurs because of the cast expression with a generic type. If you remove the generic type, it works. Here is a simpler test case: import java.util.Map; import java.util.Set; import java.util.Map.Entry; public class X { private void processProperties(Map map) { for (Entry entry : (Set<Entry>) map.entrySet()) { entry.<code assist> The problem is that according to where the code is located in the unit, this dimension will be too high and cause the StackOverFlowError. +1 for RC3 Dani: pls vote for it. Created attachment 23318 [details]
Proposed patch
Created attachment 23319 [details]
Regression test
position of '<' is in not correctly unstacked from intStack and Signature.appendArrayTypeSignature() should not use a recursive algorithm to append '['. +1 for 3.1 RC3 Fix released and tests added GenericsCompletionParserTest#test0202() -> test0203() Verified using build N20050616-0010 + JDT Core HEAD. Verified using N20050616-0010 + JDT/Core HEAD |