[jdk8u-ri] RFR: 8332085: Remove 10 year old transition check in GenerateCurrencyData tool

Andrew John Hughes andrew at openjdk.org
Fri May 10 21:09:15 UTC 2024


On Fri, 10 May 2024 18:42:34 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> Fixing a build error on 8u-RI. The build tool that generates the currency data had a check that throws an exception if the transition date is more than 10 years away (past/future). The check does not seem meaningful. Removing the check will fix the issue.

The check has existed since OpenJDK's inception and still exists in trunk, so I can't find a reason as to why it was added. My presumption would be to enforce cleaning up the file regularly, but this seems to be happening anyway.  [JDK-8193552](https://github.com/openjdk/jdk/commit/069e4f80959b2c72f199cc9091ba3f9db3ecd82a) removed the problematic Latvia & Lithuania values causing the current trouble in 2018 and [JDK-8321480](https://github.com/openjdk/jdk/commit/8b24851b9d3619c41c7a6cdb9193ed26a9b732dc) just removed the Croatian one nine years before this check kicks in.

I'd be in favour of getting rid of the check if you also wanted to take this change to trunk, where it still exists. It seems likely the check will cause more trouble than the problem it is trying to solve. Having the "special case" currency values (all three values make it to the JDK data file and the choice is made at runtime) does mean having to do a date comparison that is avoidable, but I think a warning would suffice rather than breaking the build.

This is a good example of how such changes can take time to trickle down to all releases (if they ever do). I still remember being hit by this in 2014 with `TR=TRL;2004-12-31-22-00-00;TRY` still being present in some old releases. [JDK-
7077119](https://github.com/openjdk/jdk/commit/c24783568eecb0cee8d220d87e0500b24edc3032) removed some very old ones not long before they hit the ten year mark.

I think this is the best approach for the reference implementation, without altering the data at all.

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

Marked as reviewed by andrew (Reviewer).

PR Review: https://git.openjdk.org/jdk8u-ri/pull/17#pullrequestreview-2050878344


More information about the jdk8u-dev mailing list