-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta
-
x86
-
windows_nt
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.
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.
- relates to
-
JDK-4275210 selectBestFlavor is not returning the same dataflavor every time
-
- Closed
-