xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zong...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Number.java Predicate.java Sort.java Variable.java VariableRef.java
Date Tue, 24 Feb 2004 12:59:24 GMT
zongaro     2004/02/24 04:59:24

  Modified:    java/src/org/apache/xalan/xsltc/compiler Tag:
                        xslt20-compiled 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
  No                   revision
  No                   revision
  1.12.6.1  +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.12
  retrieving revision 1.12.6.1
  diff -u -r1.12 -r1.12.6.1
  --- Number.java	30 Jan 2003 18:46:01 -0000	1.12
  +++ Number.java	24 Feb 2004 12:59:23 -0000	1.12.6.1
  @@ -436,7 +436,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()));
   	}
  @@ -534,7 +534,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.29.2.2  +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.29.2.1
  retrieving revision 1.29.2.2
  diff -u -r1.29.2.1 -r1.29.2.2
  --- Predicate.java	15 Oct 2003 21:03:50 -0000	1.29.2.1
  +++ Predicate.java	24 Feb 2004 12:59:23 -0000	1.29.2.2
  @@ -375,7 +375,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()));
   	}
  @@ -577,7 +577,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
  @@ -586,7 +586,7 @@
   
   	    // Store variable in new closure
   	    il.append(new PUTFIELD(
  -		    cpg.addFieldref(_className, var.getVariable(), 
  +		    cpg.addFieldref(_className, var.getEscapedName(), 
   			varType.toSignature())));
   	}
       }
  
  
  
  1.19.6.2  +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.19.6.1
  retrieving revision 1.19.6.2
  diff -u -r1.19.6.1 -r1.19.6.2
  --- Sort.java	15 Oct 2003 18:36:40 -0000	1.19.6.1
  +++ Sort.java	24 Feb 2004 12:59:23 -0000	1.19.6.2
  @@ -394,7 +394,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);
   	    }
  @@ -435,7 +435,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);
  @@ -513,12 +513,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);
  @@ -574,7 +574,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.25.6.1  +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.25
  retrieving revision 1.25.6.1
  diff -u -r1.25 -r1.25.6.1
  --- Variable.java	30 Jan 2003 18:46:02 -0000	1.25
  +++ Variable.java	24 Feb 2004 12:59:23 -0000	1.25.6.1
  @@ -167,7 +167,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());
   	    }
  @@ -188,7 +188,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.15.6.1  +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.15
  retrieving revision 1.15.6.1
  diff -u -r1.15 -r1.15.6.1
  --- VariableRef.java	30 Jan 2003 18:46:02 -0000	1.15
  +++ VariableRef.java	24 Feb 2004 12:59:23 -0000	1.15.6.1
  @@ -87,7 +87,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


Mime
View raw message