-
Bug
-
Resolution: Fixed
-
P3
-
1.3.0
-
beta
-
sparc
-
solaris_2.5.1
Name: sdC67446 Date: 06/30/99
The method
public boolean match(DataFlavor that)
throws undocumented NullPointerException if 'this' or 'that' has been
created with constructor DataFlavor().
The doc says:
--------------------------------------------------
public boolean match(DataFlavor that)
Two DataFlavors match if their primary types, subtypes, and
representation classes are all equal. Additionally, if the
primary type is "text", the charset parameter is also
considered. If either DataFlavor is is primary type "text", but
no charset is specified, the platform default charset is assumed
for that DataFlavor.
---------Test.java--------------------------------
import java.awt.datatransfer.*;
public class Test {
public static void main(String[] args) {
try {
DataFlavor df1 = new DataFlavor("application/postscript;class=java.awt.Component");
DataFlavor df2 = new DataFlavor();
try {
System.out.println(df1.match(df2));
} catch (NullPointerException e) {
System.out.println(e);
}
try {
System.out.println(df2.match(df1));
} catch (NullPointerException e) {
System.out.println(e);
}
} catch (ClassNotFoundException e1) {
System.out.println(e1);
}
}
}
---------Output-----------------------------------
java.lang.NullPointerException
java.lang.NullPointerException
--------------------------------------------------
======================================================================