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] Updated: (HARMONY-1546) [classlib][awt]Compatibility: java.awt.Font.getFont() with null system property parameter throws NPE on RI while doesn't on Harmony.
Date Fri, 22 Sep 2006 12:56:23 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1546?page=all ]

Ilya Okomin updated HARMONY-1546:
---------------------------------

    Attachment: Harmony-1546.patch

Please try this patch.

> [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
>            Priority: Minor
>         Attachments: 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

        

Mime
View raw message