Bug 68699 - [1.5] Problem extending JComponent
Summary: [1.5] Problem extending JComponent
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-26 20:39 EDT by Joan Puig CLA
Modified: 2005-01-11 11:03 EST (History)
0 users

See Also:


Attachments
error screenshot (149.20 KB, image/png)
2004-07-05 13:11 EDT, Joan Puig CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joan Puig CLA 2004-06-26 20:39:42 EDT
Eclipse marks the class name as having a problem: 
The return type is incompatible with Container.getListeners(Class<T>), 
 JComponent.getListeners(Class<T>)

Eclipse used to recognize compile and run everything well, but I changed the
preferences for Task Tags case sensitivity, and when it rebuild all my classes
that extended JComponent had this error

This code generates the problem, but it happens also with a bunch of classes
extending JComponent

package pete.pobjects;

import javax.swing.*;
import java.awt.*;

public class ColorPanel extends JComponent{
	private final Color bg;

	public ColorPanel() {
		bg = Color.WHITE;
	}
	
	public void paint(Graphics g) {
		g.setColor(bg);
		g.fillRect(0, 0, getWidth(), getHeight());
		g.dispose();
	}
}
Comment 1 Joan Puig CLA 2004-06-26 21:00:31 EDT
I have been playing around a little bit more, it seems that it depends on what
version of the virtual machine you use:

For Eclipse, I use 
Build id: 200406251208

Under this version it compiles just fine:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)

Under this version fails:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)
Comment 2 Kent Johnson CLA 2004-07-05 12:28:39 EDT
I tried with Eclipse 3.0 (with & without 1.5 Cheetah support) & build 1.5.0-
beta2-b51 and it worked fine - no errors.

Even changed the preference & it still didn't produce an error.
Comment 3 Joan Puig CLA 2004-07-05 13:10:24 EDT
That class (ColorPanel) and a bunch like it consistently causes errors when
compiled for the build 51. It seems like what causes this problem is a change in
the API from the RC2 to the mentioned build b51. I updated to version 0.0.6 of
the JDT 1.5 support and I still get the same errors. I will attach a screen shot
so you see what I am talking about

Sorry for my misleading bug description before, changing the Task Tag properties
seems to have nothing to do with it other than it triggered a full recompile.
Comment 4 Joan Puig CLA 2004-07-05 13:11:29 EDT
Created attachment 12967 [details]
error screenshot
Comment 5 Kent Johnson CLA 2004-07-05 14:09:45 EDT
How did you update to version 0.0.6?

Try deleting & reinstalling...
Comment 6 Kent Johnson CLA 2004-07-12 11:39:56 EDT
No response.

Closing since its not reproduceable on latest build.