Bug 123078 - [1.5][compiler] Problem inferring from #getClass() invocation
Summary: [1.5][compiler] Problem inferring from #getClass() invocation
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-09 04:57 EST by Philipe Mulet CLA
Modified: 2006-03-28 12:35 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 Philipe Mulet CLA 2006-01-09 04:57:01 EST
Eclipse 3.1 report bound mismatch on Enum_.java in
Retrotranslator(http://retrotranslator.sourceforge.net/), but it can be
compiled by SUN JDK.

Following is a simplified version to reproduce the bug.

public abstract class BoundMismatch<C extends BoundMismatch<C>> {
        public static <T extends BoundMismatch<T>> T getDefault(Class<T> clz){
                return null;
        }

        public Object getDefault(){
                return getDefault(getClass());
        }
}
Comment 1 Philipe Mulet CLA 2006-01-09 04:58:15 EST
PR reported originally by liuyehui@gmail.com in wrong bug report.
Comment 2 Philipe Mulet CLA 2006-01-09 04:59:47 EST
Problem comes from improper type adjustement for #getClass.
Instead of yielding Class<? extends X>, it provides: Class<? extends X<C>>
(which then gets captured).

It should convert to raw type X<C> into X.
Comment 3 Philipe Mulet CLA 2006-01-09 05:42:11 EST
Added GenericTypeTest#test884.
Backported to 3.1 maintenance.

Fixed both in 3.1.2 and 3.2 streams.
Comment 4 Olivier Thomann CLA 2006-01-09 11:20:17 EST
Verified for 3.1.2 in M20060109-0800.
Comment 5 Frederic Fusier CLA 2006-03-28 12:35:38 EST
It seems I missed this bug during 3.2 M5 verification process.
It's now done: Verified for 3.2 M5 using build I20060217-1115...