|
| 1 | +<?xml version="1.0" encoding="ISO-8859-1"?> |
| 2 | + |
| 3 | +<document> |
| 4 | + <properties> |
| 5 | + <title>Java date and time API - Upgrade from 2.4 to 2.5</title> |
| 6 | + <author>Stephen Colebourne</author> |
| 7 | + </properties> |
| 8 | + |
| 9 | +<body> |
| 10 | + |
| 11 | +<section name="Upgrade"> |
| 12 | +<p> |
| 13 | +These are the release notes and advice for upgrading Joda-Time from version 2.4 to version 2.5. |
| 14 | +<source> |
| 15 | +Joda-Time version 2.5 |
| 16 | +--------------------- |
| 17 | + |
| 18 | +Joda-Time is a date and time handling library that seeks to replace the JDK |
| 19 | +Date and Calendar classes. |
| 20 | + |
| 21 | +This release contains enhancements, bug fixes and a time zone update. |
| 22 | +The release runs on JDK 5 or later. |
| 23 | + |
| 24 | +Joda-Time is licensed under the business-friendly Apache License Version 2. |
| 25 | +This is the same license as all of Apache, plus other open source projects such as Spring. |
| 26 | +The intent is to make the code available to the Java community with the minimum |
| 27 | +of restrictions. If the license causes you problems please contact the mailing list. |
| 28 | + |
| 29 | +** Please also check out our related projects ** |
| 30 | +** http://www.joda.org/joda-time/related.html ** |
| 31 | + |
| 32 | + |
| 33 | +Enhancements since 2.4 |
| 34 | +---------------------- |
| 35 | +- Add regex based Period formatting [#166] |
| 36 | + Regex based formatting allows for languages with more complex rules, such as Polish |
| 37 | + |
| 38 | +- Add time-zone database version to manifest [#176, #183] |
| 39 | + The version is available as key 'Time-Zone-Database-Version' |
| 40 | + |
| 41 | + |
| 42 | +Compatibility with 2.4 |
| 43 | +---------------------- |
| 44 | +Build system - Yes |
| 45 | + |
| 46 | +Binary compatible - Yes |
| 47 | + |
| 48 | +Source compatible - Yes, except |
| 49 | + - The constant DateTimeZone.UTC has changed implementation type |
| 50 | + It used to be a FixedDateTimeZone, now it is a UTCDateTimeZone |
| 51 | + This avoids a potential deadlock scenario |
| 52 | + Serialization is unaffected |
| 53 | + This change will only be observable if you cast the UTC constant to FixedDateTimeZone |
| 54 | + |
| 55 | +Serialization compatible - Yes |
| 56 | + |
| 57 | +Data compatible - Yes, except |
| 58 | + - DateTimeZone data updated to version 2014h |
| 59 | + - Bug in time zone compilation fixed |
| 60 | + |
| 61 | +Semantic compatible - Yes, except |
| 62 | + - LocalDate.toDateTime(LocalTime) and LocalDate.toDateTime(LocalTime, DateTimeZone) |
| 63 | + If you pass a null LocalTime to the method, no changes have been made |
| 64 | + If you pass a non-null LocalTime then behaviour during daylight saving gap and overlap has changed |
| 65 | + During a daylight saving gap the exception has changed from IllegalFieldValueException to IllegalInstantException |
| 66 | + During a daylight saving overlap the earlier offset is selected |
| 67 | + Previously, the earlier offset was chosen east of Greenwich and the later offset west of Greenwich |
| 68 | + |
| 69 | + |
| 70 | +Deprecations since 2.4 |
| 71 | +---------------------- |
| 72 | + |
| 73 | + |
| 74 | +Bug fixes since 2.4 |
| 75 | +------------------- |
| 76 | +- Time zone compiler failed to correctly process 24:00 [#173, #182] |
| 77 | + This caused reported time to be wrong in Africa/Cairo (and possibly others) |
| 78 | + |
| 79 | +- Additional overflow check for Duration constructor [#159] |
| 80 | + Handle MIN/MAX value better. |
| 81 | + |
| 82 | +- Handle complex prefix/suffix combinations [#154, #169] |
| 83 | + For example, 'm' for minutes and 'ms' for milliseconds |
| 84 | + which both start with 'm' |
| 85 | + |
| 86 | +- Fix deadlock [#171] |
| 87 | + Referencing DateTimeZone and FixedDateTimeZone from two threads at startup could deadlock |
| 88 | + Add package scoped UTCDateTimeZone class to avoid this |
| 89 | + |
| 90 | +- Use of current time when converting from LocalDate [#177] |
| 91 | + LocalDate.toDateTime(LocalTime) and LocalDate.toDateTime(LocalTime, DateTimeZone) |
| 92 | + These methods used DateTimeUtils.currentTimeMillis() in all cases, rather than just when LocalTime was null |
| 93 | + Behaviour when LocalTiem is null has been left unchanged |
| 94 | + When LocalTime is non-null, it no longer uses DateTimeUtils.currentTimeMillis() |
| 95 | + This change resulted in the semantic change detailed above |
| 96 | + |
| 97 | + |
| 98 | +Scala |
| 99 | +-------- |
| 100 | +Joda-Time uses annotations from Joda-Convert. |
| 101 | +In the Java programming language, this dependency is optional, however in Scala it is not. |
| 102 | +Scala users must manually add the Joda-Convert v1.2 dependency. |
| 103 | +</source> |
| 104 | +</p> |
| 105 | +</section> |
| 106 | + |
| 107 | +</body> |
| 108 | +</document> |
0 commit comments