sboag       00/12/21 07:01:26

  Modified:    java/src/org/apache/xpath VariableStack.java
  Log:
  Fixed nasty bug where an arg was being set in the stack, instead of the frame.
  
  Revision  Changes    Path
  1.19      +41 -19    xml-xalan/java/src/org/apache/xpath/VariableStack.java
  
  Index: VariableStack.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/VariableStack.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- VariableStack.java        2000/12/21 02:04:58     1.18
  +++ VariableStack.java        2000/12/21 15:01:26     1.19
  @@ -93,23 +93,44 @@
       pushContextMarker();
     }
     
  -  /**
  -   * Pushes an item onto the top of this stack. This has exactly 
  -   * the same effect as:
  -   * <blockquote><pre>
  -   * addElement(item)</pre></blockquote>
  -   *
  -   * @param   item   the item to be pushed onto this stack.
  -   * @return  the <code>item</code> argument.
  -   * @see     java.util.Vector#addElement
  -   */
  -  public Object push(Object item) 
  -  {
  -      if(!(item instanceof Stack))
  -        throw new RuntimeException("You can only push a Stack on the 
variable stack!");
  -
  -      return super.push(item);
  -  }
  +//  /**
  +//   * Pushes an item onto the top of this stack. This has exactly 
  +//   * the same effect as:
  +//   * <blockquote><pre>
  +//   * addElement(item)</pre></blockquote>
  +//   *
  +//   * @param   item   the item to be pushed onto this stack.
  +//   * @return  the <code>item</code> argument.
  +//   * @see     java.util.Vector#addElement
  +//   */
  +//  public Object push(Object item) 
  +//  {
  +//      if(!(item instanceof Stack))
  +//        throw new RuntimeException("You can only push a Stack on the 
variable stack!");
  +//
  +//      return super.push(item);
  +//  }
  +//  
  +//  public synchronized void addElement(Object obj) {
  +//    if(!(obj instanceof Stack))
  +//      throw new RuntimeException("You can only push a Stack on the 
variable stack!");
  +//      
  +//    super.addElement(obj);
  +//  }
  +//  
  +//  public synchronized void insertElementAt(Object obj, int index) {
  +//  if(!(obj instanceof Stack))
  +//    throw new RuntimeException("You can only push a Stack on the variable 
stack!");
  +//    
  +//  super.insertElementAt(obj, index);
  +//  }
  +//
  +//  public synchronized void setElementAt(Object obj, int index) {
  +//  if(!(obj instanceof Stack))
  +//    throw new RuntimeException("You can only push a Stack on the variable 
stack!");
  +//    
  +//  super.insertElementAt(obj, index);
  +// }
     
     /**
      * Set where to start the current search for a variable.
  @@ -221,7 +242,8 @@
      private Stack getCurrentFrame()
      {
         int stackFrameIndex = (-1 == m_searchStart) ? this.size()-1 : 
m_searchStart;
  -      return (Stack)this.elementAt(stackFrameIndex);
  +      // System.out.println("what: "+this.elementAt(stackFrameIndex));
  +      return (Stack)elementAt(stackFrameIndex);
      }
      
     /**
  @@ -254,7 +276,7 @@
         Arg arg = (Arg)frame.elementAt(i);
         if(arg.getQName().equals(qname))
         {
  -        this.setElementAt(new Arg(qname, xval), i);
  +        frame.setElementAt(new Arg(qname, xval), i);
           return;
         }
       }
  
  
  

Reply via email to