[threeten-dev] [threeten-develop] Public Eras changes

Stephen Colebourne scolebourne at joda.org
Fri Feb 22 02:38:17 PST 2013


- In HijrahEra, I'd prefer to see the of(int) method test for 1 using
if rather than switch. And the getValue() method return 1, rather than
ordinal+1.

- The import "import java.time.chrono.IsoEra" in IsoChronology looks wrong.

- The diff in ThaiBuddhistChronology looks all wrong around imports
and full class names.

Otherwise, the actual change itself looks good.


As separate changes:
- We should add JapaneseEra.values() and valueOf(String) so they match enums.

- We could/should add from(TemporalAccessor) static methods to each
era class. This would/could allow the removal of
ChronoLocalDate.getEra().

thanks
Stephen


On 21 February 2013 23:21, roger riggs <roger.riggs at oracle.com> wrote:
>
> Hi,
>
> Combining a number of issues related to  Eras:
>   - The methods on Era that created a date based on the Era are
>     problematic for the HijrahChronology were the Era was unaware
>     of the variants.  The methods Era.date(y,m,d) and Era.dateYearDay(y,d)
>     are removed.
>  - The Era.getChronology method is no longer necessary and has the
>     same problem for HijrahChronology of being unaware of the variants.
>  - Issue #261 proposed to expose the Eras as public enums and remove
>    the public static fields from the Chronologies.
>    (The JapaneseEra remains a class because of the unique need to be
>    able to define new Eras from supplied configuration data).
>
> Please review and comment:
>
> Webrev:
>    http://cr.openjdk.java.net/~rriggs/webrev-public-enum-eras/
>
> Javadoc:
>   http://cr.openjdk.java.net/~rriggs/javadoc-public-enum-eras/
>
> --
> Thanks, Roger
>
> Oracle Java Platform Group
>
> Oracle is committed to developing practices and products that help protect the environment
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> threeten-develop mailing list
> threeten-develop at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/threeten-develop
>


More information about the threeten-dev mailing list