harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1606) [classlib][awt] RI AffineTransform.transform(...) throws ArrayIndexOutOfBoundsException while Harmony doesn't
Date Wed, 27 Sep 2006 13:42:50 GMT
[classlib][awt] RI AffineTransform.transform(...) throws ArrayIndexOutOfBoundsException while
Harmony doesn't
-------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1606
                 URL: http://issues.apache.org/jira/browse/HARMONY-1606
             Project: Harmony
          Issue Type: Bug
          Components: Non-bug differences from RI
            Reporter: Denis Kishenko


RI implementation of AffineTransform of transform(float[], int, float[], int, int) and transform(double[],
int, double[], int, int) methods throws ArrayIndexOutOfBoundsException if offsets are out
of buffer bounds and number of points to transform is zero. Harmony doesn't throw any exception.
Spec doesn't say about any exceptions. 

As you see from stack trace RI call System.arraycopy(...) which throws exception because of
offset is really out of bounds. But Harmony implementation doesn't use System.arraycopy(...)
so we have difference in behavior.

=========== Test.java ===============
import java.awt.geom.AffineTransform;

public class Test {
    static public void main(String[] args) { 
        AffineTransform t = new AffineTransform();
        try {
            t.transform(new float[] {}, 1, new float[] {}, 2, 0);
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            t.transform(new double[] {}, 1, new double[] {}, 2, 0);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

========= RI =======================
java.lang.ArrayIndexOutOfBoundsException
    at java.lang.System.arraycopy(Ljava.lang.Object;ILjava.lang.Object;II)V(Unknown Source)
    at java.awt.geom.AffineTransform.transform(AffineTransform.java:2308)
    at Test.main(Test.java:10)
java.lang.ArrayIndexOutOfBoundsException
    at java.lang.System.arraycopy(Ljava.lang.Object;ILjava.lang.Object;II)V(Unknown Source)
    at java.awt.geom.AffineTransform.transform(AffineTransform.java:2421)
    at Test.main(Test.java:15)

======== Harmony ===============
nothing

-- 
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

        

Mime
View raw message