[threeten-dev] what happened to JapaneseChronology?

Masayoshi Okutsu masayoshi.okutsu at oracle.com
Sun Mar 17 21:26:58 PDT 2013


On 3/15/2013 11:52 PM, roger riggs wrote:
> Hi Patrick,
>
> The first official day of the SHOWA era is 1, 12, 29  (The month 
> numbering does not start at one.)

12-25 is the first day of Showa.

> Similarly, the first official day of TAISHO is 1, 7, 30.
>
> I don't know why the IllegalArgumentException does not have a 
> message.  (Masayoshi?)

Currently, private JapaneseDate.of calls the Japanese calendar 
implementation in a sun package to validate the given date. The sun 
package implementation returns true if the Japanese date is valid, or 
false otherwise. There's no information beyond an invalid date specified 
by the arguments. Do you think the method should report which parameters 
may be invalid? If so, could you file an issue for that? It's not simple 
to report invalid parameters due to some possibilities. For example, 
era, year, or month+day-of-month (outside of 12-25 to 12-31) may be 
wrong with Showa 1.01.01, and era, year, month, or month+day-of-month 
may be wrong with Taisho 1.01.01.

> I'm not sure why the tests started failing now unless the leniency 
> changes
> have made a difference; though the tests should have been fixed at the 
> same time.

My fix to the sun private Japanese calendar implementation for 
formatting may have affected?

Masayoshi

>
> It looks like a test bug.
>
> Thanks, Roger
>
>
>
> On 3/15/2013 4:30 AM, patrick zhang wrote:
>> Hi,
>>
>> Any suggestion for this problem?
>>
>> Regards
>> Patrick
>>
>> On 2013-3-13 12:37, Patrick Zhang wrote:
>>> Hi Team,
>>>
>>> What happened to JapaneseChronology? It will not support the later 2 
>>> eras? It looks it is one new failure and I do not meet it on last week.
>>> =============
>>> System.out.println(JapaneseChronology.INSTANCE.date(JapaneseEra.MEIJI, 
>>> 1, 1, 1));
>>> System.out.println(JapaneseChronology.INSTANCE.date(JapaneseEra.HEISEI, 
>>> 1, 1, 1));
>>> System.out.println(JapaneseChronology.INSTANCE.date(JapaneseEra.SEIREKI, 
>>> 1, 1, 1));
>>> System.out.println(JapaneseChronology.INSTANCE.date(JapaneseEra.SHOWA, 
>>> 1, 1, 1));       //will throw exception
>>> System.out.println(JapaneseChronology.INSTANCE.date(JapaneseEra.TAISHO, 
>>> 1, 1, 1));       //will throw exception
>>> ==============
>>>
>>> Exception info:
>>> ==============
>>> Exception in thread "main" java.lang.IllegalArgumentException
>>>     at java.time.chrono.JapaneseDate.of(JapaneseDate.java:256)
>>>     at 
>>> java.time.chrono.JapaneseChronology.date(JapaneseChronology.java:166)
>>>     at Test.f1(Test.java:17)
>>>     at Test.main(Test.java:5)
>>> ==============
>>>
>>> Regards
>>> Patrick
>>>
>>>
>



More information about the threeten-dev mailing list