Return Type Issue in JDK1.5 [message #248104] |
Tue, 01 June 2004 17:26  |
Eclipse User |
|
|
|
Originally posted by: aaron.davies.knox.army.mil.invalid
I'm upgrading my code to use generics under JDK1.5 (using the latest
version of Cheetah), and I'm coming across an error that I have no idea
how to fix. I have a class that provides image previews to dialog boxes,
and its declaration is as follows:
public class ImagePreview extends JComponent implements
PropertyChangeListener
but when I try to compile it, I get "The return type is incompatible with
Container.getListeners(Class<T>), JComponent.getListeners(Class<T>)". This
appears to be some subtlety of generics that I don't quite get yet. Anyone
know what I need to do to fix this?
|
|
|
|
Re: Return Type Issue in JDK1.5 [message #248843 is a reply to message #248662] |
Thu, 03 June 2004 10:21  |
Eclipse User |
|
|
|
Originally posted by: aaron.davies.knox.army.mil.invalid
The problem is I have no idea what "return type" it's talking about! I
have three methods and a constructor in that class, and all the methods
return void. The class itself implements PropertyChangeListener, which
extends EventListener.
Per Klitgaard wrote:
> It looks like the return type needs to extend EventListener
> http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Component.h tml
> But there is also still some unfixed problems with generics in cheetah
> "Aaron Davies" <aaron.davies@knox.army.mil.invalid> wrote in message
> news:c9is99$t9g$1@eclipse.org...
> > I'm upgrading my code to use generics under JDK1.5 (using the latest
> > version of Cheetah), and I'm coming across an error that I have no idea
> > how to fix. I have a class that provides image previews to dialog boxes,
> > and its declaration is as follows:
> >
> > public class ImagePreview extends JComponent implements
> > PropertyChangeListener
> >
> > but when I try to compile it, I get "The return type is incompatible with
> > Container.getListeners(Class<T>), JComponent.getListeners(Class<T>)". This
> > appears to be some subtlety of generics that I don't quite get yet. Anyone
> > know what I need to do to fix this?
> >
|
|
|
Powered by
FUDForum. Page generated in 0.03765 seconds