Bug 25094 - Quickfix doesn't find correct type with overloaded methods
Summary: Quickfix doesn't find correct type with overloaded methods
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-19 07:53 EDT by Stefan Matthias Aust CLA
Modified: 2007-06-29 04:44 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 Stefan Matthias Aust CLA 2002-10-19 07:53:32 EDT
I'm using Eclipse M2.  With the code shown below, Qick fix generates a
"newMethod" with return type "String", not "boolean" as I had expected.  

public class C {
	public static void x(String s, boolean b) {}
	public static void x(boolean b) {}
	public void y() {
		x(newMethod());
	}
}

If you swap the "x" method implementations, it works as expected. If you use

	x(null, newMethod());
or
	x("damn", newMethod());
	

it works, but only if you don't swap the "x" implemenations. Otherwise, it will
generate a "void" method.
Comment 1 Martin Aeschlimann CLA 2002-10-21 03:33:43 EDT
It's the guessing algorithm in jdt.core that finds 'x()'.

I think it's a minor bug and would agree to close if the fix is not trivial.  
Comment 2 Stefan Matthias Aust CLA 2002-10-21 12:23:10 EDT
IMHO it's not a trivial bug if Quick Fix generates code which doesn't compile.
In that case, it's becoming a Quick Bug command instead...
Comment 3 Philipe Mulet CLA 2002-11-04 07:25:40 EST
A perfect heuristic isn't trivial. Deferring as nice to have.
Comment 4 David Audel CLA 2007-06-29 04:44:25 EDT
Reopen
Comment 5 David Audel CLA 2007-06-29 04:44:44 EDT
Cannot be reproduced with 3.3. Fixed in a previous build.