Fix currency-related build failure starting 12/31/2014
Naoto Sato
naoto.sato at oracle.com
Mon Jan 12 17:08:22 UTC 2015
Hi Chris,
Thank you for reporting this problem. We are aware of this issue and
will be fixed in the next update release.
Naoto
On 12/30/14, 1:16 PM, Chris Metcalf wrote:
> Our JDK 1.6 and 1.7 builds began failing today with the message "Error:
> time is more than 10 years from present: 1104530400000". At midnight
> Turkish time on Dec 31, 2004, the new Turkish lira (TRY) replaced the
> old lira (TRL) at 1,000,000:1. You may note that this was exactly 10
> years ago today.
>
> Some enterprising long-ago coder included a sanity test that all
> currency conversions happen within 10 years of the current moment, but
> clearly they must have meant "no more than 10 years into the future".
> To correct this, I remove the Math.abs() from the code in question.
>
> I admit to not being familiar with the bug submission and patch
> submission process for OpenJDK, but hopefully as a trivial fix there is
> no issue with copyright assignment or other technicalities. I just
> submit this in hope that it avoids more folks wasting their time on this
> issue.
>
> ---
> openjdk/jdk/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java
> 2014-12-30 20:49:40.000000000 -0500
> +++
> openjdk/jdk/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java
> 2014-12-30 20:49:40.000000000 -0500
> @@ -281,7 +281,7 @@
> checkCurrencyCode(newCurrency);
> String timeString = currencyInfo.substring(4, length - 4);
> long time = format.parse(timeString).getTime();
> - if (Math.abs(time - System.currentTimeMillis()) > ((long)
> 10) * 365 * 24 * 60 * 60 * 1000) {
> + if (time - System.currentTimeMillis() > ((long) 10) * 365 *
> 24 * 60 * 60 * 1000) {
> throw new RuntimeException("time is more than 10 years
> from present: " + time);
> }
> specialCaseCutOverTimes[specialCaseCount] = time;
>
More information about the build-dev
mailing list