[OpenJDK 2D-Dev] [10] RFR 8078192: Path2D storage trimming

Prahalad Kumar Narayanan prahalad.kumar.narayanan at oracle.com
Thu Apr 20 03:46:11 UTC 2017

Hello Laurent

The code changes look good.
    . The new method trimToSize effectively does the same operation (Arrays.copyOf) as done by the copy contructors.
    . The test file- Path2DCopyConstructor now tests after executing the methods pathObj.trimToSize and pathObj.clone

With regard to the text in Javadoc comments
    . I felt, the first line clearly explains the operation - 
               "Trims the capacity of this Path2D instance to its current size."
    . The immediate following line is redundant and may not be required - 
               "If the capacity .. is larger than its current size... "
    . The third line will be required till the end of the comments - 
               "An application can use ... minimize the storage of a path. ... since 10"
    . This is my observation. You could wait for other suggestions.

Btw, the copyright year should be changed to 2017 in both Path2D.java and the test file.
(Some use automation scripts that modify the year at the time of check-in. If so, kindly ignore the observation)

Have a good day

Prahalad N.


Message: 1
Date: Wed, 19 Apr 2017 08:49:33 +0200
From: Laurent Bourg?s <bourges.laurent at gmail.com>
To: "2d-dev at openjdk.java.net" <2d-dev at openjdk.java.net>, Phil Race
	<philip.race at oracle.com>,  Jim Graham <james.graham at oracle.com>, Iris
	Clark <iris.clark at oracle.com>
Subject: [OpenJDK 2D-Dev] [10] RFR 8078192: Path2D storage trimming
	<CAKjRUT7zQ=ZSqiQdbpdtOeCOSFoLVPzqHdvi-pXzsmwTgKRbDw at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"


Here is a first attempt to propose a Path2D patch (based on JDK10):

JBS: https://bugs.openjdk.java.net/browse/JDK-8078192

Please review the Path2D changes, notably the javadoc (english) and the modified Path2DCopyConstructor test which checks all public Path2D methods on concrete classes (Path2D.Float, Path2D.Double, GeneralPath) after calling path.trimToSize()


More information about the 2d-dev mailing list