ReviewRequest 8011172: JJSR 310: DateTime API Updates II,

Xueming Shen xueming.shen at
Mon Apr 8 19:51:50 UTC 2013


JSR 310 has continued to refine and update the java.time API.
Please help review the proposed changeset as showed in webrev:

In addition to general javadoc improvements, the changes include:


* Duration - added a static from(temporalAmount) method to simplify
   conversions from other amounts
* Renamed the toString(Formatter) method to format(Formatter) in all classes
* Period - added a static from(temporalAmount) method to simplify conversions
* ZoneId -
    - Added getAvailableZoneIds method, a simpler mechanism than going
      to the provider
    - Added normalized() method to ease conversion to a fixed offset
    - renamed predefined static fields of timezone names


* ChronoLocalDate, ChronoLocalDateTime, ChonoZonedDateTime
    - changed xxx_COMPARATORs to static methods returning the Time Line
      Order comparators
    - Added a from(TemporalAcessor) method to ease conversions
* Chronology
     - Added method to create a Date from EpochDay (And in each
       calendar subclass)
     - Added resolveDate to allow resolving date components by the Chronology
     - Serialization fixes
     - Replaced raw return types with wildcard type
* Era
     - Removed factory methods and getChronology - they did not work
       correctly in all cases
     - Declared Era as a functional interface
* Hijrah calendar variations -
     - Supporting the Umm alQura calendar
* Added HijrahEra, IsoEra, JapaneseEra, MinguEra, ThaiBuddhistEra
     making the enums public
* MinguoDate, ThaiBuddhistDate, HijrahDate - Added getEra method
   to return the concrete Era type.


* DateTimeFormatter -
     - Added fields for the predefined formatters
       (moved from DateTimeFormatters class)
     - Updated patterns to be CLDR compatible
     - Moved documentation for the pattern letters to the class javadoc
     - Added support for Zone default and conversion
* DateTimeFormatterBuilder
     - Updated documentation of patterns and corresponding equivalents
       to builder methods.
     - Added a method to append the localized offset.


* Adjusters - class removed; all static adjusters moved to static methods
   in TemporalAdjuster
* ChronoField -
     - Added getDisplayName - for locale specific field name
* Queries - class removed; all static query method moved to static methods
   in TemporalQuery
* TemporalField - added getDisplayName method
* UnsupportedTemporalTypeException - new subtype of DateTimeException
   to reflect no support for a unit or field
* WeekFields - Added fields for week and year of week-Based-Years to match
   CLDR fields "Y", "W"

More information about the core-libs-dev mailing list