Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 13463 invoked from network); 22 Sep 2006 13:28:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Sep 2006 13:28:19 -0000 Received: (qmail 40936 invoked by uid 500); 22 Sep 2006 13:28:17 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 40811 invoked by uid 500); 22 Sep 2006 13:28:16 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 40783 invoked by uid 99); 22 Sep 2006 13:28:16 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Sep 2006 06:28:16 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:40173] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 99/EA-06791-DE4E3154 for ; Fri, 22 Sep 2006 06:28:14 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 71F604190CD for ; Fri, 22 Sep 2006 13:24:23 +0000 (GMT) Message-ID: <22348607.1158931463464.JavaMail.jira@brutus> Date: Fri, 22 Sep 2006 06:24:23 -0700 (PDT) From: "Ilya Okomin (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Updated: (HARMONY-1549) [classlib][awt]Compatibility: java.awt.Font.getMaxCharBounds() with null FontRenderContext returns bounds on Harmony and throws NPE on RI In-Reply-To: <16047317.1158931286167.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-1549?page=all ] Ilya Okomin updated HARMONY-1549: --------------------------------- Attachment: Harmony-1549.patch Harmony-1549-test.patch Please try fix and unit test. > [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 > 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