harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Okomin (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2519) [classlib][awt] Compatibility: java.awt.RenderingHints(RenderingHints.Key key,Object o) throws unexpected IllegalArgumentException while RI doesn'
Date Thu, 07 Dec 2006 13:09:21 GMT
[classlib][awt] Compatibility: java.awt.RenderingHints(RenderingHints.Key key,Object o) throws
unexpected IllegalArgumentException while RI doesn'
--------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2519
                 URL: http://issues.apache.org/jira/browse/HARMONY-2519
             Project: Harmony
          Issue Type: Bug
          Components: Non-bug differences from RI
            Reporter: Ilya Okomin


Problem details:
There is no mention of IllegalArgumentException in the specification, but
java.awt.RenderingHints( RenderingHints.Key key,Object o) throws unexpected IllegalArgumentException
while RI does not.

Test for reproducing:
import junit.framework.TestCase;
import java.awt.*;

public class test extends TestCase {      
    public void test1 () {       
       new RenderingHints(RenderingHints.KEY_RENDERING,new
String("MyMessageDigest"));            
    }      
}
Output on Sun 1.5:
==================
.
Time: 0

OK (1 test)

Output on Harmony:
==================
.E
Time: 0
There was 1 error:
1) test1(test)java.lang.IllegalArgumentException
        at java.awt.RenderingHints.put(RenderingHints.java:98)
        at java.awt.RenderingHints.<init>(RenderingHints.java:89)
        at test.test1(test.java:6)
        at java.lang.reflect.VMReflection.invokeMethod(Native Method)

FAILURES!!!
Tests run: 1,  Failures: 0,  Errors: 1

I suggest to mark this case as non-bug difference. If you take a look at the put() method
description in RenderingHints class, spec says:
"Throws: IllegalArgumentException - value is not appropriate for the specified key.". I think
the same check should be implemented in the constructor as it is done in Harmony. IMO invalid
values for the rendering hints' keys don't make any sense.

-- 
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