harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-1549) [classlib][awt]Compatibility: java.awt.Font.getMaxCharBounds() with null FontRenderContext returns bounds on Harmony and throws NPE on RI
Date Fri, 20 Oct 2006 11:43:37 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1549?page=all ]

Mikhail Loenko resolved HARMONY-1549.
-------------------------------------

    Resolution: Fixed

applied in revision 466074
Ilya please confirm that it works now

> [classlib][awt]Compatibility: java.awt.Font.getMaxCharBounds() with null FontRenderContext
returns bounds on Harmony and throws NPE on RI
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1549
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1549
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Mikhail Loenko
>            Priority: Minor
>         Attachments: Harmony-1549-test.patch, Harmony-1549.patch
>
>
> java.awt.Font.getMaxCharBounds() with null FontRenderContext returns bounds 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 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 font = Font.decode("dialog");
>             System.out.println(font.getMaxCharBounds(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.401
> 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 
> .java.awt.geom.Rectangle2D$Float[x=0.0,y=-12.064453,width=31.97461,height=14.701172]
> F
> Time: 0.41
> There was 1 failure:
> 1) testRun(test)junit.framework.AssertionFailedError: NullPointerException expected!
> 	at test.testRun(test.java:20)
> 	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