ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/metadata ModelElement.java
Date Thu, 13 Jun 2002 05:29:48 GMT
donaldp     2002/06/12 22:29:48

  Modified:    api/src/java/org/apache/myrmidon/api/metadata
                        ModelElement.java
  Log:
  Add in check to make sure dont try to make children read-only when ther eare no children
  
  Revision  Changes    Path
  1.7       +13 -6     jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/metadata/ModelElement.java
  
  Index: ModelElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/metadata/ModelElement.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ModelElement.java	13 Jun 2002 05:21:37 -0000	1.6
  +++ ModelElement.java	13 Jun 2002 05:29:47 -0000	1.7
  @@ -221,7 +221,7 @@
       public String getAttribute( final String name, final String defaultVal )
       {
           String value = null;
  -        if( m_attributes != null)
  +        if( m_attributes != null )
           {
               value = (String)m_attributes.get( name );
           }
  @@ -256,11 +256,18 @@
       public void makeReadOnly()
       {
           m_readOnly = true;
  -        final int size = m_children.size();
  -        for( int i = 0; i < size; i++ )
  +        if( null == m_children )
           {
  -            final ModelElement element = (ModelElement)m_children.get( i );
  -            element.makeReadOnly();
  +            return;
  +        }
  +        else
  +        {
  +            final int size = m_children.size();
  +            for( int i = 0; i < size; i++ )
  +            {
  +                final ModelElement element = (ModelElement)m_children.get( i );
  +                element.makeReadOnly();
  +            }
           }
       }
   
  
  
  

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


Mime
View raw message