Bug 72248 - [1.5] StackOverflowError caused by methods type variable
Summary: [1.5] StackOverflowError caused by methods type variable
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-19 07:42 EDT by David Audel CLA
Modified: 2004-09-22 09:01 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.