[slf4j-dev] svn commit: r962 - in slf4j/trunk: . jcl104-over-slf4j osgi-over-slf4j slf4j-api slf4j-api/src/main/java/org/slf4j/helpers slf4j-api/src/test/java/org/slf4j slf4j-converter slf4j-jcl slf4j-jdk14 slf4j-log4j12 slf4j-nop slf4j-osgi-integration-test slf4j-osgi-test-bundle slf4j-simple slf4j-site slf4j-site/src/site/pages

ceki at slf4j.org ceki at slf4j.org
Thu Jan 31 14:15:27 CET 2008


Author: ceki
Date: Thu Jan 31 14:15:26 2008
New Revision: 962

Modified:
   slf4j/trunk/jcl104-over-slf4j/pom.xml
   slf4j/trunk/osgi-over-slf4j/pom.xml
   slf4j/trunk/pom.xml
   slf4j/trunk/slf4j-api/pom.xml
   slf4j/trunk/slf4j-api/src/main/java/org/slf4j/helpers/BasicMarker.java
   slf4j/trunk/slf4j-api/src/test/java/org/slf4j/BasicMarkerTest.java
   slf4j/trunk/slf4j-converter/pom.xml
   slf4j/trunk/slf4j-jcl/pom.xml
   slf4j/trunk/slf4j-jdk14/pom.xml
   slf4j/trunk/slf4j-log4j12/pom.xml
   slf4j/trunk/slf4j-nop/pom.xml
   slf4j/trunk/slf4j-osgi-integration-test/pom.xml
   slf4j/trunk/slf4j-osgi-test-bundle/pom.xml
   slf4j/trunk/slf4j-simple/pom.xml
   slf4j/trunk/slf4j-site/pom.xml
   slf4j/trunk/slf4j-site/src/site/pages/news.html

Log:
- setting current version number to 1.5.0-SNAPSHOT
- updated news.html

Modified: slf4j/trunk/jcl104-over-slf4j/pom.xml
==============================================================================
--- slf4j/trunk/jcl104-over-slf4j/pom.xml	(original)
+++ slf4j/trunk/jcl104-over-slf4j/pom.xml	Thu Jan 31 14:15:26 2008
@@ -3,7 +3,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    <version>1.5.0-M0</version>
+    <version>1.5.0-SNAPSHOT</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/osgi-over-slf4j/pom.xml
==============================================================================
--- slf4j/trunk/osgi-over-slf4j/pom.xml	(original)
+++ slf4j/trunk/osgi-over-slf4j/pom.xml	Thu Jan 31 14:15:26 2008
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-parent</artifactId>
-    <version>1.5.0-M0</version>
+    <version>1.5.0-SNAPSHOT</version>
   </parent>
   
   <modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/pom.xml
==============================================================================
--- slf4j/trunk/pom.xml	(original)
+++ slf4j/trunk/pom.xml	Thu Jan 31 14:15:26 2008
@@ -5,7 +5,7 @@
 
 	<groupId>org.slf4j</groupId>
 	<artifactId>slf4j-parent</artifactId>
-	<version>1.5.0-M0</version>
+	<version>1.5.0-SNAPSHOT</version>
 
 	<packaging>pom</packaging>
 	<name>SLF4J</name>
@@ -114,7 +114,6 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
         <configuration>
-          <destDir>/target/site/api</destDir>
         	<aggregate>true</aggregate>
 					<links>
 						<link>

Modified: slf4j/trunk/slf4j-api/pom.xml
==============================================================================
--- slf4j/trunk/slf4j-api/pom.xml	(original)
+++ slf4j/trunk/slf4j-api/pom.xml	Thu Jan 31 14:15:26 2008
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-parent</artifactId>
-    <version>1.5.0-M0</version>
+    <version>1.5.0-SNAPSHOT</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/slf4j-api/src/main/java/org/slf4j/helpers/BasicMarker.java
==============================================================================
--- slf4j/trunk/slf4j-api/src/main/java/org/slf4j/helpers/BasicMarker.java	(original)
+++ slf4j/trunk/slf4j-api/src/main/java/org/slf4j/helpers/BasicMarker.java	Thu Jan 31 14:15:26 2008
@@ -31,18 +31,19 @@
 
 import org.slf4j.Marker;
 
