zongaro     2003/09/05 06:33:54

  Modified:    java/src/org/apache/xalan/xsltc/compiler
                        VariableRefBase.java
  Log:
  Applied patch for bug 22769 from Christine Li ([EMAIL PROTECTED]).  If a
  variable reference occurs inside the definition of another variable, XSLTC adds
  a dependency link upon the referenced variable to the defined variable.
  However, if the referenced variable was overrode by another variable definition
  with higher import precendence, the dependency should be placed on the
  overriding variable instead.
  
  Revision  Changes    Path
  1.12      +14 -3     
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableRefBase.java
  
  Index: VariableRefBase.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableRefBase.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- VariableRefBase.java      30 Jan 2003 18:46:02 -0000      1.11
  +++ VariableRefBase.java      5 Sep 2003 13:33:54 -0000       1.12
  @@ -154,8 +154,19 @@
        }
   
        // Insert a dependency link from one variable to another
  -     VariableBase parent = findParentVariable();
  -     if (parent != null) parent.addDependency(_variable);
  +        VariableBase parent = findParentVariable();
  +        if (parent != null) {
  +            VariableBase var = _variable;
  +            if (_variable._ignore) {
  +                if (_variable instanceof Variable) {
  +                    var = parent.getSymbolTable()
  +                                .lookupVariable(_variable._name);
  +                } else if (_variable instanceof Param) {
  +                    var = parent.getSymbolTable().lookupParam(_variable._name);
  +                }
  +            }
  +            parent.addDependency(var);
  +        }
   
           // Attempt to get the cached variable type
           _type = _variable.getType();
  
  
  

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

Reply via email to