You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rd...@apache.org on 2005/02/07 21:36:54 UTC

svn commit: r151748 - jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/LogFactory.java

Author: rdonkin
Date: Mon Feb  7 12:36:53 2005
New Revision: 151748

URL: http://svn.apache.org/viewcvs?view=rev&rev=151748
Log:
Restricted warning message so that it is only displayed when the property has been set

Modified:
    jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/LogFactory.java

Modified: jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/LogFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/LogFactory.java?view=diff&r1=151747&r2=151748
==============================================================================
--- jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/LogFactory.java (original)
+++ jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/LogFactory.java Mon Feb  7 12:36:53 2005
@@ -42,7 +42,7 @@
  * @author Craig R. McClanahan
  * @author Costin Manolache
  * @author Richard A. Sitze
- * @version $Revision: 1.28 $ $Date: 2004/11/10 22:59:04 $
+ * @version $Revision: 1.28 $ $Date$
  */
 
 public abstract class LogFactory {
@@ -115,7 +115,9 @@
      */
     public static final String HASHTABLE_IMPLEMENTATION_PROPERTY =
         "org.apache.commons.logging.LogFactory.HashtableImpl";
-
+    /** Name used to load the weak hashtable implementation by names */
+    private static final String WEAK_HASHTABLE_CLASSNAME = "org.apache.commons.logging.impl.WeakHashtable";
+    
     // ----------------------------------------------------------- Constructors
 
 
@@ -224,7 +226,7 @@
         String storeImplementationClass 
             = System.getProperty(HASHTABLE_IMPLEMENTATION_PROPERTY);
         if (storeImplementationClass == null) {
-            storeImplementationClass = "org.apache.commons.logging.impl.WeakHashtable";
+            storeImplementationClass = WEAK_HASHTABLE_CLASSNAME;
         }
         try {
             Class implementationClass = Class.forName(storeImplementationClass);
@@ -232,7 +234,10 @@
             
         } catch (Exception e) {
             // ignore
-            System.err.println("[ERROR] LogFactory: Load of custom hashtable failed");
+        	if (!WEAK_HASHTABLE_CLASSNAME.equals(storeImplementationClass)) {
+        		// if the user's trying to set up a custom implementation, give a clue
+        		System.err.println("[ERROR] LogFactory: Load of custom hashtable failed");
+        	}
         }
         if (result == null) {
             result = new Hashtable();



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org