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

The behavior of datatransfer.StringSelection.getTransferData has been changed

XMLWordPrintable

    • sparc
    • solaris_2.6



      Name: dsR10051 Date: 06/28/2000


      The behavior of the method
      java.awt.datatransfer.StringSelection.getTransferData(DataFlavor flavor)
      has been changed for null parameter.
      In this case it throws UnsupportedFlavorException in merlin and
      throws NullPointerException in kestrel.
      It is the JCK regression, test case
      api/java_awt/datatransfer/StringSelection/index.html#other
      (JCK kestrel-fcs), should be fixed as bug or documented as
      new feature.

      Here is a minimized test:
      import java.awt.datatransfer.*;

      public class StringSelectionTest {

          public static void main (String[] args) {
              StringSelection selection = new StringSelection("TEST");
              try {
                  selection.getTransferData((DataFlavor) null);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
      --- Output ---
      %/set/java/jdk1.3/solaris/bin/java StringSelectionTest
      java.lang.NullPointerException
              at java.awt.datatransfer.StringSelection.getTransferData(StringSelection.java:97)
              at StringSelectionTest.main(StringSelectionTest.java:8)
      %/set/java/jdk1.4/solaris/bin/java StringSelectionTest
      java.awt.datatransfer.UnsupportedFlavorException
              at java.awt.datatransfer.StringSelection.getTransferData(StringSelection.java:106)
              at StringSelectionTest.main(StringSelectionTest.java:8)

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

            shommel Scott Hommel (Inactive)
            sdasunw Sda Sda (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: