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 16:59:18 UTC
[jira] Commented: (HARMONY-1546) [classlib][awt]Compatibility:
java.awt.Font.getFont() with null system property parameter throws NPE on
RI while doesn't on Harmony.
[ http://issues.apache.org/jira/browse/HARMONY-1546?page=comments#action_12444673 ]
Ilya Okomin commented on HARMONY-1546:
--------------------------------------
Thanks, Mikhail, patch applied as expected.
> [classlib][awt]Compatibility: java.awt.Font.getFont() with null system property parameter throws NPE on RI while doesn't on Harmony.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-1546
> URL: http://issues.apache.org/jira/browse/HARMONY-1546
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Ilya Okomin
> Assigned To: Mikhail Loenko
> Priority: Minor
> Attachments: Harmony-1546-test.patch, Harmony-1546.patch
>
>
> java.awt.Font.getFont(String nm) and java.awt.Font.getFont(String nm, Font font) with null system property parameter throws NPE on RI while doesn't on Harmony. Spec says: "Throws NullPointerException - if nm is null."
> Next test case passes on RI and fails on Harmony:
> ----------------------test.java-----------------------
> import java.awt.*;
> 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.getFont((String) null);
> fail("NullPointerException expected!");
> } catch (NullPointerException e) {
> // expected
> }
> try{
> Font.getFont((String) null, new Font("dialog", Font.PLAIN, 12));
> 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.241
> 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
> .F
> Time: 0.01
> There was 1 failure:
> 1) testRun(test)junit.framework.AssertionFailedError: NullPointerException expected!
> at test.testRun(test.java:19)
> at java.lang.reflect.VMReflection.invokeMethod()
> at test.main(test.java:9)
> 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