-
CSR
-
Resolution: Approved
-
P3
-
None
-
source
-
minimal
-
In the unlikely event any external code has its own subclass of Path2D it will need to over-ride this abstract method.
-
Java API
-
SE
Summary
Add a new API to the abstract Path2D class and its concrete public nested subclasses to enable trimming the internal storage arrays to the currently needed size.
Problem
There are no public method to trim the arrays on an existing path object to just the needed size for long term storage. This would be useful when an object will be kept in a static state for a long time and the added storage that was created for potential growth will never be used.
Solution
Add a new API method as discussed above
Specification
Add this to the abstract class java.awt.geom.Path2D :-
/** * Trims the capacity of this Path2D instance to its current * size. An application can use this operation to minimize the * storage of a path. * * @since 10 */ public abstract void trimToSize();
Add over-rides in java.awt.geom.Path2D.Float and java.awt.geom.Path2D.Double :
@Override
public final void trimToSize();
- csr of
-
JDK-8186364 RFE: API for java.awt.geom.Path2D storage trimming
-
- Resolved
-