RFR: 8276220: Reduce excessive allocations in DateTimeFormatter [v7]

Claes Redestad redestad at openjdk.java.net
Wed Nov 3 18:13:18 UTC 2021


On Wed, 3 Nov 2021 17:33:36 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> Looks good. I'd create a new test case class out of `TestFractionPrinterParser`, as you introduced the new `NanosPrinterParser`.

It was only indirectly a test of `FractionPrinterParser`; it's really a test of `PrinterParsers` built using `appendFraction`, which can be either `FractionPrinterParser` or the new `NanosPrinterParser`. So the name is still somewhat appropriate. We could rename it, but splitting it apart seems excessive.

I realized though that with my changes the test coverage of `FractionPrinterParser` is substantially reduced, since most of the testing is done using `NANO_OF_SECOND`. I'm adding a set of tests using similar input for `MICRO_OF_SECOND` that will exercise `FractionPrinterParser`.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6188


More information about the core-libs-dev mailing list