[JDK 10] RFR: 8179222 SimpleConsoleLogger should protect against MissingResourceException

Daniel Fuchs daniel.fuchs at oracle.com
Mon Apr 24 16:10:57 UTC 2017


On 24/04/2017 16:51, Naoto Sato wrote:
> Hi Daniel,
>
> The change looks good to me. EmptyResourceBundle could just return null
> in handleGetObject(), and Collections.emptyEnumeration() in getKeys(),
> without having empty map field.

Thanks Naoto.

Updated webrev:
http://cr.openjdk.java.net/~dfuchs/webrev_8179222/webrev.01/index.html

-- daniel

>
> Naoto
>
> On 4/24/17 8:38 AM, Daniel Fuchs wrote:
>> Hi,
>>
>> Please find below a patch for:
>>
>> 8179222 SimpleConsoleLogger should protect against
>>         MissingResourceException
>> https://bugs.openjdk.java.net/browse/JDK-8179222
>>
>> webrev:
>> http://cr.openjdk.java.net/~dfuchs/webrev_8179222/webrev.00/
>>
>> java.util.logging Formatters will traditionally catch
>> MissingResourceException when invoking ResourceBundle::getString,
>> and use the original key string as message if a
>> MissingResourceException is thrown.
>>
>> The SimpleConsoleLogger however does not have this logic and will
>> throw a MissingResourceException in that case.
>> For the sake of uniformity it would be better if SimpleConsoleLogger
>> behaved in the same way that java.util.logging does, even though
>> there's currently no code in the JDK (that I know of) which might
>> trigger this issue.
>>
>> best regards,
>>
>> -- daniel



More information about the core-libs-dev mailing list