harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (HARMONY-1878) [classlib][awt] Point.setLocation(double, double) doesn't follow spec if x or y is larger/smaller than max/min integer value
Date Tue, 07 Nov 2006 10:58:53 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1878?page=all ]

Alexey Petrenko reassigned HARMONY-1878:
----------------------------------------

    Assignee: Alexey Petrenko

> [classlib][awt] Point.setLocation(double, double) doesn't follow spec if  x or y is larger/smaller
than max/min integer value
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1878
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1878
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Alexey Petrenko
>         Attachments: HARMONY-1878-Point.patch, HARMONY-1878-PointTest.patch
>
>
> Harmony implementation of Point.setLocation(double, double) doesn't reset too large or
small values as spec says.
> ============ Spec ============
> public void setLocation(double x, double y)
>    Sets the location of this point to the specified double coordinates. The double values
will be rounded to integer values. Any number smaller than 
>    Integer.MIN_VALUE will be reset to MIN_VALUE, and any number larger than Integer.MAX_VALUE
will be reset to MAX_VALUE. 
> ============ Test ===============
> import java.awt.*;
> public class Test {
>     static public void main(String[] args) {
>         Point p = new Point();
>         double x = (double)Integer.MAX_VALUE + (double)1;
>         double y = (double)Integer.MIN_VALUE - (double)1;
>         System.out.println(Integer.MAX_VALUE + " " + Integer.MIN_VALUE);
>         p.setLocation(x, y);
>         System.out.println(p);
>         p.setLocation(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY);
>         System.out.println(p);
>     }
> }
> ========== RI =================
> 2147483647 -2147483648
> java.awt.Point[x=2147483647,y=-2147483648]
> java.awt.Point[x=2147483647,y=-2147483648]
> =========== Harmony ==========
> 2147483647 -2147483648
> java.awt.Point[x=-2147483648,y=2147483647]
> java.awt.Point[x=-1,y=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

        

Mime
View raw message