RFR: 8153044: Allow a property to control location of tzdb.dat file
Looking to add a new implementation specific system property which would allow the user to specify the location of the tzdb.dat file. https://bugs.openjdk.java.net/browse/JDK-8153044 http://cr.openjdk.java.net/~coffeys/webrev.8153044/webrev/ -- Regards, Sean.
I won't block this change, but I remain unenthused. There are other ways to control the time-zone data, and since tzdb.dat is currently a private format file that is part of the internals of the JDK, it seems odd to be exposing it. Having the tzdb.dat as a versioned module that could be replaced, or linked in would, by contrast, be potentially very useful. Stephen On 7 July 2016 at 15:53, Seán Coffey <sean.coffey@oracle.com> wrote:
Looking to add a new implementation specific system property which would allow the user to specify the location of the tzdb.dat file.
https://bugs.openjdk.java.net/browse/JDK-8153044 http://cr.openjdk.java.net/~coffeys/webrev.8153044/webrev/
-- Regards, Sean.
2016/7/7 8:02:21 -0700, scolebourne@joda.org:
I won't block this change, but I remain unenthused. There are other ways to control the time-zone data, and since tzdb.dat is currently a private format file that is part of the internals of the JDK, it seems odd to be exposing it.
I agree. This is an internal implementation detail. If we define this system property then it becomes something we'll have to document and support, likely for a very long time. I suggest WNF.
Having the tzdb.dat as a versioned module that could be replaced, or linked in would, by contrast, be potentially very useful.
Hrm, now if we only had a module system ... - Mark
I'll (reluctantly) close this out then. I do think it was a convenient and low-maintenance feature that would allow end users the ability to bounce applications in an ordered fashion in order to pick up new tzdata rules. I'll investigate the upgradeable module approach. Regards, Sean. On 07/07/2016 16:37, mark.reinhold@oracle.com wrote:
2016/7/7 8:02:21 -0700, scolebourne@joda.org:
I won't block this change, but I remain unenthused. There are other ways to control the time-zone data, and since tzdb.dat is currently a private format file that is part of the internals of the JDK, it seems odd to be exposing it. I agree. This is an internal implementation detail. If we define this system property then it becomes something we'll have to document and support, likely for a very long time. I suggest WNF.
Having the tzdb.dat as a versioned module that could be replaced, or linked in would, by contrast, be potentially very useful. Hrm, now if we only had a module system ...
- Mark
Hi Sean, I think I would rename the property to "jdk.time.zone.tzdbfile" to reinforce it is captive to the zone implementation. Though the original code builds the path with string concatenation, I think it would be better to use java.nio.Paths.get() to build it. i.e. Paths.get(getProperty("java.home"), "lib", "tzdb.dat"). Also, for the property access in the case of a security manager, use sun.security.actions.GetPropertyAction.privilegedGetProperty. Perhaps rename 'pathToRules' to 'pathToTzdb' Thanks, Roger On 7/7/2016 10:53 AM, Seán Coffey wrote:
Looking to add a new implementation specific system property which would allow the user to specify the location of the tzdb.dat file.
https://bugs.openjdk.java.net/browse/JDK-8153044 http://cr.openjdk.java.net/~coffeys/webrev.8153044/webrev/
Thanks for the review Roger. As per other thread, I'm going to drop this feature for now. The TzdbZoneRulesProvider Object is already constructed in a doPrivileged block, so I believe it was covered on the security manager scenario. Regards, Sean. On 07/07/2016 16:32, Roger Riggs wrote:
Hi Sean,
I think I would rename the property to "jdk.time.zone.tzdbfile" to reinforce it is captive to the zone implementation.
Though the original code builds the path with string concatenation, I think it would be better to use java.nio.Paths.get() to build it. i.e. Paths.get(getProperty("java.home"), "lib", "tzdb.dat").
Also, for the property access in the case of a security manager, use sun.security.actions.GetPropertyAction.privilegedGetProperty.
Perhaps rename 'pathToRules' to 'pathToTzdb'
Thanks, Roger
On 7/7/2016 10:53 AM, Seán Coffey wrote:
Looking to add a new implementation specific system property which would allow the user to specify the location of the tzdb.dat file.
https://bugs.openjdk.java.net/browse/JDK-8153044 http://cr.openjdk.java.net/~coffeys/webrev.8153044/webrev/
participants (4)
-
mark.reinhold@oracle.com
-
Roger Riggs
-
Seán Coffey
-
Stephen Colebourne