Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 92646 invoked from network); 18 Dec 2006 15:08:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Dec 2006 15:08:44 -0000 Received: (qmail 93580 invoked by uid 500); 18 Dec 2006 15:08:51 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 93560 invoked by uid 500); 18 Dec 2006 15:08:51 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 93549 invoked by uid 99); 18 Dec 2006 15:08:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Dec 2006 07:08:51 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Dec 2006 07:08:43 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 33FC7714289 for ; Mon, 18 Dec 2006 07:08:23 -0800 (PST) Message-ID: <15352462.1166454503210.JavaMail.jira@brutus> Date: Mon, 18 Dec 2006 07:08:23 -0800 (PST) From: "Alexey Petrenko (JIRA)" To: commits@harmony.apache.org Subject: [jira] Closed: (HARMONY-1595) [classlib][awt]Compatibility: java.awt.Font.getStringBounds() methods for null FontRenderContext returns bounds on Harmony and throws NPE on RI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/HARMONY-1595?page=all ] Alexey Petrenko closed HARMONY-1595. ------------------------------------ > [classlib][awt]Compatibility: java.awt.Font.getStringBounds() methods for null FontRenderContext returns bounds on Harmony and throws NPE on RI > ----------------------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-1595 > URL: http://issues.apache.org/jira/browse/HARMONY-1595 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Ilya Okomin > Assigned To: Alexey Petrenko > Priority: Minor > Attachments: Harmony-1595-test-upd.patch, Harmony-1595-test.patch, Harmony-1595-upd.patch, Harmony-1595.patch > > > java.awt.Font.getStringBounds() methods for null FontRenderContext returns bounds on Harmony and throws NPE on RI. > Spec says nothing about any exceptions for getStringBounds() methods. > You can check this running next test case: > -------------------test.java--------------------- > import junit.framework.TestCase; > import java.awt.Font; > import java.awt.font.FontRenderContext; > import java.text.StringCharacterIterator; > public class test extends TestCase { > public static void main(String[] args) { > junit.textui.TestRunner.run(test.class); > } > public void testRun() { > Font font = Font.decode("Arial"); > try { > font.getStringBounds(new char[] { 'a' }, 0, 1, > (FontRenderContext) null); > System.out.println("Fail: NullPointerException expected!"); > }catch (Exception e) { > if (e instanceof NullPointerException) { > System.out.println("Success: " + e); > } else { > System.out.println("Fail: " + e); > } > } > try { > font.getStringBounds(new StringCharacterIterator("a"), 0, 1, > (FontRenderContext) null); > System.out.println("Fail: NullPointerException expected!"); > }catch (Exception e) { > if (e instanceof NullPointerException) { > System.out.println("Success: " + e); > } else { > System.out.println("Fail: " + e); > } > } > > String str = "str"; > try { > font.getStringBounds(str, 0, 1, (FontRenderContext) null); > System.out.println("Fail: NullPointerException expected!"); > }catch (Exception e) { > if (e instanceof NullPointerException) { > System.out.println("Success: " + e); > } else { > System.out.println("Fail: " + e); > } > } > try { > font.getStringBounds(str, (FontRenderContext) null); > System.out.println("Fail: NullPointerException expected!"); > }catch (Exception e) { > if (e instanceof NullPointerException) { > System.out.println("Success: " + e); > } else { > System.out.println("Fail: " + e); > } > } > } > } > --------------------------------------------- > ====== Output RI ====== > .Success: java.lang.NullPointerException > Success: java.lang.NullPointerException > Success: java.lang.NullPointerException > Success: java.lang.NullPointerException > Time: 2.183 > OK (1 test) > ====== Output Harmony ======= > .Fail: NullPointerException expected! > Fail: NullPointerException expected! > Fail: NullPointerException expected! > Fail: NullPointerException expected! > Time: 0.36 > OK (1 test) > Don't pay attention to the successful test pass - compare only output. -- 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