Community
Participate
Working Groups
private void processProperties(PropertiesList propertiesList) { Map map = propertiesList.getPropertyMap("MainMenu.button"); for (Map.Entry entry : (Set<Map.Entry>) map.entrySet()) { Button button = new Button(); button.setActionCommand((String) entry.()); map.getKey(); } } Hitting Ctrl-SP while between: 'entry.' and '());' generates this error. eclipse.buildId=I20050610-1757 java.version=1.5.0_03 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86 java.lang.StackOverflowError at org.eclipse.jdt.core.Signature.appendArrayTypeSignature(Signature.java:2393) at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:2333) at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:2282) at org.eclipse.jdt.core.Signature.appendArrayTypeSignature(Signature.java:2445) at org.eclipse.jdt.core.Signature.appendArrayTypeSignature(Signature.java:2393) at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:2333) at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:2282) at org.eclipse.jdt.core.Signature.appendArrayTypeSignature(Signature.java:2445) at org.eclipse.jdt.core.Signature.appendArrayTypeSignature(Signature.java:2393) at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:2333) at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:2282) at org.eclipse.jdt.core.Signature.appendArrayTypeSignature(Signature.java:2445) at org.eclipse.jdt.core.Signature.appendArrayTypeSignature(Signature.java:2393) [... ad nauseam ...]
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