Bug 212153 - stack overflow when press ctrl+space
Summary: stack overflow when press ctrl+space
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: 3.4 M5   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-06 11:01 EST by alexsaa CLA
Modified: 2008-02-05 04:26 EST (History)
1 user (show)

See Also:


Attachments
Proposed fix (2.72 KB, patch)
2008-01-04 06:12 EST, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description alexsaa CLA 2007-12-06 11:01:36 EST
Build ID: M20070921-1145

Steps To Reproduce:
1. create new Java project (e.g. with name 'simple')

2. create Xxx.java as follows:
--- begin ---
public class Xxx {
	static {
		new Object(){
			public boolean f(Object o) {
				if (o instanceof Yyy) {
					((Yyy<?, ?>)o).getZzz().//
				}
			}
		};
	}
}
--- end ---
(note 1: 'Yyy' and '.' will be marked as errors, it is ok)
(note 2: there is no need to have Yyy.java)

3. place Java editor cursor between '.' and '//' and press Ctrl+Space.

as a result, a 'stack overflow' messagebox comes and one can see in error log:

!ENTRY org.eclipse.ui 4 0 2007-12-06 15:15:14.553
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.StackOverflowError
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.convertToParameterizedType(LookupEnvironment.java:400)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.convertToParameterizedType(LookupEnvironment.java:407)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.convertToParameterizedType(LookupEnvironment.java:407)

More information:
The problem was found on Gentoo Linux x86.
Reproduced on some Windows with Eclipse SDK 3.3.0 Build id: I20070323-1616.
Comment 1 Olivier Thomann CLA 2007-12-06 11:44:38 EST
Reproduced with HEAD.
Comment 2 David Audel CLA 2008-01-04 06:12:54 EST
Created attachment 86176 [details]
Proposed fix
Comment 3 David Audel CLA 2008-01-04 06:22:53 EST
Released for 3.4M5

Test added
  Completion_1_5#test0338()
Comment 4 Frederic Fusier CLA 2008-02-05 04:26:47 EST
Verified for 3.4M5 using I20080204-0010 build.