Bug 105829 - [refactoring] infer type arguments: StackOverflowError
Summary: [refactoring] infer type arguments: StackOverflowError
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Markus Keller CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-02 13:03 EDT by Adam Kiezun CLA Friend
Modified: 2005-09-02 08:47 EDT (History)
2 users (show)

See Also:


Attachments
Fix (2.01 KB, patch)
2005-08-17 05:57 EDT, Markus Keller CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA Friend 2005-08-02 13:03:38 EDT
3.1
public class A {
	void foo() {
		Vector v1= new Vector();
		Vector v2= new Vector();
		v2.add(v1);
		v1.add(v2);
	}
}

Caused by: java.lang.StackOverflowError
at
org.eclipse.jdt.internal.corext.refactoring.generics.ParametricStructureComputer.updateStructureOfIthParamFrom(ParametricStructureComputer.java:297)
at
org.eclipse.jdt.internal.corext.refactoring.generics.ParametricStructureComputer.updateStructureOfType(ParametricStructureComputer.java:400)
at
org.eclipse.jdt.internal.corext.refactoring.generics.ParametricStructureComputer.updateStructureOfIthParamFrom(ParametricStructureComputer.java:298)
at
org.eclipse.jdt.internal.corext.refactoring.generics.ParametricStructureComputer.updateStructureOfType(ParametricStructureComputer.java:400)
at
org.eclipse.jdt.internal.corext.refactoring.generics.ParametricStructureComputer.updateStructureOfIthParamFrom(ParametricStructureComputer.java:298)
at
org.eclipse.jdt.internal.corext.refactoring.generics.ParametricStructureComputer.updateStructureOfType(ParametricStructureComputer.java:400)
at
org.eclipse.jdt.internal.corext.refactoring.generics.ParametricStructureComputer.updateStructureOfIthParamFrom(ParametricStructureComputer.java:298)
at
org.eclipse.jdt.internal.corext.refactoring.generics.ParametricStructureComputer.updateStructureOfType(ParametricStructureComputer.java:400)
...
Comment 1 Dirk Baeumer CLA Friend 2005-08-02 13:37:38 EDT
Markus, how risky is a fix for 3.1.1 ?
Comment 2 Markus Keller CLA Friend 2005-08-17 05:57:03 EDT
Created attachment 26184 [details]
Fix

The patch extends the check for ...

	void foo() {
		Vector v1= new Vector();
		v1.add(v1);
	}

... to work with multi-level cycles, too.

The fix is low risk and just leaves v1 and v2 raw. I opt to put it into 3.1.1.
Comment 3 Dirk Baeumer CLA Friend 2005-08-17 13:54:29 EDT
Patch looks good to me.
Comment 4 Markus Keller CLA Friend 2005-08-26 08:59:16 EDT
Tobias, could you pleas have a look too?
Comment 5 Tobias Widmer CLA Friend 2005-08-26 10:33:02 EDT
Patch looks good, verified that performance regression is almost unnoticeable.

+1 for 3.1.1
Comment 6 Markus Keller CLA Friend 2005-08-26 11:11:01 EDT
Fixed in HEAD and 3.1.1 branch.
Comment 7 Dani Megert CLA Friend 2005-09-02 08:26:36 EDT
Start verification...
Comment 8 Dani Megert CLA Friend 2005-09-02 08:47:39 EDT
Verified using:
M20050831-1200 + the two plug-ins in
\\Rosenberg.zurich.ibm.com\public\t\jabiru\plugin-export\M20050831-1200.from20050902_1247

There's no stack overflow but I found the following strange behavior, see bug
108666 for details. Closing this one as verified.