JOptionPane.showInternalInputDialog() throws ClassCastException

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.2.0
    • Component/s: client-libs



      Name: skT88420 Date: 04/19/99


      Using the version of JOptionPane.showInternalInputDialog() that
      allows to specify selection values (selectionValues parameter)
      throws a ClassCastException if the Object[] array contains
      anything other than String objects.

      This is caused by the last line of that method, which casts the
      value selected by the user to a String before returning it.

      Obviously this is wrong as it is in contradiction with the
      documentation of the class, and it causes a behavior that is
      different than with JOptionPane.showInputDialog(), which works
      fine with any type of objects.

      ******** Test code included in the comments ********
      (Review ID: 54249)
      ======================================================================

            Assignee:
            Anne Fowler (Inactive)
            Reporter:
            Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: