Return-Path: Delivered-To: apmail-xml-xalan-cvs-archive@xml.apache.org Received: (qmail 91683 invoked by uid 500); 20 Mar 2003 10:49:25 -0000 Mailing-List: contact xalan-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: Delivered-To: mailing list xalan-cvs@xml.apache.org Received: (qmail 91664 invoked from network); 20 Mar 2003 10:49:25 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 20 Mar 2003 10:49:25 -0000 Received: (qmail 96103 invoked by uid 1538); 20 Mar 2003 10:49:23 -0000 Date: 20 Mar 2003 10:49:23 -0000 Message-ID: <20030320104923.96096.qmail@icarus.apache.org> From: zongaro@apache.org To: xml-xalan-cvs@apache.org Subject: cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util VoidType.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 type. * 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: xalan-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: xalan-cvs-help@xml.apache.org