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/609bfcf9 Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/609bfcf9 Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/609bfcf9 Branch: refs/heads/master Commit: 609bfcf9b4919def46de3d350faefe921465d7ec Parents: b7a7025 Author: Tammo van Lessen <[email protected]> Authored: Tue Aug 27 22:44:36 2013 +0200 Committer: Tammo van Lessen <[email protected]> Committed: Thu Aug 29 23:44:43 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/609bfcf9/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 49e327c..d8986f1 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/609bfcf9/dependencies.rb ---------------------------------------------------------------------- diff --git a/dependencies.rb b/dependencies.rb index 5709e31..baa7cf3 100644 --- a/dependencies.rb +++ b/dependencies.rb @@ -88,7 +88,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"
