Bug 97268

Summary: [quick fix] "Create method" quick fix guesses wrong return type
Product: [Eclipse Project] JDT Reporter: David Saff <david>
Component: UIAssignee: Martin Aeschlimann <martinae>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Saff CLA 2005-05-30 10:36:25 EDT
Given code:

package dj.test;

import junit.framework.TestCase;

/**
 * @author avi
 */
public class CopyOfDjTests extends TestCase {
	public class Song {}

	public class Dj {}

	public void test00increasePlayCount() throws Exception {
		Dj dj = new Dj();
		Song song = new Song();
		assertEquals(0, dj.playCount(song));
	}
}

(With JUnit libraries imported).  The "create method" quick fix tries to
generate method "playCount" with return type "Object".  Originally, I blamed
autoboxing, but the same happens when 1.4 compliance is enabled.

The issue appears to be that assertEquals is overloaded in TestCase
Comment 1 Dirk Baeumer CLA 2005-05-31 06:08:38 EDT
For me not critical for 3.1.
Comment 2 Martin Aeschlimann CLA 2005-05-31 06:11:34 EDT

*** This bug has been marked as a duplicate of 69471 ***