ceki 01/05/31 15:23:06 Modified: build build.xml docs manual.html src/java/org/apache/log4j Category.java src/java/org/apache/log4j/helpers Loader.java Log: Fixed Categoty static initializer to use Category.class instead of Object.class. Revision Changes Path 1.35 +1 -1 jakarta-log4j/build/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-log4j/build/build.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- build.xml 2001/05/20 15:03:06 1.34 +++ build.xml 2001/05/31 22:22:59 1.35 @@ -9,7 +9,7 @@ <!-- ================================================================= --> <project name="log4j" default="usage" basedir=".." > - <property name="version" value="1.1.1"/> + <property name="version" value="1.1.2"/> <!-- The base directory relative to which most targets are built --> <property name="base" value="."/> 1.18 +6 -6 jakarta-log4j/docs/manual.html Index: manual.html =================================================================== RCS file: /home/cvs/jakarta-log4j/docs/manual.html,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- manual.html 2001/05/18 20:45:16 1.17 +++ manual.html 2001/05/31 22:23:02 1.18 @@ -728,7 +728,7 @@ appenders. Under certain well-defined circumstances however, the static inializer of the <code>Category</code> class will attempt to automatically configure log4j. The Java language guarantees that the -static initializer of a class is called once and only during the +static initializer of a class is called once and only once during the loading of a class into memory. (Although different classloaders may load distinct copies of the same class.) @@ -758,17 +758,17 @@ example due to a <code>MalformedURLException</code>, then search for the <code>resource</code> from the classpath by calling <code>org.apache.log4j.helpers.Loader.getResource(resource, - Category.class)</code>. Note that "log4j.properties" is a a malformed - URL and hence it falls to this case. + Category.class)</code> which returns a URL. Note that + "log4j.properties" is a malformed URL and hence it falls to this + case. <p>See <a href="api/org/apache/log4j/helpers/Loader.html#getResource(java.lang.String, java.lang.Class)">Loader.getResource(java.lang.String, java.lang.Class)</a> for the list of searched locations which is rather complex in itself.. - <p><li>If the URL could not be found, abort default initialization. - - <p><li>Otherwise, configure log4j from the URL. + <p><li>If no URL could not be found, abort default + initialization. Otherwise, configure log4j from the URL. <p>The URL format is important. Its <em>reference</em> part is 1.29 +1 -1 jakarta-log4j/src/java/org/apache/log4j/Category.java Index: Category.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/Category.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- Category.java 2001/04/26 17:31:03 1.28 +++ Category.java 2001/05/31 22:23:04 1.29 @@ -135,7 +135,7 @@ // attempt to get the resource from the class path url = new URL(resource); } catch (MalformedURLException ex) { - url = Loader.getResource(resource, Object.class); + url = Loader.getResource(resource, Category.class); } // If we have a non-null url, then delegate the rest of the 1.8 +10 -13 jakarta-log4j/src/java/org/apache/log4j/helpers/Loader.java Index: Loader.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/helpers/Loader.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Loader.java 2001/04/26 08:16:24 1.7 +++ Loader.java 2001/05/31 22:23:05 1.8 @@ -37,11 +37,11 @@ <p><li>Search for <code>resource</code> with the class loader that loaded <code>clazz</code>. - <pi><li>Try one last time with - <code>ClassLoader.getSystemResource(resource)</code> + <p><li>Try one last time with + <code>ClassLoader.getSystemResource(resource)</code>. + </ol> - */ static public @@ -50,12 +50,10 @@ URL url = null; - // Is it under CLAZZ/resource somewhere in the classpath? - // where CLAZZ is the fully qualified name of clazz where dots have been + // Is it under CLAZZ/resource somewhere in the classpath? CLAZZ + // stands for fully qualified name of "clazz" where dots have been // changed to directory separators - LogLog.debug("Trying to find ["+resource+"] using Class.getResource()."); - - + LogLog.debug("Trying to find ["+resource+"] using clazz.getResource()."); try { url = clazz.getResource(resource); @@ -64,8 +62,7 @@ } catch (Throwable t) { LogLog.warn(TSTR,t); } - - + // attempt to get the resource under CLAZZ/resource from the // system class path. The system class loader should not throw // InvalidJarIndexExceptions @@ -98,12 +95,12 @@ LogLog.debug("Trying to find ["+resource+"] using ClassLoader.getSystemResource()."); url = ClassLoader.getSystemResource(resource); return url; - } /** - Add the fully qualified name of a class before resource (replace . with /). - */ + Append the fully qualified name of a class before resource + (replace . with /). + */ static String resolveName(String resource, Class clazz) { String fqcn = clazz.getName(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]