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

REGRESSION: NPE in selectBestTextFlavor() on win32

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      x86
    • OS:
      windows_nt

      Description

      Description: ###@###.###

      The following test reproduces the problem:
      --------------------------------------------------------
      import java.awt.datatransfer.DataFlavor;

      public class NPETest {

          public static void main(String[] args) {
              DataFlavor flavor1 = new DataFlavor("text/plain; charset=unicode; class=java.io.InputStream", "Flavor 1");
              DataFlavor flavor2 = new DataFlavor("text/plain; class=java.io.InputStream", "Flavor 2");
              DataFlavor[] flavors = new DataFlavor[] { flavor1, flavor2 };
              DataFlavor best = DataFlavor.selectBestTextFlavor(flavors);
              System.out.println("best=" + best);
          }
      }
      --------------------------------------------------------

      The test case throws the following exception:
      --------------------------------------------------------
      Z:\bug\newbug>K:\das\merlin\build\win32\bin\java NPETest
      Exception in thread "main" java.lang.NullPointerException
              at java.awt.datatransfer.DataFlavor.selectBestTextFlavor(DataFlavor.java:615)
              at NPETest.main(NPETest.java:9)
      --------------------------------------------------------

      This regression is introduced with the fix for 4275210.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              prssunw Prs Prs (Inactive)
              Reporter:
              prssunw Prs Prs (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: