Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Return Type Issue in JDK1.5
Return Type Issue in JDK1.5 [message #248104] Tue, 01 June 2004 17:26 Go to next message
Eclipse UserFriend
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 #248662 is a reply to message #248104] Thu, 03 June 2004 01:39 Go to previous messageGo to next message
Eclipse UserFriend
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?
>
Re: Return Type Issue in JDK1.5 [message #248843 is a reply to message #248662] Thu, 03 June 2004 10:21 Go to previous message
Eclipse UserFriend
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?
> >
Previous Topic:How to detemine if class is running within Eclipse?
Next Topic:New To Eclipse Plugins
Goto Forum:
  


Current Time: Mon Jun 02 17:57:08 EDT 2025

Powered by FUDForum. Page generated in 0.03765 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top