You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2019/07/22 04:19:42 UTC
[GitHub] [logging-log4j2] emopers opened a new pull request #298:
Synchronize before looping over synchronized collection
emopers opened a new pull request #298: Synchronize before looping over synchronized collection
URL: https://github.com/apache/logging-log4j2/pull/298
In StatusConfiguration.java, `errorMessages = Collections.synchronizedCollection(new LinkedList<String>())` is iterated over without synchronization. According to [Java API](https://docs.oracle.com/javase/6/docs/api/java/util/Collections.html#synchronizedCollection%28java.util.Collection%29), it is recommended that user manually synchronizes each iteration over the synchronized collection to reduce non-determinism.
This pull request improved the condition by synchronizing a loop which loops over the synchronized collection.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services