Bug 112109

Summary: Compilation problem: Eclipse does not recognise parametrized notify-method in generic context
Product: [Eclipse Project] JDT Reporter: Volker Renneberg <volker.renneberg.external>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.liu, mb
Version: 3.1.1   
Target Milestone: 3.1.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The test program none

Description Volker Renneberg CLA 2005-10-10 08:22:23 EDT
Hi!

The following piece of code compiles with Eclipse 3.1 and the Java compiler, 
but in Eclipse 3.1.1 it fails in the marked line. The list "list" is 
parametrized by a restricted generic parameter C. C has to derive 
from "Notifyble", an interface, that contains a parametrized notify-method. 
Explicit casting to "Notifyable" helps, but should not be necessary


import java.util.List;

public class NotifyMethodProblem {
    public static interface Notifyable {
        public Object notify(Object msg);
    }

    public static class InnerClass<C extends Notifyable> {
        private List<C> list;

        public InnerClass() {
            // *** Here: the notify-method is not available
            this.list.get(0).notify(null);

            // The following line compiles without problems.
            ((Notifyable) this.list.get(0)).notify(null);
        }
    }
}

Best regards
Volker
Comment 1 Volker Renneberg CLA 2005-10-10 08:23:33 EDT
Created attachment 28094 [details]
The test program
Comment 2 Kent Johnson CLA 2005-10-19 16:19:40 EDT
Added GenericTypeTest test853

Released into HEAD and 3.1.2 stream
Comment 3 Kent Johnson CLA 2005-10-24 14:45:19 EDT
*** Bug 113560 has been marked as a duplicate of this bug. ***
Comment 4 Olivier Thomann CLA 2005-10-25 20:33:46 EDT
*** Bug 113710 has been marked as a duplicate of this bug. ***
Comment 5 Philipe Mulet CLA 2005-10-26 07:44:16 EDT
reopening for setting owner
Comment 6 Philipe Mulet CLA 2005-10-26 07:44:44 EDT
closing (again)
Comment 7 Frederic Fusier CLA 2006-01-10 07:59:14 EST
Verified for 3.1.2 using build M20060109-1200.
Comment 8 Frederic Fusier CLA 2006-01-10 09:23:03 EST
Verified for 3.2 M4 using build I20051215-1506.