cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6166] Trying to convert to Double if the conversion to Long fails, patch from Daniel Torkian applied
Date Tue, 06 Jan 2015 08:39:42 GMT
Repository: cxf
Updated Branches:
  refs/heads/master e84bdde24 -> de09800f0


[CXF-6166] Trying to convert to Double if the conversion to Long fails, patch from Daniel
Torkian applied


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

Branch: refs/heads/master
Commit: de09800f082056b3cb4f62a13ff6fc4e0b9e4608
Parents: e84bdde
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Jan 6 11:39:22 2015 +0300
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Jan 6 11:39:22 2015 +0300

----------------------------------------------------------------------
 .../cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/de09800f/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java
b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java
index 343bad5..dac1459 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java
@@ -201,7 +201,11 @@ public class JsonMapObjectReaderWriter {
         } else if ("true".equals(value) || "false".equals(value)) {
             value = Boolean.valueOf(valueStr);
         } else {
-            value = Long.valueOf(valueStr);
+            try {
+                value = Long.valueOf(valueStr);
+            } catch (NumberFormatException ex) {
+                value = Double.valueOf(valueStr);
+            }
         }
         return value;
     }


Mime
View raw message