|
| 1 | +<?xml version="1.0" encoding="ISO-8859-1"?> |
| 2 | + |
| 3 | +<document> |
| 4 | + <properties> |
| 5 | + <title>Java date and time API - Upgrade from 2.2 to 2.3</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.2 to version 2.3. |
| 14 | +<source> |
| 15 | +Joda-Time version 2.3 |
| 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.2 |
| 34 | +---------------------- |
| 35 | +- Interval/MutableInterval .isEqual() [#20] |
| 36 | + Add method to compare intervals ignoring the chronology |
| 37 | + https://github.com/JodaOrg/joda-time/issues/20 |
| 38 | + |
| 39 | +- Chronology classes now define equals methods [#36] |
| 40 | + Previously, the Chronology classes relied on caching in factory methods |
| 41 | + to guarantee instances were singletons |
| 42 | + Now, there are dedicated, normal, equals methods |
| 43 | + This will aid weird cases where deserialization or similar avoids the caches |
| 44 | + It will make no difference to most users |
| 45 | + |
| 46 | +- Maximum size for pattern cache [#49] |
| 47 | + Sets a maximum size for the cache to avoid memory issues |
| 48 | + |
| 49 | +- Add LocalDateTime.toDate(TimeZone) [#48] |
| 50 | + Provides an alternate way to create a java.util.Date that avoids some synchronization |
| 51 | + |
| 52 | +- Home page moved |
| 53 | + http://www.joda.org/joda-time |
| 54 | + |
| 55 | + |
| 56 | +Compatibility with 2.2 |
| 57 | +---------------------- |
| 58 | +Build system - Yes |
| 59 | + |
| 60 | +Binary compatible - Yes |
| 61 | + |
| 62 | +Source compatible - Yes |
| 63 | + |
| 64 | +Serialization compatible - Yes |
| 65 | + |
| 66 | +Data compatible - Yes, except |
| 67 | + - DateTimeZone data updated to version 2013d |
| 68 | + |
| 69 | +Semantic compatible - Yes, except |
| 70 | + - DateTimeZone is now limited to offsets from -23:59:59.999 to +23:59:59.999 |
| 71 | + |
| 72 | + - BasicChronology now defines an equals method |
| 73 | + This which would affect you if you subclassed it (unlikely) |
| 74 | + |
| 75 | + - GJChronology now has a minimum cutover instant of 0001-01-01 (Gregorian) |
| 76 | + Its unlikely you have it set earlier than this |
| 77 | + If you did your code was broken anyway |
| 78 | + |
| 79 | + |
| 80 | +Deprecations since 2.2 |
| 81 | +---------------------- |
| 82 | +- DateMidnight [#41] |
| 83 | + This class is flawed in concept |
| 84 | + The time of midnight occasionally does not occur in some time-zones |
| 85 | + This is a result of a daylight savings time from 00:00 to 01:00 |
| 86 | + DateMidnight is essentially a DateTime with a time locked to midnight |
| 87 | + Such a concept is more generally a poor one to use, given LocalDate |
| 88 | + Replace DateMidnight with LocalDate |
| 89 | + Or replace it with DateTime, perhaps using the withTimeAtStartOfDay() method |
| 90 | + |
| 91 | + |
| 92 | +Bug fixes since 2.2 |
| 93 | +------------------- |
| 94 | +- ZoneInfoCompiler and DateTimeZoneBuilder multi-threading [#18] |
| 95 | + A thread local variable was previously only initialised in one thread causing NPE |
| 96 | + https://github.com/JodaOrg/joda-time/issues/18 |
| 97 | + |
| 98 | +- Short time-zone name parsing failed to match the longest name |
| 99 | + This affected two short names where one is a short form of the second such as "UT" and "UTC" |
| 100 | + |
| 101 | +- Days.daysBetween fails for MonthDay [#22] |
| 102 | + Incorrect calculation around leap years |
| 103 | + |
| 104 | +- DateTimeZone failed to validate offsets [#43] |
| 105 | + Previously, there was little validation, resulting in the ability to create large offsets |
| 106 | + Those offsets could fail in other parts of the library |
| 107 | + Now, it is limited to -23:59:59.999 to +23:59:59.999 |
| 108 | + |
| 109 | +- DateTimeZone.forOffsetHoursMinutes failed to allow offsets from -00:01 to -00:59 [#42] |
| 110 | + The forOffsetHoursMinutes() method could not create an offset from -00:01 to -00:59 |
| 111 | + This was due to an inappropriate design |
| 112 | + A backwards compatible change to the input handling has been made |
| 113 | + forOffsetHoursMinutes(0, -15) now creates -00:15 |
| 114 | + |
| 115 | +- DateTimeFormatter.parseInto [#21] |
| 116 | + Fix parseInto() where it obtains the default year for parsing from the ReadWritableInstant |
| 117 | + Previously, the wrong year could be obtained at the start or end of the year in non UTC zones |
| 118 | + Now obtains the year from the ReadWritableInstant using the chronology of the ReadWritableInstant |
| 119 | + |
| 120 | +- Better thread-safety in ISODateTimeFormat [#45] |
| 121 | + |
| 122 | +- Fix GJChronology.plus/minus across cutover and year zero [#28] |
| 123 | + When subtracting a number of years from a date in the GJChronology there are two considerations |
| 124 | + The cutover date might be crossed, and year zero might be crossed (there is no year zero in GJ) |
| 125 | + Previously, each were handled separately, but not together. Now it is fixed |
| 126 | + As part of this change, the minimum cutover instant was set to 0001-01-01 (Gregorian) |
| 127 | + |
| 128 | + |
| 129 | +Scala |
| 130 | +-------- |
| 131 | +Joda-Time uses annotations from Joda-Convert. |
| 132 | +In the Java programming language, this dependency is optional, however in Scala it is not. |
| 133 | +Scala users must manually add the Joda-Convert v1.2 dependency. |
| 134 | +</source> |
| 135 | +</p> |
| 136 | +</section> |
| 137 | + |
| 138 | +</body> |
| 139 | +</document> |
0 commit comments