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/21 14:57:52 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java
morten 01/11/21 05:57:52
Modified: java/src/org/apache/xalan/xsltc/compiler/util
StringType.java
java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java
Log:
Fixed conversion between strings and numbers. Empty strings should return
0 and not NaN.
PR: bugzilla 4783
Obtained from: n/a
Submitted by: morten@xml.apache.org
Reviewed by: morten@xml.apache.org
Revision Changes Path
1.4 +2 -2 xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/StringType.java
Index: StringType.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/StringType.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- StringType.java 2001/10/30 15:35:30 1.3
+++ StringType.java 2001/11/21 13:57:52 1.4
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: StringType.java,v 1.3 2001/10/30 15:35:30 morten Exp $
+ * @(#)$Id: StringType.java,v 1.4 2001/11/21 13:57:52 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -138,7 +138,7 @@
*
* @see org.apache.xalan.xsltc.compiler.util.Type#translateTo
*/
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
+ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
RealType type) {
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
1.28 +2 -1 xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
Index: BasisLibrary.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- BasisLibrary.java 2001/10/31 11:18:18 1.27
+++ BasisLibrary.java 2001/11/21 13:57:52 1.28
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: BasisLibrary.java,v 1.27 2001/10/31 11:18:18 morten Exp $
+ * @(#)$Id: BasisLibrary.java,v 1.28 2001/11/21 13:57:52 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -805,6 +805,7 @@
*/
public static double stringToReal(String s) {
try {
+ if (s.length() == 0) return(0.0);
return Double.valueOf(s).doubleValue();
}
catch (NumberFormatException e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org