Author: yoavs
Date: Sun Mar 25 08:28:12 2007
New Revision: 522281

URL: http://svn.apache.org/viewvc?view=rev&rev=522281
Log:
Bugzilla 39875: minor cleanup in RealmBase.init to avoid a possible NPE when 
getting logger.

Modified:
    
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/realm/RealmBase.java
    tomcat/container/tc5.5.x/webapps/docs/changelog.xml

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/realm/RealmBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/realm/RealmBase.java?view=diff&rev=522281&r1=522280&r2=522281
==============================================================================
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/realm/RealmBase.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/realm/RealmBase.java
 Sun Mar 25 08:28:12 2007
@@ -1325,10 +1325,19 @@
     }
 
     protected boolean initialized=false;
-    
+
+    /**
+     * Initialize this Realm.  If it's already been
+     * initialized, do nothing.
+     */    
     public void init() {
-        this.containerLog = container.getLogger();
+        // Bugzilla 39875: if already initialized, do nothing
         if( initialized && container != null ) return;
+
+        // We want logger as soon as possible
+        if (container != null) {
+            this.containerLog = container.getLogger();
+        }
         
         initialized=true;
         if( container== null ) {

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?view=diff&rev=522281&r1=522280&r2=522281
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Sun Mar 25 08:28:12 2007
@@ -24,6 +24,9 @@
         <bug>41752</bug> Correct error message on exception in MemoryRealm.
         (markt)
       </fix>
+      <fix>
+        <bug>39875</bug> Minor cleanup in RealmBase.init, as requested by 
Takayoshi Kimura. (yoavs)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Webapps">



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to