Bug 85675 - New Class wizard generates spurious method when legacy code inherits from Generic interface
Summary: New Class wizard generates spurious method when legacy code inherits from Gen...
Status: RESOLVED 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 M5   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-17 06:23 EST by Neil Bartlett CLA
Modified: 2005-02-17 10:25 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Bartlett CLA 2005-02-17 06:23:18 EST
Found in 3.1 M4

The best way to describe this problem is with an example. Create a plugin
project using Java 5.0 compliance and use the New Class wizard to create a
subclass of org.eclipse.core.runtime.jobs.Job, ensuring that the checkbox to
generate method stubs for inherited abstract methods is checked.

The wizard erroneously creates a method stub for the signature "public int
compareTo(T o)" from the Comparable<T> interface, from which Job indirectly
inherits. In fact this is not required because InternalJob is a legacy 1.4 class
which already supplies an implementation of compareTo(Object o). The generated
stub won't compile because "T" is not defined.

I think this would happen in any situation where we subclass from a pre-compiled
legacy (ie compiled against Java 1.4) API class which either directly or
indirectly inherits from a Generic interface.
Comment 1 Martin Aeschlimann CLA 2005-02-17 10:25:15 EST
that's fixed in M5