[threeten-dev] what happened to JapaneseChronology?

roger riggs roger.riggs at oracle.com
Mon Mar 18 10:24:51 PDT 2013


Hi Masayoshi,

On 3/18/2013 12:26 AM, Masayoshi Okutsu wrote:
...
>>
>> 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.
It could have been implemented against the threeten range methods that 
should
produce the same valid/invalid result and have appropriate information 
to report.
In any case, the ValueRanges for the day should reflect the exact range 
of dates at
the beginning and end of the eras.  I don't know if there is a test for 
that.

BTW,  issue 272 DAY_OF_YEAR definition for non-ISO Chronology 
<https://github.com/ThreeTen/threeten/issues/272>
needs your concurrence to proceed.

Thanks, Roger


>
>> 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
>>>>
>>>>
>>
>

-- 
Thanks, Roger

Oracle Java Platform Group

Green Oracle <http://www.oracle.com/commitment> Oracle is committed to 
developing practices and products that help protect the environment



More information about the threeten-dev mailing list