Bug 72248

Summary: [1.5] StackOverflowError caused by methods type variable
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Audel CLA 2004-08-19 07:42:55 EDT
build I20040817 + head
1) launch eclipse
2) open java perspective
3) create a java project P
4) create a class X.java
public class X {
  <T> T foo(){return null;}
}
5) close eclipse
6) relaunch

an exception occurs
java.lang.StackOverflowError
	at org.eclipse.jdt.core.dom.TypeBinding.isLocal(TypeBinding.java:301)
	at org.eclipse.jdt.core.dom.TypeBinding.getKey(TypeBinding.java:457)
	at org.eclipse.jdt.core.dom.MethodBinding.getKey
(MethodBinding.java:162)
	at org.eclipse.jdt.core.dom.TypeBinding.getKey(TypeBinding.java:512)
	at org.eclipse.jdt.core.dom.MethodBinding.getKey
(MethodBinding.java:162)
	at org.eclipse.jdt.core.dom.TypeBinding.getKey(TypeBinding.java:512)
	at org.eclipse.jdt.core.dom.MethodBinding.getKey
(MethodBinding.java:162)
	at ...
Comment 1 Olivier Thomann CLA 2004-08-19 14:27:12 EDT
getKey() should not be an infinite loop.
Comment 2 Olivier Thomann CLA 2004-08-19 15:39:48 EDT
I changed the getKey() of a type variable not to recursively call the getKey of
the  declaring element. I simply add the name of the declaring element instead.
I will review this with Jim when he is back from vacations.
Fixed and released in HEAD.
Regression test added.
Comment 3 David Audel CLA 2004-09-22 09:01:43 EDT
Verified in I200409212000.