Bug 112109 - Compilation problem: Eclipse does not recognise parametrized notify-method in generic context
Summary: Compilation problem: Eclipse does not recognise parametrized notify-method in...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 113560 113710 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-10 08:22 EDT by Volker Renneberg CLA
Modified: 2006-01-10 09:23 EST (History)
2 users (show)

See Also:


Attachments
The test program (467 bytes, text/plain)
2005-10-10 08:23 EDT, Volker Renneberg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.