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

Naoto Sato naoto.sato at oracle.com
Mon Apr 24 15:51:50 UTC 2017


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.

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