<i18n dev> RFR: 8261919: java/util/Locale/LocaleProvidersRun.java failed with "RuntimeException: Expected log was not emitted. LogRecord: null"

Naoto Sato naoto at openjdk.java.net
Tue Feb 23 18:42:41 UTC 2021


On Tue, 23 Feb 2021 09:49:47 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Please review the fix to this test case failure that occurs with the usage tracker enabled JRE.
>
> test/jdk/java/util/Locale/LocaleProviders.java line 416:
> 
>> 414:     // Set the root logger on loading the logging class
>> 415:     public static class LogConfig {
>> 416:         final static LogRecord[] lra = new LogRecord[1];
> 
> I would suggest to use some multi-thread safe container rather than a simple array to store the LogRecord. For instance - a CopyOnWriteArrayList - or something like that. Also you may want to harden the test by allowing for the possibility that some other logging might have occurred, and search the list for the record you expect rather than assuming it will be the first and only one.
> Otherwise looks good!

Thanks, Daniel. Will update the fix as you suggested.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2683


More information about the i18n-dev mailing list