harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Okomin" <ilya.oko...@gmail.com>
Subject Re: [jira] Created: (HARMONY-1538) [classlib][awt] Successor of CubicCurve2D throws NPE in contains() if getBounds2D() returns null
Date Tue, 26 Sep 2006 09:27:18 GMT
I suggested to return false because spec says for Shape.getBounds2D()
method:
"Returns a high precision and more accurate bounding box of the Shape than
the getBounds method." and "Shape lies entirely within the indicated
Rectangle2D.". Method CubicCurve2D.contains() checks if specified coordinate
is inside the boundary of the shape. If point inside the shape it should be
inside the bounding box of this shape.
According to this, if the bounding box of the CubicCurve2D shape is null or
empty then there is not exist any point to be inside these bounds, hence
contains() just should return false.

Regards,
Ilya.


On 9/26/06, Denis Kishenko <dkishenko@gmail.com> wrote:
>
> 2006/9/25, Ilya Okomin <ilya.okomin@gmail.com>:
> > To follow RI I would suggest to add check (if the bounds2D is null) to
> the
> > contains() method, in this case just to return false.
> Yep, to follow RI we can check if the bounds2D is null but why you
> suggest return false? I think in this case we have to execute
> contains() but w/o optimization. It's the fourth possibility.
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
--
Ilya Okomin
Intel Middleware Products Division

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message