This method in JComboBox was giving compil

Project:JNode Core
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

This method in JComboBox was giving compilation errors when I compiled using Eclips 3.1.

public ActionListener[] getActionListeners()
{
return (ActionListener[]) getListeners(ActionListener.class);
}

The compiler complains that the getListeners method is ambiguous. A similar error is reported by Eclipse in other places.

The problem turns out to be that signature of the getListeners method is declared inconsistently. In most places it is a generic method, but in JComponent the method's signature is non-generic. The attached patch fixes this.

(The Eclipse compiler is probably being too picky, since JNode builds OK using the Java 6.0 compiler without the patch. However at the very least it is "bad style" for override method's signature to be inconsistent like this.)

AttachmentSize
issues_30683 bytes

#1

It was in the middle of classpath updates.
It's fixed now.

#2

#3