Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4452129

UndoableEditSupport.getGetUndoableListeners throws ClassCastException

XMLWordPrintable

    • 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

      ======================================================================

            joutwatesunw Joshua Outwater (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: