You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by "Pavlenko, Andrey A" <an...@intel.com> on 2007/04/09 16:46:48 UTC

(HARMONY-1447) [classlib][awt] RI Polygon.add(int,int) throws exception after Polygon(new int[2], new int[2], 0)

According to the issue description I think it should be closed as
Non-bug differences from RI.
Any objections?


Description:

Spec doesn't say about any exceptions. Even if Polygon created with
empty point buffer (not null but zero length), method addPoint() should
reallocate buffer to append new point but RI throws
ArrayIndexOutOfBoundsException exception. Seems like RI bug.

================= Test.java ===================
import java.awt.*;

public class Test {
    static public void main(String[] args) {
// Polygon p = new Polygon(); it works
        Polygon p = new Polygon(new int[2], new int[2], 0);
        p.addPoint(1, 1);
    }
}

============= RI ====================
java.lang.ArrayIndexOutOfBoundsException
    at java.awt.Polygon.addPoint(Polygon.java:262)
    at Test.main(Test.java:8)

=========== Harmony ================
nothing
________________________________

Thanks
Andrey Pavlenko
Enterprise Solutions Software Division
 

Re: (HARMONY-1447) [classlib][awt] RI Polygon.add(int,int) throws exception after Polygon(new int[2], new int[2], 0)

Posted by Mikhail Fursov <mi...@gmail.com>.
Sorry, I think I didn't understand your initial statement correctly before.
I thought that both behaviours are allowed and we chose uncompatible one.

On 4/9/07, Pavlenko, Andrey A <an...@intel.com> wrote:
>
> Mikhail, I don't think RI behaves correctly here. According to the spec,
> this method should update bounds instead of throwing
> ArrayIndexOutOfBoundsException.
>
> -----Original Message-----
> From: Mikhail Fursov [mailto:mike.fursov@gmail.com]
> Sent: Monday, April 09, 2007 6:53 PM
> To: dev@harmony.apache.org
> Subject: Re: (HARMONY-1447) [classlib][awt] RI Polygon.add(int,int)
> throws exception after Polygon(new int[2], new int[2], 0)
>
> Are there any implementation problems to be compatible with RI here?
>
> On 4/9/07, Pavlenko, Andrey A <an...@intel.com> wrote:
> >
> > According to the issue description I think it should be closed as
> > Non-bug differences from RI.
> > Any objections?
> >
> >
> > Description:
> >
> > Spec doesn't say about any exceptions. Even if Polygon created with
> > empty point buffer (not null but zero length), method addPoint()
> should
> > reallocate buffer to append new point but RI throws
> > ArrayIndexOutOfBoundsException exception. Seems like RI bug.
> >
> > ================= Test.java ===================
> > import java.awt.*;
> >
> > public class Test {
> >     static public void main(String[] args) {
> > // Polygon p = new Polygon(); it works
> >         Polygon p = new Polygon(new int[2], new int[2], 0);
> >         p.addPoint(1, 1);
> >     }
> > }
> >
> > ============= RI ====================
> > java.lang.ArrayIndexOutOfBoundsException
> >     at java.awt.Polygon.addPoint(Polygon.java:262)
> >     at Test.main(Test.java:8)
> >
> > =========== Harmony ================
> > nothing
> > ________________________________
> >
> > Thanks
> > Andrey Pavlenko
> > Enterprise Solutions Software Division
> >
> >
>
>
> --
> Mikhail Fursov
>



-- 
Mikhail Fursov

RE: (HARMONY-1447) [classlib][awt] RI Polygon.add(int,int) throws exception after Polygon(new int[2], new int[2], 0)

Posted by "Pavlenko, Andrey A" <an...@intel.com>.
Mikhail, I don't think RI behaves correctly here. According to the spec,
this method should update bounds instead of throwing
ArrayIndexOutOfBoundsException.  

-----Original Message-----
From: Mikhail Fursov [mailto:mike.fursov@gmail.com] 
Sent: Monday, April 09, 2007 6:53 PM
To: dev@harmony.apache.org
Subject: Re: (HARMONY-1447) [classlib][awt] RI Polygon.add(int,int)
throws exception after Polygon(new int[2], new int[2], 0)

Are there any implementation problems to be compatible with RI here?

On 4/9/07, Pavlenko, Andrey A <an...@intel.com> wrote:
>
> According to the issue description I think it should be closed as
> Non-bug differences from RI.
> Any objections?
>
>
> Description:
>
> Spec doesn't say about any exceptions. Even if Polygon created with
> empty point buffer (not null but zero length), method addPoint()
should
> reallocate buffer to append new point but RI throws
> ArrayIndexOutOfBoundsException exception. Seems like RI bug.
>
> ================= Test.java ===================
> import java.awt.*;
>
> public class Test {
>     static public void main(String[] args) {
> // Polygon p = new Polygon(); it works
>         Polygon p = new Polygon(new int[2], new int[2], 0);
>         p.addPoint(1, 1);
>     }
> }
>
> ============= RI ====================
> java.lang.ArrayIndexOutOfBoundsException
>     at java.awt.Polygon.addPoint(Polygon.java:262)
>     at Test.main(Test.java:8)
>
> =========== Harmony ================
> nothing
> ________________________________
>
> Thanks
> Andrey Pavlenko
> Enterprise Solutions Software Division
>
>


-- 
Mikhail Fursov

Re: (HARMONY-1447) [classlib][awt] RI Polygon.add(int,int) throws exception after Polygon(new int[2], new int[2], 0)

Posted by Mikhail Fursov <mi...@gmail.com>.
Are there any implementation problems to be compatible with RI here?

On 4/9/07, Pavlenko, Andrey A <an...@intel.com> wrote:
>
> According to the issue description I think it should be closed as
> Non-bug differences from RI.
> Any objections?
>
>
> Description:
>
> Spec doesn't say about any exceptions. Even if Polygon created with
> empty point buffer (not null but zero length), method addPoint() should
> reallocate buffer to append new point but RI throws
> ArrayIndexOutOfBoundsException exception. Seems like RI bug.
>
> ================= Test.java ===================
> import java.awt.*;
>
> public class Test {
>     static public void main(String[] args) {
> // Polygon p = new Polygon(); it works
>         Polygon p = new Polygon(new int[2], new int[2], 0);
>         p.addPoint(1, 1);
>     }
> }
>
> ============= RI ====================
> java.lang.ArrayIndexOutOfBoundsException
>     at java.awt.Polygon.addPoint(Polygon.java:262)
>     at Test.main(Test.java:8)
>
> =========== Harmony ================
> nothing
> ________________________________
>
> Thanks
> Andrey Pavlenko
> Enterprise Solutions Software Division
>
>


-- 
Mikhail Fursov