mmidy       00/09/29 08:49:57

  Modified:    java/src/org/apache/xalan/stree ElementImpl.java
  Log:
  Changing this to avoid calling getAttrCount recursively
  
  Revision  Changes    Path
  1.12      +20 -6     
xml-xalan/java/src/org/apache/xalan/stree/ElementImpl.java
  
  Index: ElementImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/ElementImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ElementImpl.java  2000/09/29 14:20:40     1.11
  +++ ElementImpl.java  2000/09/29 15:49:57     1.12
  @@ -103,7 +103,7 @@
      */
     public int getChildCount()
     {
  -    if (null == m_children && !isComplete())
  +    if (!isComplete())
       {
         synchronized (this)
         {
  @@ -274,15 +274,29 @@
        *
        * @return The number of attributes in the list.
        */
  -    public int getAttrCount ()
  +  public int getAttrCount ()
  +  {
  +    if (null == m_children && !isComplete())      
       {
  -      if (null == m_children && !isComplete())
  +      // Force it to wait until at least an element child 
  +      // has been added or end element.
  +      synchronized (this)
         {
  -        // Force it to wait until children have been added
  -        int count = getChildCount(); 
  +        try
  +        {
  +          //System.out.println("Waiting... getelCount " );
  +          wait();
  +        }
  +        catch (InterruptedException e)
  +        {
  +          // That's OK, it's as good a time as any to check again
  +        }
  +        //System.out.println("/// gotelcount " );
  +        
         }
  -      return attrsEnd;
       }
  +    return attrsEnd;
  +  }
         
   
   
  
  
  

Reply via email to