You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2004/02/24 03:58:42 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Number.java Predicate.java Sort.java Variable.java VariableRef.java

zongaro     2004/02/23 18:58:42

  Modified:    java/src/org/apache/xalan/xsltc/compiler Number.java
                        Predicate.java Sort.java Variable.java
                        VariableRef.java
  Log:
  Patch for Bugzilla bug report 25368 from Joanne Tong (joannet () ca ! ibm ! com)
  reviewed by myself.
  
  Code was basing variable and parameter names on the local part of the name,
  rather than including the namespace URI in the name.  This resulted in
  collisions in the generated code between distinct variables that had the same
  local-name.
  
  Revision  Changes    Path
  1.14      +3 -3      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Number.java
  
  Index: Number.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Number.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Number.java	16 Feb 2004 22:24:29 -0000	1.13
  +++ Number.java	24 Feb 2004 02:58:42 -0000	1.14
  @@ -396,7 +396,7 @@
   		((VariableRefBase) _closureVars.get(i)).getVariable();
   
   	    nodeCounterGen.addField(new Field(ACC_PUBLIC, 
  -					cpg.addUtf8(var.getVariable()),
  +					cpg.addUtf8(var.getEscapedName()),
   					cpg.addUtf8(var.getType().toSignature()),
   					null, cpg.getConstantPool()));
   	}
  @@ -494,7 +494,7 @@
   	    il.append(DUP);
   	    il.append(var.loadInstruction());
   	    il.append(new PUTFIELD(
  -		    cpg.addFieldref(_className, var.getVariable(), 
  +		    cpg.addFieldref(_className, var.getEscapedName(), 
   			varType.toSignature())));
   	}
       }
  
  
  
  1.34      +4 -4      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Predicate.java
  
  Index: Predicate.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Predicate.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- Predicate.java	16 Feb 2004 22:24:29 -0000	1.33
  +++ Predicate.java	24 Feb 2004 02:58:42 -0000	1.34
  @@ -372,7 +372,7 @@
   	    VariableBase var = ((VariableRefBase) _closureVars.get(i)).getVariable();
   
   	    filterGen.addField(new Field(ACC_PUBLIC, 
  -					cpg.addUtf8(var.getVariable()),
  +					cpg.addUtf8(var.getEscapedName()),
   					cpg.addUtf8(var.getType().toSignature()),
   					null, cpg.getConstantPool()));
   	}
  @@ -578,7 +578,7 @@
   		il.append(ALOAD_0);
   		il.append(new GETFIELD(
   		    cpg.addFieldref(variableClosure.getInnerClassName(), 
  -			var.getVariable(), varType.toSignature())));
  +			var.getEscapedName(), varType.toSignature())));
   	    }
   	    else {
   		// Use a load of instruction if in translet class
  @@ -587,7 +587,7 @@
   
   	    // Store variable in new closure
   	    il.append(new PUTFIELD(
  -		    cpg.addFieldref(_className, var.getVariable(), 
  +		    cpg.addFieldref(_className, var.getEscapedName(), 
   			varType.toSignature())));
   	}
       }
  
  
  
  1.23      +6 -6      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Sort.java
  
  Index: Sort.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Sort.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Sort.java	16 Feb 2004 22:24:29 -0000	1.22
  +++ Sort.java	24 Feb 2004 02:58:42 -0000	1.23
  @@ -380,7 +380,7 @@
   		il.append(DUP);
   		il.append(var.loadInstruction());
   		il.append(new PUTFIELD(
  -			cpg.addFieldref(sortRecordFactoryClass, var.getVariable(), 
  +			cpg.addFieldref(sortRecordFactoryClass, var.getEscapedName(), 
   			    var.getType().toSignature())));
   		dups.add(varRef);
   	    }
  @@ -421,7 +421,7 @@
   
   		final VariableBase var = varRef.getVariable();
   		sortRecordFactory.addField(new Field(ACC_PUBLIC, 
  -					   cpg.addUtf8(var.getVariable()),
  +					   cpg.addUtf8(var.getEscapedName()),
   					   cpg.addUtf8(var.getType().toSignature()),
   					   null, cpg.getConstantPool()));
   		dups.add(varRef);
  @@ -508,12 +508,12 @@
   	    il.append(ALOAD_0);
   	    il.append(new GETFIELD(
   		cpg.addFieldref(className,
  -		    var.getVariable(), varType.toSignature())));
  +		    var.getEscapedName(), varType.toSignature())));
   
   	    // Put field in record class
   	    il.append(new PUTFIELD(
   		cpg.addFieldref(sortRecordClass,
  -		    var.getVariable(), varType.toSignature())));
  +		    var.getEscapedName(), varType.toSignature())));
   	}
   	il.append(POP);
   	il.append(ARETURN);
  @@ -569,7 +569,7 @@
   
   		final VariableBase var = varRef.getVariable();
   		sortRecord.addField(new Field(ACC_PUBLIC, 
  -				    cpg.addUtf8(var.getVariable()),
  +				    cpg.addUtf8(var.getEscapedName()),
   				    cpg.addUtf8(var.getType().toSignature()),
   				    null, cpg.getConstantPool()));
   		dups.add(varRef);
  
  
  
  1.27      +3 -3      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Variable.java
  
  Index: Variable.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Variable.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Variable.java	16 Feb 2004 22:25:10 -0000	1.26
  +++ Variable.java	24 Feb 2004 02:58:42 -0000	1.27
  @@ -127,7 +127,7 @@
   	if (isLocal() && !_refs.isEmpty()) {
   	    // Create a variable slot if none is allocated
   	    if (_local == null) {
  -		_local = methodGen.addLocalVariable2(_name.getLocalPart(),
  +		_local = methodGen.addLocalVariable2(getEscapedName(),
   						     _type.toJCType(),
   						     il.getEnd());
   	    }
  @@ -148,7 +148,7 @@
   	final ConstantPoolGen cpg = classGen.getConstantPool();
   	final InstructionList il = methodGen.getInstructionList();
   
  -	final String name = getVariable();
  +	final String name = getEscapedName();
   
   	// Make sure that a variable instance is only compiled once
   	if (_ignore) return;
  
  
  
  1.17      +2 -2      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableRef.java
  
  Index: VariableRef.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableRef.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- VariableRef.java	16 Feb 2004 22:25:10 -0000	1.16
  +++ VariableRef.java	24 Feb 2004 02:58:42 -0000	1.17
  @@ -47,7 +47,7 @@
   	// Fall-through for variables that are implemented as methods
   	if (_type.implementedAsMethod()) return;
   
  -	final String name = _variable.getVariable();
  +	final String name = _variable.getEscapedName();
   	final String signature = _type.toSignature();
   
   	if (_variable.isLocal()) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org