-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.1.8, 1.2.2
-
sparc
-
solaris_2.5
Name: mgC56079 Date: 05/17/99
Constructor doesn't work according to specification.
Specification for method DataFlavor(String, String) says:
------------------------------------------------------
Construct a DataFlavor that represents a MimeType
The returned DataFlavor will have the following characteristics:
If the mimeType is "application/x-java-serialized-object; class=<representation class>",
the result is the same as calling new DataFlavor(Class:forName(<representation class>)) as above
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following example demonstrates that result is not the same:
--------------Test.java
import java.awt.datatransfer.*;
public class Test {
public static void main(String[] argv) {
DataFlavor df1, df2;
try {
df1 = new DataFlavor("application/x-java-serialized-object; class=java.lang.String", "");
df2 = new DataFlavor(Class.forName("java.lang.String"), "");
System.out.println(df1.getRepresentationClass().toString());
System.out.println(df2.getRepresentationClass().toString());
} catch (ClassNotFoundException e) {
}
}
}
--------------Output
class java.io.InputStream
class java.lang.String
--------------
======================================================================