crafterm    2002/07/02 04:08:42

  Modified:    fortress/src/java/org/apache/excalibur/fortress/util
                        ContextManager.java
  Log:
  Removed setting of this.logger from being within a finally clause.
  
  The problem is if an exception occurs while creating the logger manager, then
  the call to childContext.get(LOGGER_MANAGER) in the finally block will fail,
  throwing an exception saying 'no container.logManager' in context. This
  masks the real exception that caused the problem, making debugging of the
  situation for the user extra hard.
  
  Revision  Changes    Path
  1.24      +9 -11     
jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextManager.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ContextManager.java       28 Jun 2002 04:43:47 -0000      1.23
  +++ ContextManager.java       2 Jul 2002 11:08:42 -0000       1.24
  @@ -579,18 +579,16 @@
   
               childContext.put( LOGGER_MANAGER, logManager );
           }
  -        finally
  -        {
  -            // Since we now have a LoggerManager, we can update the this.logger 
field
  -            // if it is null and start logging to the "right" logger.
   
  -            if( this.logger == null )
  -            {
  -                getLogger().info( "Switching to default Logger provided by 
LoggerManager." );
  +        // Since we now have a LoggerManager, we can update the this.logger field
  +        // if it is null and start logging to the "right" logger.
  +
  +        if( this.logger == null )
  +        {
  +            getLogger().info( "Switching to default Logger provided by 
LoggerManager." );
   
  -                LoggerManager loggerManager = (LoggerManager)childContext.get( 
LOGGER_MANAGER );
  -                this.logger = loggerManager.getDefaultLogger();
  -            }
  +            LoggerManager loggerManager = (LoggerManager)childContext.get( 
LOGGER_MANAGER );
  +            this.logger = loggerManager.getDefaultLogger();
           }
       }
   
  
  
  

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

Reply via email to