You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2006/12/07 13:15:25 UTC

[jira] Updated: (HARMONY-1603) [classlib][awt] AffineTransform.transform(float[], int, float[], int, int) result deffers from RI if src and dst are the same array

     [ http://issues.apache.org/jira/browse/HARMONY-1603?page=all ]

Alexey Petrenko updated HARMONY-1603:
-------------------------------------

    Patch Info: [Patch Available]

> [classlib][awt] AffineTransform.transform(float[], int, float[], int, int) result deffers from RI if src and dst are the same array
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1603
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1603
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Attachments: HARMONY-1603-AffineTransform.patch, HARMONY-1603-AffineTransformTest.patch
>
>
> Harmony AffineTransform methods transform(float[], int, float[], int, int) and  transform(double[], int, double[], int, int) results differ from RI if src and dst are the same array and coordinate sections are overlapping.
> Harmony doesn't follow spec.
> ============ Spec =================
> Transforms an array of floating point coordinates by this transform. The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the specified offset in the order [x0, y0, x1, y1, ..., xn, yn]. 
> Transforms an array of double precision coordinates by this transform. The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the indicated offset in the order [x0, y0, x1, y1, ..., xn, yn]. 
> =============== Test.java =================
> import java.awt.geom.AffineTransform;
> import java.awt.geom.Point2D;
> public class Test {
>     static public void main(String[] args) { 
>         AffineTransform t = AffineTransform.getTranslateInstance(2, 3);
>         float[] points1 = new float[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
>         t.transform(points1, 0, points1, 4, 4);
>         for(int i = 0; i < points1.length; i++) {
>             System.out.print(points1[i] + ", ");
>         }
>         System.out.println();
>         
>         double[] points2 = new double[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
>         t.transform(points2, 0, points2, 4, 4);
>         for(int i = 0; i < points2.length; i++) {
>             System.out.print(points2[i] + ", ");
>         }        
>     }
> }
> ============= RI =================
> 1.0, 2.0, 3.0, 4.0, 3.0, 5.0, 5.0, 7.0, 7.0, 9.0, 9.0, 11.0, 13.0, 14.0, 
> 1.0, 2.0, 3.0, 4.0, 3.0, 5.0, 5.0, 7.0, 7.0, 9.0, 9.0, 11.0, 13.0, 14.0, 
> ======== Harmony ================
> 1.0, 2.0, 3.0, 4.0, 3.0, 5.0, 5.0, 7.0, 5.0, 8.0, 7.0, 10.0, 13.0, 14.0, 
> 1.0, 2.0, 3.0, 4.0, 3.0, 5.0, 5.0, 7.0, 5.0, 8.0, 7.0, 10.0, 13.0, 14.0, 

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