-
Bug
-
Resolution: Fixed
-
P2
-
1.2.1, 1.4.2, 6
-
None
-
b86
-
generic, sparc
-
generic, solaris_2.6
overflow.
In earlier releases a few of the hit testing methods were upgraded to
perform their calculations in a way that avoids integer overflow. See
bugs 4280606, 4394562, 4394565, and 4394579 for more information on the
earlier overflow work.
This unfortunately leaves several of the other methods that modify the
rectangle still suffering from potential overflow conditions. Bug 4491273
was submitted to request a documentation update to reflect the overflow
possibilities, but it was decided by the engineering team to instead fix
as many of the overflow possibilities as could be fixed within the constraints
of the fact that the data is stored in exposed integer fields. The remaining
limits imposed by the 32-bit integer storage would then be documented. The
methods that are being modified are:
setRect(double, double, double, double)
translate(int, int)
union(Rectangle)
add(int, int)
add(Rectangle)
grow(int, int)
These methods need to store their results into a Rectangle object and so are
constrained in the final answer by the 32-bit integer range, but they can at
least protect against overflow during their intermediate calculations.
- duplicates
-
JDK-4911605 Rectangle methods should improve handling of overflow
-
- Closed
-
- relates to
-
JDK-4394562 awt.Rectangle.inside() method works incorrectly under overflow conditions
-
- Resolved
-
-
JDK-4280606 Massive row or column header in JScrollPane crashes VM
-
- Closed
-
-
JDK-4691305 Rectangle class does not describe how rectangles out of integer range are handle
-
- Closed
-
-
JDK-4491273 java.awt.Rectangle should explain the possible field overflow during calculation
-
- Resolved
-
-
JDK-4394565 awt.Rectangle.inside(int,int) method doesn't check whether rectangle is empty
-
- Resolved
-
-
JDK-4394579 awt.Rectangle.intersects()/contains() behave incorrectly at boundary conditions
-
- Resolved
-