-
Bug
-
Resolution: Not an Issue
-
P2
-
None
-
1.1.6
-
sparc
-
generic
Although this problem was previously addressed by Bug #4090645, the analysis
was incorrect, and the bug was closed without a fix.
The documentation for BasicListUI states that a custom InputListener can be
returned by implementing the following code:
class MyListUI extends BasicListUI {
protected InputListener createInputListener() {
return new MyInputListener();
}
public class MyInputListener extends InputListener {
public void mouseMoved(MouseEvent e) {
// do some extra work when the mouse moves
super.mouseMoved(e);
}
}
}
When this code is compiled, this message is generated:
MyListUI.java:13: No constructor matching BasicListUI. InputListener(MyListUI) found in inner class BasicListUI. InputListener.
public class MyInputListener extends BasicListUI.InputListener {
In Bug #4090645 it was stated that the problem was a result of Bug #4087314, "protected inner classes are wrongly rejected in 'extends' clauses". Bug #4087314 was fixed in 1.2beta2. However, the same compiler message occurs
when compiling with 1.2beta3. Compiling with 1.2beta2 results in a core dump.
There are two workarounds for Bug #4087314. One is to put both classes in the same package, which is not practical when the inherited class is a Swing class.
The other workaround is to make the inherited class public. However, when
the code sample is compiled with a public BasicListUI.InputListener class,
the same result occurs. It seems clear then that the source of this bug is
not Bug #4087314, and that the problem needs to be re-investigated.
was incorrect, and the bug was closed without a fix.
The documentation for BasicListUI states that a custom InputListener can be
returned by implementing the following code:
class MyListUI extends BasicListUI {
protected InputListener createInputListener() {
return new MyInputListener();
}
public class MyInputListener extends InputListener {
public void mouseMoved(MouseEvent e) {
// do some extra work when the mouse moves
super.mouseMoved(e);
}
}
}
When this code is compiled, this message is generated:
MyListUI.java:13: No constructor matching BasicListUI. InputListener(MyListUI) found in inner class BasicListUI. InputListener.
public class MyInputListener extends BasicListUI.InputListener {
In Bug #4090645 it was stated that the problem was a result of Bug #4087314, "protected inner classes are wrongly rejected in 'extends' clauses". Bug #4087314 was fixed in 1.2beta2. However, the same compiler message occurs
when compiling with 1.2beta3. Compiling with 1.2beta2 results in a core dump.
There are two workarounds for Bug #4087314. One is to put both classes in the same package, which is not practical when the inherited class is a Swing class.
The other workaround is to make the inherited class public. However, when
the code sample is compiled with a public BasicListUI.InputListener class,
the same result occurs. It seems clear then that the source of this bug is
not Bug #4087314, and that the problem needs to be re-investigated.
- relates to
-
JDK-4090645 BasicListUI.InputListener can't be extended
-
- Closed
-
-
JDK-4087314 Protected inner classes are wrongly rejected in 'extends' clauses
-
- Closed
-