From 1529c02432fdc9c3a8b54bd12932caf9a40ec8a0 Mon Sep 17 00:00:00 2001
From: Gary Gregory
- * [ERROR] LogFactory: Load of custom hashtable failed
+ * [ERROR] LogFactory: Load of custom hash table failed
*
*
* to system error and then continue using a standard Hashtable.
@@ -192,7 +192,7 @@ public abstract class LogFactory {
public static final String HASHTABLE_IMPLEMENTATION_PROPERTY =
"org.apache.commons.logging.LogFactory.HashtableImpl";
- /** Name used to load the weak hashtable implementation by names. */
+ /** Name used to load the weak hash table implementation by names. */
private static final String WEAK_HASHTABLE_CLASSNAME =
"org.apache.commons.logging.impl.WeakHashtable";
@@ -229,7 +229,7 @@ public abstract class LogFactory {
* class loader (only likely for embedded systems work).
*
* Note that {@code factories} is a Hashtable (not a HashMap),
- * and hashtables don't allow null as a key.
+ * and hash tables don't allow null as a key.
* @deprecated since 1.1.2
*/
@Deprecated
@@ -440,7 +440,7 @@ public abstract class LogFactory {
}
/**
- * Create the hashtable which will be used to store a map of
+ * Create the hash table which will be used to store a map of
* (context class loader -> logfactory-object). Version 1.2+ of Java
* supports "weak references", allowing a custom Hashtable class
* to be used which uses only weak references to its keys. Using weak
@@ -462,7 +462,7 @@ public abstract class LogFactory {
storeImplementationClass = getSystemProperty(HASHTABLE_IMPLEMENTATION_PROPERTY, null);
} catch (final SecurityException ex) {
// Permissions don't allow this to be accessed. Default to the "modern"
- // weak hashtable implementation if it is available.
+ // weak hash table implementation if it is available.
storeImplementationClass = null;
}
diff --git a/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java b/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java
index b180261..ae711a5 100644
--- a/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java
+++ b/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java
@@ -82,7 +82,7 @@ public class AvalonLogger implements Log {
/**
* Constructs an {@code AvalonLogger} that will log to a child
- * of the Logger set by calling {@link #setDefaultLogger}.
+ * of the {@code Logger} set by calling {@link #setDefaultLogger}.
*
* @param name the name of the avalon logger implementation to delegate to
*/
diff --git a/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java b/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java
index ed1ea27..e52d465 100644
--- a/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java
+++ b/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java
@@ -50,7 +50,7 @@ import org.apache.commons.logging.LogFactory;
*
*
* If the selected {@link Log} implementation class has a
- * setLogFactory() method that accepts a {@link LogFactory}
+ * {@code setLogFactory()} method that accepts a {@link LogFactory}
* parameter, this method will be called on each newly created instance
* to identify the associated factory. This makes factory configuration
* attributes available to the Log instance, if it so desires.
diff --git a/src/main/java/org/apache/commons/logging/impl/WeakHashtable.java b/src/main/java/org/apache/commons/logging/impl/WeakHashtable.java
index 8157f88..6df1ff5 100644
--- a/src/main/java/org/apache/commons/logging/impl/WeakHashtable.java
+++ b/src/main/java/org/apache/commons/logging/impl/WeakHashtable.java
@@ -216,7 +216,7 @@ public final class WeakHashtable extends Hashtable {
result = result && hashCode() == otherKey.hashCode();
// In any case, as our c'tor does not allow null referants
// and Hashtable does not do equality checks between
- // existing keys, normal hashtable operations should never
+ // existing keys, normal hash table operations should never
// result in an equals comparison between null referants
}
else
diff --git a/src/main/java/org/apache/commons/logging/package-info.java b/src/main/java/org/apache/commons/logging/package-info.java
index db99125..f2d078a 100644
--- a/src/main/java/org/apache/commons/logging/package-info.java
+++ b/src/main/java/org/apache/commons/logging/package-info.java
@@ -29,10 +29,10 @@
*
java.util.logging.Logger instance.Logger.LogFactory ImplementationFrom an application perspective, the first requirement is to retrieve an
- * object reference to the LogFactory instance that will be used
- * to create Log instances for this
+ * object reference to the {@code LogFactory} instance that will be used
+ * to create {@code Log} instances for this
* application. This is normally accomplished by calling the static
- * getFactory() method. This method implements the following
- * discovery algorithm to select the name of the LogFactory
+ * {@code getFactory()} method. This method implements the following
+ * discovery algorithm to select the name of the {@code LogFactory}
* implementation class this application wants to use:
org.apache.commons.logging.LogFactory.META-INF/services/org.apache.commons.logging.LogFactory
+ * {@code META-INF/services/org.apache.commons.logging.LogFactory}
* whose first line is assumed to contain the desired class name.commons-logging.properties
+ * org.apache.commons.logging.LogFactory defining the
+ * {@code org.apache.commons.logging.LogFactory} defining the
* desired implementation class name.If a commons-logging.properties file is found, all of the
+ *
If a {@code commons-logging.properties} file is found, all of the
* properties defined there are also used to set configuration attributes on
- * the instantiated LogFactory instance.
Once an implementation class name is selected, the corresponding class is
* loaded from the current Thread context class loader (if there is one), or
- * from the class loader that loaded the LogFactory class itself
- * otherwise. This allows a copy of commons-logging.jar to be
+ * from the class loader that loaded the {@code LogFactory} class itself
+ * otherwise. This allows a copy of {@code commons-logging.jar} to be
* shared in a multiple class loader environment (such as a servlet container),
- * but still allow each web application to provide its own LogFactory
+ * but still allow each web application to provide its own {@code LogFactory}
* implementation, if it so desires. An instance of this class will then be
* created, and cached per class loader.
- *
LogFactory ImplementationThe Logging Package APIs include a default LogFactory
+ *
The Logging Package APIs include a default {@code LogFactory}
* implementation class (
* org.apache.commons.logging.impl.LogFactoryImpl) that is selected if no
* other implementation class name can be discovered. Its primary purpose is
* to create (as necessary) and return Log instances
- * in response to calls to the getInstance() method. The default
+ * in response to calls to the {@code getInstance()} method. The default
* implementation uses the following rules:
Log instance of the same name will be created.
- * Subsequent getInstance() calls to the same
- * LogFactory instance, with the same name or Class
- * parameter, will return the same Log instance.Log instance must be created, the default
- * LogFactory implementation uses the following discovery
+ * org.apache.commons.logging.Log (for backwards
+ * {@code org.apache.commons.logging.Log} (for backwards
* compatibility to pre-1.0 versions of this API, an attribute
- * org.apache.commons.logging.log is also consulted).org.apache.commons.logging.Log (for backwards
+ * {@code org.apache.commons.logging.Log} (for backwards
* compatibility to pre-1.0 versions of this API, a system property
- * org.apache.commons.logging.log is also consulted).LogFactory class otherwise.Log
+ * {@code LogFactory} class otherwise.Each individual Log implementation may * support its own configuration properties. These will be documented in the * class descriptions for the corresponding implementation class.
- *Finally, some Log implementations (such as the one for Log4J)
+ *
Finally, some {@code Log} implementations (such as the one for Log4J) * require an external configuration file for the entire logging environment. * This file should be prepared in a manner that is specific to the actual logging * technology being used.
@@ -168,12 +168,12 @@ * purposes. A typical scenario for a server application is to have each * major component of the server use its own Log instance. *trace(), debug(),
- * info(), warn(), error, and
- * fatal()).For convenience, LogFactory also offers a static method
- * getLog() that combines the typical two-step pattern:
For convenience, {@code LogFactory} also offers a static method + * {@code getLog()} that combines the typical two-step pattern:
** Log log = LogFactory.getFactory().getInstance(Foo.class); *diff --git a/src/test/java/org/apache/commons/logging/impl/WeakHashtableTestCase.java b/src/test/java/org/apache/commons/logging/impl/WeakHashtableTestCase.java index 6e082d0..ea6ad98 100644 --- a/src/test/java/org/apache/commons/logging/impl/WeakHashtableTestCase.java +++ b/src/test/java/org/apache/commons/logging/impl/WeakHashtableTestCase.java @@ -212,7 +212,7 @@ public class WeakHashtableTestCase extends TestCase { assertEquals(Long.valueOf(1066), weakHashtable.get(anotherKey)); - // Test compliance with the hashtable API re nulls + // Test compliance with the Hashtable API re nulls Exception caught = null; try { weakHashtable.put(null, new Object()); diff --git a/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java b/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java index fe4e5ff..28c0ba4 100644 --- a/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java +++ b/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java @@ -43,7 +43,7 @@ import org.apache.commons.logging.PathableTestSuite; */ public class SecurityAllowedTestCase extends TestCase { - // Dummy special hashtable, so we can tell JCL to use this instead of + // Dummy special Hashtable, so we can tell JCL to use this instead of // the standard one. public static class CustomHashtable extends Hashtable { diff --git a/src/test/java/org/apache/commons/logging/security/SecurityForbiddenTestCase.java b/src/test/java/org/apache/commons/logging/security/SecurityForbiddenTestCase.java index ee1afb8..a940ec0 100644 --- a/src/test/java/org/apache/commons/logging/security/SecurityForbiddenTestCase.java +++ b/src/test/java/org/apache/commons/logging/security/SecurityForbiddenTestCase.java @@ -39,24 +39,28 @@ import org.apache.commons.logging.PathableTestSuite; * Performing tests with security permissions disabled is tricky, as building error * messages on failure requires certain security permissions. If the security manager * blocks these, then the test can fail without the error messages being output. + * *
* This class has only one unit test, as we are (in part) checking behavior in * the static block of the LogFactory class. As that class cannot be unloaded after * being loaded into a class loader, the only workaround is to use the * PathableClassLoader approach to ensure each test is run in its own * class loader, and use a separate test class for each test. + *
*/ public class SecurityForbiddenTestCase extends TestCase { - // Dummy special hashtable, so we can tell JCL to use this instead of - // the standard one. - public static class CustomHashtable extends Hashtable { + /** + * Dummy special Hashtable, so we can tell JCL to use this instead of the standard one. + */ + public static class CustomHashtable extends Hashtable