Skip to content

Commit

Permalink
fix bug junit-team#235
Browse files Browse the repository at this point in the history
  • Loading branch information
ceki committed Oct 16, 2011
1 parent 5877ee7 commit 5d9e8c7
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
Expand Up @@ -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
Expand Down Expand Up @@ -64,6 +67,7 @@ public static Category getInstance(String name) {
return Log4jLoggerFactory.getLogger(name);
}


/**
* Returns the obvious.
*
Expand All @@ -73,6 +77,10 @@ public String getName() {
return name;
}

public Enumeration getAllAppenders() {
return NullEnumeration.getInstance();
}

/**
* Return the level in effect for this category/logger.
*
Expand Down
@@ -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();
}
}
7 changes: 7 additions & 0 deletions modules/slf4j/slf4j-site/src/site/pages/news.html
Expand Up @@ -38,6 +38,13 @@ <h3>???, 2011 - Release of SLF4J 1.6.3</h3>
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
Expand Down

0 comments on commit 5d9e8c7

Please sign in to comment.