-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
None
-
generic
-
generic
The Polygon class tries to save calculation time by keeping a Rectangle
object cached which represents the bounds of the points in the polygon.
Unfortunately, the getBoundingBox() method is implemented to return the
reference to this cached bounds object. Thus, if the caller modifies
the Rectangle they get back, they can corrupt the internal notion of the
bounds of the points. This will affect further calls to the hit testing
methods and getBounds().
object cached which represents the bounds of the points in the polygon.
Unfortunately, the getBoundingBox() method is implemented to return the
reference to this cached bounds object. Thus, if the caller modifies
the Rectangle they get back, they can corrupt the internal notion of the
bounds of the points. This will affect further calls to the hit testing
methods and getBounds().
- duplicates
-
JDK-4219023 Polygon.getBounds() returns not an object copy
-
- Resolved
-