harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavlenko, Andrey A" <andrey.a.pavle...@intel.com>
Subject (HARMONY-1447) [classlib][awt] RI Polygon.add(int,int) throws exception after Polygon(new int[2], new int[2], 0)
Date Mon, 09 Apr 2007 14:46:48 GMT
According to the issue description I think it should be closed as
Non-bug differences from RI.
Any objections?


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 ====================
    at java.awt.Polygon.addPoint(Polygon.java:262)
    at Test.main(Test.java:8)

=========== Harmony ================

Andrey Pavlenko
Enterprise Solutions Software Division

View raw message