fix bug #235
diff --git a/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java b/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java
index 876df39..2fd6ccf 100644
--- a/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java
+++ b/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java
@@ -16,11 +16,14 @@
package org.apache.log4j;
+import org.apache.log4j.helpers.NullEnumeration;
import org.slf4j.LoggerFactory;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
import org.slf4j.spi.LocationAwareLogger;
+import java.util.Enumeration;
+
/**
* <p>
* This class is a minimal implementation of the original
@@ -64,6 +67,7 @@
return Log4jLoggerFactory.getLogger(name);
}
+
/**
* Returns the obvious.
*
@@ -73,6 +77,10 @@
return name;
}
+ public Enumeration getAllAppenders() {
+ return NullEnumeration.getInstance();
+ }
+
/**
* Return the level in effect for this category/logger.
*
diff --git a/log4j-over-slf4j/src/main/java/org/apache/log4j/helpers/NullEnumeration.java b/log4j-over-slf4j/src/main/java/org/apache/log4j/helpers/NullEnumeration.java
new file mode 100644
index 0000000..ff0a9d4
--- /dev/null
+++ b/log4j-over-slf4j/src/main/java/org/apache/log4j/helpers/NullEnumeration.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.log4j.helpers;
+
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+/**
+ * An always-empty Enumerator.
+ *
+ * @author Anders Kristensen
+ * @since version 1.0
+ */
+public class NullEnumeration implements Enumeration {
+ private static final NullEnumeration instance = new NullEnumeration();
+
+ private NullEnumeration() {
+ }
+
+ public static NullEnumeration getInstance() {
+ return instance;
+ }
+
+ public boolean hasMoreElements() {
+ return false;
+ }
+
+ public Object nextElement() {
+ throw new NoSuchElementException();
+ }
+}
\ No newline at end of file
diff --git a/slf4j-site/src/site/pages/news.html b/slf4j-site/src/site/pages/news.html
index 99ddd76..8a14cb9 100644
--- a/slf4j-site/src/site/pages/news.html
+++ b/slf4j-site/src/site/pages/news.html
@@ -38,6 +38,13 @@
reported by Ralph Goers.
</p>
+ <p>In the log4j-over-slf4j module, added missing
+ <code>getAllAppenders</code>() method in <code>Category</code>
+ class. This fixes <a
+ href="http://bugzilla.slf4j.org/show_bug.cgi?id=235">bug #235</a>
+ reported by Anthony Whitford.
+ </p>
+
<h3>August 19th, 2011 - Release of SLF4J 1.6.2</h3>
<p>Fixed <a