You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ilya Okomin (JIRA)" <ji...@apache.org> on 2006/10/25 17:01:18 UTC
[jira] Commented: (HARMONY-1543) [classlib][awt]Compatibility:
awt.Font.getFamily(Locale) with null Locale returns family on Harmony and
throws NPE on RI
[ http://issues.apache.org/jira/browse/HARMONY-1543?page=comments#action_12444674 ]
Ilya Okomin commented on HARMONY-1543:
--------------------------------------
Thanks, Mikhail, patch works as expected.
> [classlib][awt]Compatibility: awt.Font.getFamily(Locale) with null Locale returns family on Harmony and throws NPE on RI
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-1543
> URL: http://issues.apache.org/jira/browse/HARMONY-1543
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Ilya Okomin
> Assigned To: Mikhail Loenko
> Priority: Minor
> Attachments: Harmony-1543-test.patch, Harmony-1543.patch
>
>
> awt.Font.getFamily(Locale) with null Locale parameter returns "Dialog" family name on Harmony and throws NPE on RI.
> Note: there is nothing said about Exceptions in the spec.
> Next test case passes on RI and fails on Harmony:
> ----------------test.java-------------------
> import java.awt.*;
> import java.awt.font.TextAttribute;
> import java.util.*;
> import junit.framework.TestCase;
> public class test extends TestCase {
> public static void main(String[] args) {
> junit.textui.TestRunner.run(test.class);
> }
> protected void setUp() throws Exception {
> super.setUp();
> }
>
> public void testRun() {
> try{
> Font fnt = Font.getFont((Map<? extends TextAttribute, ?>)Collections.EMPTY_MAP);
> System.out.println(fnt.getFamily(null));
> fail("NullPointerException expected!");
> } catch (NullPointerException e) {
> // expected
> }
> }
> }
> -----------------------------------------------
> Output RI:
> ===========================
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
> .
> Time: 0.15
> OK (1 test)
> Output Harmony:
> ===========================
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r431938, (Aug 16 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> .Dialog
> F
> Time: 0.37
> There was 1 failure:
> 1) testRun(test)junit.framework.AssertionFailedError: NullPointerException expected!
> at test.testRun(Test9741_1.java:23)
> at java.lang.reflect.VMReflection.invokeMethod()
> at test.main(Test9741_1.java:12)
> FAILURES!!!
> Tests run: 1, Failures: 1, Errors: 0
--
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