Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
None
-
None
-
None
Description
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 ()
}
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.
Attachments
Issue Links
- duplicates
-
HARMONY-2066 [classlib][awt] RenderingHints throws unexpected NPE
- Closed
- is duplicated by
-
HARMONY-2066 [classlib][awt] RenderingHints throws unexpected NPE
- Closed