Bug 108780 - [1.5][compiler] Subsignature checking does not respect erasure conversion
Summary: [1.5][compiler] Subsignature checking does not respect erasure conversion
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1.2   Edit
Assignee: Kent Johnson CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-05 05:55 EDT by Tom Hofmann CLA Friend
Modified: 2006-01-10 09:15 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Hofmann CLA Friend 2005-09-05 05:55:33 EDT
M20050831-1200, but also I20050830-0800

Consider below snippet.

---------- Sup1.java --------------
class Sup1<E> {
	E foo(E e) { // m2
		return null;
	}
}

class Sub1<T> extends Sup1<T> {
	@Override
	T foo(Object arg0) { // m1
		return null;
	}
}
---------------------------------

The eclipse compiler considers Sub1.foo to not override Sup1.foo. Javac and the
override indicator think it *does* override, due to JLS3 8.4.2: "The signature
of a method m1 is a subsignature of the signature of a method m2 if 
    m2 has the same signature as m1, or
    the signature of m1 is the same as the erasure of the signature of m2."

In this case, the erasure of m2 (Sup1.foo) is 'foo(Object)', which is the same
as the signature of m1.
Comment 1 Kent Johnson CLA Friend 2005-10-13 12:55:47 EDT
Added MethodVerifier test072

Released into HEAD and the 3.1.2 branch
Comment 2 Frederic Fusier CLA Friend 2006-01-10 07:51:25 EST
Verified for 3.1.2 using build M20060109-1200.
Comment 3 Frederic Fusier CLA Friend 2006-01-10 09:15:03 EST
Verified for 3.2 M4 using build I20051215-1506.