-
Bug
-
Resolution: Fixed
-
P3
-
9
-
None
-
b61
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084662 | emb-9 | Laurent Bourgès | P3 | Resolved | Fixed | team |
JDK-8086927 | 8u65 | Philip Race | P3 | Resolved | Fixed | b01 |
JDK-8080794 | 8u60 | Philip Race | P3 | Resolved | Fixed | b18 |
JDK-8138196 | emb-8u65 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8086207 | emb-8u60 | Philip Race | P3 | Resolved | Fixed | team |
The copy constructors and clone method on the Path2D classes all set the internal arrays for the new objects to the size of the arrays for the source objects. Since the copies are typically done to save a path aside, or to return an "effectively immutable" answer from a method, the added room for growth is not needed - only the existing path segments need to be saved.
The waste is normally minor, but for a program that uses a single scratch path to accumulate paths of varying sizes and then clones or copies it as a return value, over time that scratch path may grow large, but the subsequent results it is calculating may be much smaller. The issue is that as the scratch path grows, so does the size of its result values - regardless of the complexity of the subsequent results.
The copy constructors should only create new arrays in the new paths large enough for the path segments already stored in the source path.
The waste is normally minor, but for a program that uses a single scratch path to accumulate paths of varying sizes and then clones or copies it as a return value, over time that scratch path may grow large, but the subsequent results it is calculating may be much smaller. The issue is that as the scratch path grows, so does the size of its result values - regardless of the complexity of the subsequent results.
The copy constructors should only create new arrays in the new paths large enough for the path segments already stored in the source path.
- backported by
-
JDK-8080794 Path2D copy constructors and clone method propagate size of arrays from source path
-
- Resolved
-
-
JDK-8084662 Path2D copy constructors and clone method propagate size of arrays from source path
-
- Resolved
-
-
JDK-8086207 Path2D copy constructors and clone method propagate size of arrays from source path
-
- Resolved
-
-
JDK-8086927 Path2D copy constructors and clone method propagate size of arrays from source path
-
- Resolved
-
-
JDK-8138196 Path2D copy constructors and clone method propagate size of arrays from source path
-
- Resolved
-