-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta2
-
sparc
-
solaris_7
Name: sdR10048 Date: 04/28/2001
public UndoableEditListener[] javax.swing.undo.UndoableEditSupport getUndoableEditListeners()
throws ClassCastException if it has been invoked for the first time. See example:
--------------------------------------------------
[archer] ~/tmp
% java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b61)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b61, mixed mode)
[archer] ~/tmp
% cat test.java
import javax.swing.undo.*;
public class test {
public static void main(String[] args) {
(new UndoableEditSupport()).getUndoableEditListeners();
}
}
[archer] ~/tmp
% java test
Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object;
at javax.swing.undo.UndoableEditSupport.getUndoableEditListeners(UndoableEditSupport.java:78)
at test.main(test.java:5)
--------------------------------------------------
Javadoc says:
public UndoableEditListener[] getUndoableEditListeners()
Returns an array of all the UndoableEditListeners added
to this UndoableEditSupport with addUndoableEditListener().
Returns:
all of the UndoableEditListeners added or an empty
array if no listeners have been added
Since:
1.4
======================================================================