zongaro 2003/03/20 02:49:22
Modified: java/src/org/apache/xalan/xsltc/compiler/util Tag: XSLTC_DTM
VoidType.java
Log:
Propagating Santiago's change to revision 1.6 of this file:
Override definition of Type.POP() in VoidType to return NOP instead of POP.
If type is void, there's nothing to be popped. This problem shows up when
invoking an external Java function whose return type is void.
Revision Changes Path
No revision
No revision
1.3.6.3 +9 -4
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/VoidType.java
Index: VoidType.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/VoidType.java,v
retrieving revision 1.3.6.2
retrieving revision 1.3.6.3
diff -u -r1.3.6.2 -r1.3.6.3
--- VoidType.java 30 Jan 2003 18:41:45 -0000 1.3.6.2
+++ VoidType.java 20 Mar 2003 10:49:22 -0000 1.3.6.3
@@ -63,6 +63,7 @@
package org.apache.xalan.xsltc.compiler.util;
+import org.apache.bcel.generic.Instruction;
import org.apache.bcel.generic.InstructionList;
import org.apache.bcel.generic.PUSH;
import org.apache.xalan.xsltc.compiler.Constants;
@@ -86,6 +87,10 @@
return null; // should never be called
}
+ public Instruction POP() {
+ return NOP;
+ }
+
/**
* Translates a void into an object of internal type <code>type</code>.
* This translation is needed when calling external functions
@@ -93,7 +98,7 @@
*
* @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
*/
- public void translateTo(ClassGenerator classGen, MethodGenerator
methodGen,
+ public void translateTo(ClassGenerator classGen, MethodGenerator
methodGen,
Type type) {
if (type == Type.String) {
translateTo(classGen, methodGen, (StringType) type);
@@ -110,7 +115,7 @@
*
* @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
*/
- public void translateTo(ClassGenerator classGen, MethodGenerator
methodGen,
+ public void translateTo(ClassGenerator classGen, MethodGenerator
methodGen,
StringType type) {
final InstructionList il = methodGen.getInstructionList();
il.append(new PUSH(classGen.getConstantPool(), ""));
@@ -120,7 +125,7 @@
* Translates an external (primitive) Java type into a void.
* Only an external "void" can be converted to this class.
*/
- public void translateFrom(ClassGenerator classGen, MethodGenerator
methodGen,
+ public void translateFrom(ClassGenerator classGen, MethodGenerator
methodGen,
Class clazz) {
if (!clazz.getName().equals("void")) {
ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]