avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon/src/java/org/apache/avalon/framework/context DefaultContext.java
Date Sun, 12 May 2002 11:32:13 GMT
donaldp     02/05/12 04:32:13

  Modified:    src/java/org/apache/avalon/framework/context
                        DefaultContext.java
  Log:
  If null is passed into context then
  remove value from map (rather than adding
  a null into map, possibly causing an exception)
  
  Revision  Changes    Path
  1.10      +13 -6     jakarta-avalon/src/java/org/apache/avalon/framework/context/DefaultContext.java
  
  Index: DefaultContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/context/DefaultContext.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultContext.java	10 May 2002 03:00:48 -0000	1.9
  +++ DefaultContext.java	12 May 2002 11:32:13 -0000	1.10
  @@ -22,9 +22,9 @@
   public class DefaultContext
       implements Context
   {
  -    private final Map                       m_contextData;
  -    private final Context                   m_parent;
  -    private boolean                         m_readOnly;
  +    private final Map m_contextData;
  +    private final Context m_parent;
  +    private boolean m_readOnly;
   
       /**
        * Create a Context with specified data and parent.
  @@ -81,9 +81,9 @@
   
           if( null != data )
           {
  -            if ( data instanceof Resolvable )
  +            if( data instanceof Resolvable )
               {
  -                return ( (Resolvable) data ).resolve( this );
  +                return ( (Resolvable)data ).resolve( this );
               }
   
               return data;
  @@ -110,7 +110,14 @@
           throws IllegalStateException
       {
           checkWriteable();
  -        m_contextData.put( key, value );
  +        if( null == value )
  +        {
  +            m_contextData.remove( key );
  +        }
  +        else
  +        {
  +            m_contextData.put( key, value );
  +        }
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message