[threeten-dev] RFR get properties from lib/calendars.properties

Roger Riggs Roger.Riggs at oracle.com
Thu Jan 24 06:36:51 PST 2013


Thanks for the update.  This looks fine.

My question/point was more whether a missing or corruption problem in the
calendars.properties configuration file should be considered fatal.

I understand your point to be that depending on how the caller is using
the properties, a corrupted Properties file might be not be fatal.
But either way I think it would be useful to log problems with the 
properties file.
But that can be handled by the caller.  As an internal method is doesn't 
matter much either way.

A second observation, this code uses a standard GetPropertyAction for
accessing the java.home property but is in a separate doPrivileged call.

Is that significant?  It would seem just as easy to put the 
System.getProperty in the
doPrivileged block that reads the file and save the overhead.  It 
doesn't seem
significant but if there is a recommended practice around security, I'll 
make a note.

Thanks, Roger


On 1/24/2013 12:02 AM, Masayoshi Okutsu wrote:
> I've change the exception handling so that you can expect "regular" 
> exceptions. I don't see much value to this change, though.
>
> Here's the new webrev.
>
> http://cr.openjdk.java.net/~okutsu/310/calendarprops/webrev.01/
>
> Thanks,
> Masayoshi
>
> On 1/24/2013 8:28 AM, Masayoshi Okutsu wrote:
>> During loading properties, it may throw either IOException or 
>> IllegalArgumentException. The caller should catch RuntimeException 
>> and get its Cause and determine what to do.
>>
>> Masayoshi
>>
>> On 1/23/2013 11:24 PM, Roger Riggs wrote:
>>> Hi,
>>>
>>> Thanks, this provides the function needed for Hijrah calendar 
>>> properties.
>>>
>>> In the rare case that there is an error in calendars.properties, 
>>> will the RuntimeException
>>> provide enough information to diagnose the problem?   Is this a case 
>>> where
>>> the error should be logged to the PlatformLogger?
>>> Perhaps the throw of the RuntimeException could include a message
>>> "Configuration error in calendars.properties".
>>>
>>> In some other cases, I have seen an InternalError thrown 
>>> (Currency.java).
>>>
>>> Thanks, Roger
>>>
>>>
>>>
>>> On 1/23/2013 3:30 AM, Masayoshi Okutsu wrote:
>>>> Per Roger's request, I've created a static method for getting a 
>>>> Properties from <java.home>/lib/calendars.properties. The plan is 
>>>> to put Hijrah calendar properties in the properties file.
>>>>
>>>> http://cr.openjdk.java.net/~okutsu/310/calendarprops/webrev.00/
>>>>
>>>> Thanks,
>>>> Masayoshi
>>>>
>>>
>>
>

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