-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
None
-
1.3.0
-
sparc
-
solaris_2.5.1
Name: sdC67446 Date: 05/31/99
The method
public boolean equals(String mimeString)
of class java.awt.datatransfer.TextFlavor
ignores base mime type (primary mimetype + sub mimetype).
The JDK javadoc comment says:
--------------------------------------------------
/**
* Returns true if the MIME type is equal to the MIME type for
* this <code>TextFlavor</code>. The types are considered equal
* if the primary type, subtype, and charset parameter are all
* equal. Representation class and parameters other than charset
* are ignored. No default values are assumed.
*
*/
public boolean equals(String mimeString)
The test demonstrating the bug:
-----------------Test.java------------------------
import java.awt.datatransfer.*;
public class Test {
public static void main(String[] args) {
try {
TextFlavor tf = new TextFlavor("text/plain");
String mimeString = "whatever/youwant";
System.out.println(tf.equals(mimeString));
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NullPointerException e1) {
e1.printStackTrace();
}
};
}
---------Output-----------------------------------
true
--------------------------------------------------
======================================================================