
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SLF4J: Simple Logging Facade for Java". The branch, master has been updated via 6f819965012916a03ec7bffd6ddcb16164da94ec (commit) from e2f99d41724cde145e4e6baa71859dc7ccee2c80 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=6f819965012916a03ec7bffd6dd... http://github.com/ceki/slf4j/commit/6f819965012916a03ec7bffd6ddcb16164da94ec commit 6f819965012916a03ec7bffd6ddcb16164da94ec Author: Ceki Gulcu <ceki@qos.ch> Date: Sun Apr 4 22:03:41 2010 +0200 Fixed bug 175 by synchronizing access to the loggerNameList field. diff --git a/slf4j-api/src/main/java/org/slf4j/helpers/SubstituteLoggerFactory.java b/slf4j-api/src/main/java/org/slf4j/helpers/SubstituteLoggerFactory.java index bff6449..101a6a4 100644 --- a/slf4j-api/src/main/java/org/slf4j/helpers/SubstituteLoggerFactory.java +++ b/slf4j-api/src/main/java/org/slf4j/helpers/SubstituteLoggerFactory.java @@ -40,8 +40,8 @@ import org.slf4j.ILoggerFactory; import org.slf4j.Logger; /** - * SubstituteLoggerFactory is an trivial implementation of {@link - * ILoggerFactory} which always returns the unique instance of NOPLogger. + * SubstituteLoggerFactory is an trivial implementation of + * {@link ILoggerFactory} which always returns the unique instance of NOPLogger. * * <p> * It used as a temporary substitute for the real ILoggerFactory during its @@ -56,12 +56,18 @@ public class SubstituteLoggerFactory implements ILoggerFactory { final List loggerNameList = new ArrayList(); public Logger getLogger(String name) { - loggerNameList.add(name); + synchronized (loggerNameList) { + loggerNameList.add(name); + } return NOPLogger.NOP_LOGGER; } public List getLoggerNameList() { - return loggerNameList; + List copy = new ArrayList(); + synchronized (loggerNameList) { + copy.addAll(loggerNameList); + } + return copy; } } diff --git a/slf4j-site/src/site/pages/news.html b/slf4j-site/src/site/pages/news.html index 924333f..e37db4a 100644 --- a/slf4j-site/src/site/pages/news.html +++ b/slf4j-site/src/site/pages/news.html @@ -44,6 +44,9 @@ a bare-bones implementation of the <code>NDC</code> class in log4j-over-slf4j.</p> + <p>Fixed <a + href="http://bugzilla.slf4j.org/show_bug.cgi?id=175">bug 175</a> by + synchronizing access to the loggerNameList field.</p> <hr noshade="noshade" size="1"/> ----------------------------------------------------------------------- Summary of changes: .../org/slf4j/helpers/SubstituteLoggerFactory.java | 14 ++++++++++---- slf4j-site/src/site/pages/news.html | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) hooks/post-receive -- SLF4J: Simple Logging Facade for Java