You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ce...@apache.org on 2005/01/06 23:20:14 UTC
cvs commit: logging-log4j/src/java/org/apache/log4j/spi ComponentBase.java
ceki 2005/01/06 14:20:14
Modified: src/java/org/apache/log4j/spi ComponentBase.java
Log:
Let successive setLR() calls with the same LR proceed without throwing an exception.
Revision Changes Path
1.3 +4 -2 logging-log4j/src/java/org/apache/log4j/spi/ComponentBase.java
Index: ComponentBase.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/spi/ComponentBase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ComponentBase.java 4 Jan 2005 15:09:54 -0000 1.2
+++ ComponentBase.java 6 Jan 2005 22:20:14 -0000 1.3
@@ -28,7 +28,9 @@
public void setLoggerRepository(LoggerRepository repository) {
if(this.repository == null) {
this.repository = repository;
- } else {
+ } else if(this.repository == repository) {
+ // Nothing to do. Someone is trying to set the repository once again.
+ } else {
throw new IllegalStateException("Repository has been already set");
}
}
@@ -38,7 +40,7 @@
* This logger is not intended to be accessed by the end-user, hence the
* protected keyword.
*
- * <p>In case the repository for this components is not set,
+ * <p>In case the repository for this component is not set,
* this implementations returns a {@link SimpleLogger} instance.
*
* @return A ULogger instance.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org