On Tue, 14 Sep 2021 18:11:00 GMT, Roger Riggs <rri...@openjdk.org> wrote:
> Since there is no longer a need to format an arbitrary date, I'd suggest > going back to the original Date.toString() code. It removes the need to > replicate the format using DateTimeBuilder and is known to be the same as > before. Done. I pushed an update to the PR which switches back to using Date.toString() for the date comment. It also does a minor adjustment to the javadoc to clarify this behaviour. > test/jdk/java/util/Properties/StoreReproducibilityTest.java line 429: > >> 427: try { >> 428: parsedDate = new >> SimpleDateFormat(dateCommentFormat).parse(dateComment); >> 429: } catch (ParseException pe) { > > Its slightly better to use the same date formatting and parsing APIs > consistently. > DateTimeFormatter.parse could be used here since DateTimeFormatter was used > above. > (Though the pattern uses "yyyy" instead of "uuuu" for the year.) Done. I've updated the tests to use a consistent API for parsing these date comments in the stored files. They now use the DateTimeFormatter APIs along with the right pattern ("uuuu") to match the output of Date.toString(). ------------- PR: https://git.openjdk.java.net/jdk/pull/5372