-
 /**
- * An almost trivial implementation of the {@link Marker} interface. 
- *
- * <p><code>BasicMarker</code> lets users specify marker
- * information. However, it does not offer any useful operations on
- * that information. 
- *
- * <p>Simple logging systems which ignore marker data, just return
- * instances of this class in order to conform to the SLF4J API.
- *
+ * An almost trivial implementation of the {@link Marker} interface.
+ * 
+ * <p>
+ * <code>BasicMarker</code> lets users specify marker information. However, it
+ * does not offer any useful operations on that information.
+ * 
+ * <p>
+ * Simple logging systems which ignore marker data, just return instances of
+ * this class in order to conform to the SLF4J API.
+ * 
  * @author Ceki G&uuml;lc&uuml;
+ * @author Joern Huxhorn
  */
 public class BasicMarker implements Marker {
 
@@ -50,7 +51,7 @@
 
   final String name;
   List children;
-  
+
   BasicMarker(String name) {
     this.name = name;
   }
@@ -62,12 +63,20 @@
   public synchronized void add(Marker child) {
     if (child == null) {
       throw new NullPointerException(
-        "Null children cannot be added to a Marker.");
+          "Null children cannot be added to a Marker.");
     }
     if (children == null) {
       children = new Vector();
     }
-    children.add(child);
+
+    // no point in adding the child multiple times
+    if (children.contains(child)) {
+      return;
+    } else {
+      // add the child
+      children.add(child);
+    }
+
   }
 
   public synchronized boolean hasChildren() {
@@ -90,53 +99,54 @@
     int size = children.size();
     for (int i = 0; i < size; i++) {
       Marker m = (Marker) children.get(i);
-      if( m == markerToRemove) {
-          return false;
+      if (m == markerToRemove) {
+        children.remove(i);
+        return true;
       }
     }
     // could not find markerToRemove
     return false;
   }
-  
+
   public boolean contains(Marker other) {
-    if(other == null) {
+    if (other == null) {
       throw new IllegalArgumentException("Other cannot be null");
     }
-    
-    if(this == other) {
+
+    if (this == other) {
       return true;
     }
-    
+
     if (hasChildren()) {
-      for(int i = 0; i < children.size(); i++) {
+      for (int i = 0; i < children.size(); i++) {
         Marker child = (Marker) children.get(i);
-        if(child.contains(other)) {
+        if (child.contains(other)) {
           return true;
         }
       }
     }
     return false;
   }
-  
+
   /**
    * This method is mainly used with Expression Evaluators.
    */
   public boolean contains(String name) {
-    if(name == null) {
+    if (name == null) {
       throw new IllegalArgumentException("Other cannot be null");
     }
-    
+
     if (this.name.equals(name)) {
       return true;
     }
-    
+
     if (hasChildren()) {
-      for(int i = 0; i < children.size(); i++) {
+      for (int i = 0; i < children.size(); i++) {
         Marker child = (Marker) children.get(i);
-        if(child.contains(name)) {
+        if (child.contains(name)) {
           return true;
         }
-      }     
+      }
     }
     return false;
   }
@@ -146,24 +156,24 @@
   private static String SEP = ", ";
 
   public String toString() {
-      
+
     if (!this.hasChildren()) {
       return this.getName();
     }
-    
+
     Iterator it = this.iterator();
     Marker child;
     StringBuffer sb = new StringBuffer(this.getName());
     sb.append(' ').append(OPEN);
-    while(it.hasNext()) {
-      child = (Marker)it.next();
+    while (it.hasNext()) {
+      child = (Marker) it.next();
       sb.append(child.getName());
       if (it.hasNext()) {
         sb.append(SEP);
       }
     }
     sb.append(CLOSE);
-      
-    return sb.toString();  
+
+    return sb.toString();
   }
 }

Modified: slf4j/trunk/slf4j-api/src/test/java/org/slf4j/BasicMarkerTest.java
==============================================================================
--- slf4j/trunk/slf4j-api/src/test/java/org/slf4j/BasicMarkerTest.java	(original)
+++ slf4j/trunk/slf4j-api/src/test/java/org/slf4j/BasicMarkerTest.java	Thu Jan 31 14:15:26 2008
@@ -32,13 +32,17 @@
  */
 package org.slf4j;
 
+import java.util.Iterator;
+
 import junit.framework.TestCase;
 
 import org.slf4j.helpers.BasicMarkerFactory;
 
-
 /**
- * @author ceki
+ * Unit test BasicMarker
+ * 
+ * @author Ceki G&uuml;lc&uuml;
+ * @author Joern Huxhorn
  */
 public class BasicMarkerTest extends TestCase {
   static final String BLUE_STR = "BLUE";
@@ -46,6 +50,8 @@
   static final String GREEN_STR = "GREEN";
   static final String COMP_STR = "COMP";
   static final String MULTI_COMP_STR = "MULTI_COMP";
+  static final String PARENT_MARKER_STR = "PARENT_MARKER";
+  static final String CHILD_MARKER_STR = "CHILD_MARKER";
   
   final IMarkerFactory factory;
   final Marker blue;
@@ -53,25 +59,25 @@
   final Marker green;
   final Marker comp;
   final Marker multiComp;
-  
+
   public BasicMarkerTest() {
     factory = new BasicMarkerFactory();
-    
+
     blue = factory.getMarker(BLUE_STR);
     red = factory.getMarker(RED_STR);
     green = factory.getMarker(GREEN_STR);
     comp = factory.getMarker(COMP_STR);
     comp.add(blue);
-    
+
     multiComp = factory.getMarker(MULTI_COMP_STR);
     multiComp.add(green);
     multiComp.add(comp);
-    
   }
+
   public void testPrimitive() {
     assertEquals(BLUE_STR, blue.getName());
     assertTrue(blue.contains(blue));
-    
+
     Marker blue2 = factory.getMarker(BLUE_STR);
     assertEquals(BLUE_STR, blue2.getName());
     assertEquals(blue, blue2);
@@ -82,17 +88,16 @@
   public void testPrimitiveByName() {
     assertTrue(blue.contains(BLUE_STR));
   }
- 
+
   public void testComposite() {
     assertTrue(comp.contains(comp));
     assertTrue(comp.contains(blue));
   }
-  
+
   public void testCompositeByName() {
     assertTrue(comp.contains(COMP_STR));
     assertTrue(comp.contains(BLUE_STR));
   }
- 
 
   public void testMultiComposite() {
     assertTrue(multiComp.contains(comp));
@@ -100,15 +105,46 @@
     assertTrue(multiComp.contains(green));
     assertFalse(multiComp.contains(red));
   }
-  
+
   public void testMultiCompositeByName() {
     assertTrue(multiComp.contains(COMP_STR));
     assertTrue(multiComp.contains(BLUE_STR));
     assertTrue(multiComp.contains(GREEN_STR));
     assertFalse(multiComp.contains(RED_STR));
   }
- 
- 
 
- 
+  public void testMultiAdd() {
+    Marker parent = factory.getMarker(PARENT_MARKER_STR);
+    Marker child = factory.getMarker(CHILD_MARKER_STR);
+    for (int i = 0; i < 10; i++) {
+      parent.add(child);
+    }
+    
+    // check that the child was added once and only once
+    Iterator iterator = parent.iterator();
+    assertTrue(iterator.hasNext());
+    assertEquals(CHILD_MARKER_STR, iterator.next().toString());
+    assertFalse(iterator.hasNext());
+  }
+
+  public void testAddRemove() {
+    final String NEW_PREFIX = "NEW_";
+    Marker parent = factory.getMarker(NEW_PREFIX + PARENT_MARKER_STR);
+    Marker child = factory.getMarker(NEW_PREFIX + CHILD_MARKER_STR);
+    assertFalse(parent.contains(child));
+    assertFalse(parent.contains(NEW_PREFIX + CHILD_MARKER_STR));
+    assertFalse(parent.remove(child));
+
+    parent.add(child);
+
+    assertTrue(parent.contains(child));
+    assertTrue(parent.contains(NEW_PREFIX + CHILD_MARKER_STR));
+
+    assertTrue(parent.remove(child));
+
+    assertFalse(parent.contains(child));
+    assertFalse(parent.contains(NEW_PREFIX + CHILD_MARKER_STR));
+    assertFalse(parent.remove(child));
+  }
+
 }

Modified: slf4j/trunk/slf4j-converter/pom.xml
==============================================================================
--- slf4j/trunk/slf4j-converter/pom.xml	(original)
+++ slf4j/trunk/slf4j-converter/pom.xml	Thu Jan 31 14:15:26 2008
@@ -7,7 +7,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
     <artifactId>slf4j-parent</artifactId>
-    <version>1.5.0-M0</version>
+    <version>1.5.0-SNAPSHOT</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/slf4j-jcl/pom.xml
==============================================================================
--- slf4j/trunk/slf4j-jcl/pom.xml	(original)
+++ slf4j/trunk/slf4j-jcl/pom.xml	Thu Jan 31 14:15:26 2008
@@ -3,7 +3,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-		<version>1.5.0-M0</version>
+		<version>1.5.0-SNAPSHOT</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/slf4j-jdk14/pom.xml
==============================================================================
--- slf4j/trunk/slf4j-jdk14/pom.xml	(original)
+++ slf4j/trunk/slf4j-jdk14/pom.xml	Thu Jan 31 14:15:26 2008
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    	<version>1.5.0-M0</version>
+    	<version>1.5.0-SNAPSHOT</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/slf4j-log4j12/pom.xml
==============================================================================
--- slf4j/trunk/slf4j-log4j12/pom.xml	(original)
+++ slf4j/trunk/slf4j-log4j12/pom.xml	Thu Jan 31 14:15:26 2008
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-        <version>1.5.0-M0</version>
+        <version>1.5.0-SNAPSHOT</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/slf4j-nop/pom.xml
==============================================================================
--- slf4j/trunk/slf4j-nop/pom.xml	(original)
+++ slf4j/trunk/slf4j-nop/pom.xml	Thu Jan 31 14:15:26 2008
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    	<version>1.5.0-M0</version>
+    	<version>1.5.0-SNAPSHOT</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/slf4j-osgi-integration-test/pom.xml
==============================================================================
--- slf4j/trunk/slf4j-osgi-integration-test/pom.xml	(original)
+++ slf4j/trunk/slf4j-osgi-integration-test/pom.xml	Thu Jan 31 14:15:26 2008
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-		<version>1.5.0-M0</version>
+		<version>1.5.0-SNAPSHOT</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/slf4j-osgi-test-bundle/pom.xml
==============================================================================
--- slf4j/trunk/slf4j-osgi-test-bundle/pom.xml	(original)
+++ slf4j/trunk/slf4j-osgi-test-bundle/pom.xml	Thu Jan 31 14:15:26 2008
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-		<version>1.5.0-M0</version>
+		<version>1.5.0-SNAPSHOT</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/slf4j-simple/pom.xml
==============================================================================
--- slf4j/trunk/slf4j-simple/pom.xml	(original)
+++ slf4j/trunk/slf4j-simple/pom.xml	Thu Jan 31 14:15:26 2008
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-parent</artifactId>
-    <version>1.5.0-M0</version>
+    <version>1.5.0-SNAPSHOT</version>
   </parent>
 	
 	<modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/slf4j-site/pom.xml
==============================================================================
--- slf4j/trunk/slf4j-site/pom.xml	(original)
+++ slf4j/trunk/slf4j-site/pom.xml	Thu Jan 31 14:15:26 2008
@@ -5,7 +5,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    <version>1.5.0-M0</version>
+    <version>1.5.0-SNAPSHOT</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>

Modified: slf4j/trunk/slf4j-site/src/site/pages/news.html
==============================================================================
--- slf4j/trunk/slf4j-site/src/site/pages/news.html	(original)
+++ slf4j/trunk/slf4j-site/src/site/pages/news.html	Thu Jan 31 14:15:26 2008
@@ -52,6 +52,27 @@
   the user if she uses SLF4J with a version of log4j earlier than 1.2.12.
   </p>
 
+  <p>Fixed <a href="http://bugzilla.slf4j.org/show_bug.cgi?id=65">bug
+  65</a> reported by Ben Gidley. Superfluous
+  &gt;vesion>$parent.version}&gt;/vesion> lines have been removed from
+  pom.xml files. These lines reportedly confuse certain Maven
+  repositories.
+  </p>
+
+  <p>In org.apache.log4j.Category class as implemented in the
+  log4j-over-slf4j module, calls to the trace() printing method are
+  now correctly mapped to SLF4J's trace() printing method (instead of
+  debug()). Superflous printing methods with the signature
+  <code>xxxx(Object, Object)</code> and <code>xxxx(String, Object,
+  Object)</code> have been removed.
+  </p>
+
+  <p>Fixed <a href="http://bugzilla.slf4j.org/show_bug.cgi?id=67">bug
+  67</a> reported by Chris Custine.  The manifest file for
+  jcl104-over-slf4j now correctly declares version 1.0.4 for the
+  exported JCL packages.
+  </p>
+
 
   <hr noshade="noshade" size="1"/>
 



More information about the slf4j-dev mailing list