-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.3.0
-
x86
-
linux
Name: kaC94536 Date: 04/19/2000
The following test shows that method DataFlavor.selectBestTextFlavor(DataFlavor a[]) always
returns the first array element instead of returning the best one.
import java.awt.datatransfer.*;
public class test {
public static void main(String args[]) throws Exception {
DataFlavor bestFlavorArray1[], bestFlavorArray2[];
DataFlavor bestFlavor1, bestFlavor2;
bestFlavorArray1 = new DataFlavor[2];
bestFlavorArray2 = new DataFlavor[2];
bestFlavorArray1[0] = DataFlavor.stringFlavor;
bestFlavorArray1[1] = new DataFlavor("text/plain; charset=us-ascii");
bestFlavorArray2[0] = bestFlavorArray1[1];
bestFlavorArray2[1] = bestFlavorArray1[0];
bestFlavor1 = DataFlavor.selectBestTextFlavor(bestFlavorArray1);
bestFlavor2 = DataFlavor.selectBestTextFlavor(bestFlavorArray2);
System.out.println("The Best Text Flavor is " + bestFlavor1);
System.out.println("The Best Text Flavor is " + bestFlavor2);
if(bestFlavor2.match(bestFlavor1)) {
System.out.println("The test is Passed");
} else {
System.out.println("The test is Failed");
}
}
}
======================================================================
======================================================================
- duplicates
-
JDK-4275210 selectBestFlavor is not returning the same dataflavor every time
- Closed