ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject [1/2] git commit: fixes ODE-570: Integer to string conversion does not work as expected.
Date Tue, 27 Aug 2013 20:45:48 GMT
Updated Branches:
  refs/heads/ode-1.3.6.x 96551b9ba -> ec0213f89


fixes ODE-570: Integer to string conversion does not work as expected.


Project: http://git-wip-us.apache.org/repos/asf/ode/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/70c76604
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/70c76604
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/70c76604

Branch: refs/heads/ode-1.3.6.x
Commit: 70c766040de26d2ef5cbcacebfaf4d8fb9f2a6e2
Parents: 56bb4f7
Author: Tammo van Lessen <tvanlessen@gmail.com>
Authored: Tue Aug 27 22:44:36 2013 +0200
Committer: Tammo van Lessen <tvanlessen@gmail.com>
Committed: Tue Aug 27 22:44:36 2013 +0200

----------------------------------------------------------------------
 .../elang/xpath10/runtime/XPath10ExpressionRuntime.java | 12 +++++++++++-
 dependencies.rb                                         |  2 +-
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ode/blob/70c76604/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java
----------------------------------------------------------------------
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java
b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java
index 70f0b9e..3580393 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java
@@ -107,7 +107,17 @@ public class XPath10ExpressionRuntime implements ExpressionLanguageRuntime
{
                 // Giving our node a parent just in case it's an LValue
                 // expression
                 Element wrapper = d.createElement("wrapper");
-                Text text = d.createTextNode(retVal.get(0).toString());
+                Object ret = retVal.get(0);
+                
+                if (ret instanceof Double) {
+                    // safely convert a double into a long if they are numerically equal.
This
+                    // makes 1 from 1.0, which is more reliable when calling web services.
+                    if (Double.compare((Double)ret, Math.ceil((Double)ret)) == 0) {
+                        // the double is actually an int/long
+                        ret = ((Double)ret).longValue();
+                    }
+                }
+                Text text = d.createTextNode(ret.toString());
                 wrapper.appendChild(text);
                 d.appendChild(wrapper);
                 retVal = Collections.singletonList(text);

http://git-wip-us.apache.org/repos/asf/ode/blob/70c76604/dependencies.rb
----------------------------------------------------------------------
diff --git a/dependencies.rb b/dependencies.rb
index f2a1e3a..874b241 100644
--- a/dependencies.rb
+++ b/dependencies.rb
@@ -87,7 +87,7 @@ JAVAX               = struct(
   :transaction      =>"org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1",
   :resource         =>"org.apache.geronimo.specs:geronimo-j2ee-connector_1.5_spec:jar:1.0"
 )
-JAXEN               = "jaxen:jaxen:jar:1.1.3"
+JAXEN               = "jaxen:jaxen:jar:1.1.4"
 JBI                 = group("org.apache.servicemix.specs.jbi-api-1.0", :under=>"org.apache.servicemix.specs",
:version=>"1.1.0")
 JENCKS              = "org.jencks:jencks:jar:all:1.3"
 JIBX                = "org.jibx:jibx-run:jar:1.2.1"


Mime
View raw message