You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mo...@apache.org on 2001/11/22 15:41:59 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Message.java
morten 01/11/22 06:41:59
Modified: java/src/org/apache/xalan/xsltc/compiler Message.java
Log:
A cleanup in the Message class. Making way for a fix for 4874
Submitted by: morten@xml.apache.org
Reviewed by: morten@xml.apache.org
Revision Changes Path
1.4 +11 -24 xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Message.java
Index: Message.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Message.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Message.java 2001/06/06 10:45:14 1.3
+++ Message.java 2001/11/22 14:41:59 1.4
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Message.java,v 1.3 2001/06/06 10:45:14 morten Exp $
+ * @(#)$Id: Message.java,v 1.4 2001/11/22 14:41:59 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -90,28 +90,18 @@
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
-
- // Save the current handler base on the stack
- il.append(methodGen.loadHandler());
- // Get the translet's StringValueHandler
- il.append(classGen.loadTranslet());
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- "stringValueHandler",
- STRING_VALUE_HANDLER_SIG)));
- il.append(DUP);
- il.append(methodGen.storeHandler());
-
- // Translate contents with substituted handler
- translateContents(classGen, methodGen);
-
- // Get string from all children from the handler
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_VALUE_HANDLER,
- "getValue",
- "()" + STRING_SIG)));
- // Push the this pointer on the stack
+
+ // Load the translet (for call to displayMessage() function)
il.append(classGen.loadTranslet());
- il.append(SWAP);
+ // Get the contents of the message
+ compileResultTree(classGen, methodGen);
+ // Convert the
+ final int toStr = cpg.addInterfaceMethodref(DOM_INTF,
+ "getStringValue",
+ "()"+STRING_SIG);
+ il.append(new INVOKEINTERFACE(toStr, 1));
+
// Send the resulting string to the message handling method
il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
"displayMessage",
@@ -131,9 +121,6 @@
il.append(new INVOKESPECIAL(einit));
il.append(ATHROW);
}
-
- // Clean up: Restore/pop old handler base from stack
- il.append(methodGen.storeHandler());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org