harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-1477) Unexpected IAE from DataFlavor.isMimeTypeEqual method when parameter is empty string
Date Fri, 15 Sep 2006 14:37:23 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-1477?page=comments#action_12434993 ] 
            
Alexey Petrenko commented on HARMONY-1477:
------------------------------------------

Here is a test:

import java.awt.datatransfer.DataFlavor;

public class Harmony1477Test {
    public static void main(String argv[]) throws Exception {
        DataFlavor df = new DataFlavor();
        try {
            System.err.println("PASSED: "+df.equals(""));
        } catch (Throwable t) {
            System.err.println("FAILED!");
            t.printStackTrace();
        }
        try {
            System.err.println("PASSED: "+df.isMimeTypeEqual(""));
        } catch (Throwable t) {
            System.err.println("FAILED!");
            t.printStackTrace();
        }
    }
}

Output from RI:
PASSED: false
PASSED: false

Output from Harmony:
FAILED!
java.lang.IllegalArgumentException: Can't parse MIME type:
        at java.awt.datatransfer.DataFlavor.isMimeTypeEqual(DataFlavor.java:331)

        at java.awt.datatransfer.DataFlavor.equals(DataFlavor.java:424)
        at Harmony1477Test.main(Harmony1477Test.java:7)
FAILED!
java.lang.IllegalArgumentException: Can't parse MIME type:
        at java.awt.datatransfer.DataFlavor.isMimeTypeEqual(DataFlavor.java:331)

        at Harmony1477Test.main(Harmony1477Test.java:13)


NB: DataFlavor.equals(String) method calls isMimeTypeEqual. So the cause of both failures
is the same.

> Unexpected IAE from DataFlavor.isMimeTypeEqual method when parameter is empty string
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1477
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1477
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey Petrenko
>
> Harmony throws unexpected IllegalArgumentException from java.awt.datatransfer.DataFlavor.isMimeTypeEqual
method when parameter is empty string. 
> RI does not throw exception in this case. Spec also does not require it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message