Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 86312 invoked from network); 25 Sep 2006 12:44:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Sep 2006 12:44:46 -0000 Received: (qmail 9549 invoked by uid 500); 25 Sep 2006 12:44:46 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 9513 invoked by uid 500); 25 Sep 2006 12:44:45 -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 9502 invoked by uid 99); 25 Sep 2006 12:44:45 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Sep 2006 05:44:45 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:59822] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 5E/36-13750-93FC7154 for ; Mon, 25 Sep 2006 05:44:42 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DCF79714293 for ; Mon, 25 Sep 2006 12:40:51 +0000 (GMT) Message-ID: <14076899.1159188051902.JavaMail.jira@brutus> Date: Mon, 25 Sep 2006 05:40:51 -0700 (PDT) From: "Denis Kishenko (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-1538) [classlib][awt] Successor of CubicCurve2D throws NPE in contains() if getBounds2D() returns null In-Reply-To: <11909665.1158920621785.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-1538?page=comments#action_12437538 ] Denis Kishenko commented on HARMONY-1538: ----------------------------------------- Reference to discussion http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200609.mbox/%3c834b3bd50609250457w38492bf4s4e2a52e038d03c9e@mail.gmail.com%3e > [classlib][awt] Successor of CubicCurve2D throws NPE in contains() if getBounds2D() returns null > ------------------------------------------------------------------------------------------------ > > Key: HARMONY-1538 > URL: http://issues.apache.org/jira/browse/HARMONY-1538 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Denis Kishenko > > If successor of CubicCurve2D returns null instead of bounds then Harmony throws NPE while RI doesn't. Harmony use shape bounds getBounds2D() to implement contains() and intersects() methods but It seems like RI doesn't use bounds for this. > ============== Test.java ================= > import java.awt.Frame; > import java.awt.Graphics; > import java.awt.Graphics2D; > import java.awt.geom.*; > public class Test { > static public void main(String[] args) { > final CubicCurve2DImpl obj = new CubicCurve2DImpl(100, 100, 200, 200, 200, 100, 100, 200); > > Frame f = new Frame("Test") { > public void paint(Graphics g) { > ((Graphics2D)g).draw(obj); > } > }; > f.setSize(600, 400); > f.show(); > > System.out.println("obj.contains="+obj.contains(0, 0)); > } > } > class CubicCurve2DImpl extends java.awt.geom.CubicCurve2D.Double { > public CubicCurve2DImpl(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { > super(x1, y1, x2, y2, x3, y3, x4, y4); > } > public Rectangle2D getBounds2D() { > return null; > } > } > ========= RI Output ========= > obj.contains=false > ======== Harmony output ===== > java.lang.NullPointerException > at org.apache.harmony.awt.gl.Crossing.crossShape(Crossing.java:506) > at java.awt.geom.CubicCurve2D.contains(CubicCurve2D.java:537) -- 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