harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-1603) [classlib][awt] AffineTransform.transform(float[], int, float[], int, int) result deffers from RI if src and dst are the same array
Date Thu, 25 Jun 2009 20:00:07 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Hindess closed HARMONY-1603.
---------------------------------


Closing as this works for me now.


> [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: https://issues.apache.org/jira/browse/HARMONY-1603
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>            Assignee: Alexey Petrenko
>         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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message