tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm MemoryRealm.java JAASMemoryLoginModule.java
Date Fri, 24 Sep 2004 07:25:07 GMT
remm        2004/09/24 00:25:07

  Modified:    catalina/src/share/org/apache/catalina/startup
                        HostConfig.java ContextConfig.java
               catalina/src/share/org/apache/catalina/realm
                        MemoryRealm.java JAASMemoryLoginModule.java
  Log:
  - Digester handling fixes: always call reset in a finally block after using a digester.
  
  Revision  Changes    Path
  1.47      +6 -3      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java
  
  Index: HostConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- HostConfig.java	6 Sep 2004 15:02:07 -0000	1.46
  +++ HostConfig.java	24 Sep 2004 07:25:06 -0000	1.47
  @@ -557,8 +557,11 @@
           try {
               Context context = null;
               synchronized (digester) {
  -                context = (Context) digester.parse(contextXml);
  -                digester.reset();
  +                try {
  +                    context = (Context) digester.parse(contextXml);
  +                } finally {
  +                    digester.reset();
  +                }
               }
               if (context instanceof Lifecycle) {
                   Class clazz = Class.forName(host.getConfigClass());
  
  
  
  1.58      +1 -7      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
  
  Index: ContextConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- ContextConfig.java	23 Sep 2004 06:58:52 -0000	1.57
  +++ ContextConfig.java	24 Sep 2004 07:25:07 -0000	1.58
  @@ -294,7 +294,6 @@
                   if( url!=null ) {
                       InputSource is = new InputSource(url.toExternalForm());
                       is.setByteStream(stream);
  -                    webDigester.clear();
                       if (context instanceof StandardContext) {
                           ((StandardContext) context).setReplaceWelcomeFiles(true);
                       }
  @@ -326,7 +325,6 @@
                   } catch (IOException e) {
                       log.error(sm.getString("contextConfig.applicationClose"), e);
                   }
  -                webDigester.push(null);
               }
           }
           webRuleSet.recycle();
  @@ -616,9 +614,7 @@
                   
                   if (context instanceof StandardContext)
                       ((StandardContext) context).setReplaceWelcomeFiles(true);
  -                digester.clear();
                   digester.setClassLoader(this.getClass().getClassLoader());
  -                //log.info( "Using cl: " + webDigester.getClassLoader());
                   digester.setUseContextClassLoader(false);
                   digester.push(context);
                   digester.setErrorHandler(new ContextErrorHandler());
  @@ -705,9 +701,7 @@
           synchronized (contextDigester) {
               try {
                   source.setByteStream(stream);
  -                contextDigester.clear();
                   contextDigester.setClassLoader(this.getClass().getClassLoader());
  -                //log.info( "Using cl: " + webDigester.getClassLoader());
                   contextDigester.setUseContextClassLoader(false);
                   contextDigester.push(context.getParent());
                   contextDigester.push(context);
  
  
  
  1.7       +3 -2      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/MemoryRealm.java
  
  Index: MemoryRealm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/MemoryRealm.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MemoryRealm.java	6 Sep 2004 15:02:07 -0000	1.6
  +++ MemoryRealm.java	24 Sep 2004 07:25:07 -0000	1.7
  @@ -298,10 +298,11 @@
               synchronized (digester) {
                   digester.push(this);
                   digester.parse(file);
  -                digester.reset();
               }
           } catch (Exception e) {
               throw new LifecycleException("memoryRealm.readXml", e);
  +        } finally {
  +            digester.reset();
           }
   
           // Perform normal superclass initialization
  
  
  
  1.12      +3 -2      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/JAASMemoryLoginModule.java
  
  Index: JAASMemoryLoginModule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/JAASMemoryLoginModule.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JAASMemoryLoginModule.java	6 Sep 2004 15:02:07 -0000	1.11
  +++ JAASMemoryLoginModule.java	24 Sep 2004 07:25:07 -0000	1.12
  @@ -374,11 +374,12 @@
           try {
               digester.push(this);
               digester.parse(file);
  -            digester.reset();
           } catch (Exception e) {
               log.warn("Error processing configuration file " +
                   file.getAbsolutePath(), e);
               return;
  +        } finally {
  +            digester.reset();
           }
   
       }
  
  
  

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


Mime
View raw message