cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: Updating JsonMapObject provider to ensure the update property history is preserved
Date Fri, 17 Oct 2014 12:46:24 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 683a2c6b3 -> 3f35e9997


Updating JsonMapObject provider to ensure the update property history is preserved


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

Branch: refs/heads/master
Commit: 3f35e9997563a21d9c5e4c50eef8eba2c3c38e73
Parents: 683a2c6
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Oct 17 13:45:46 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Oct 17 13:45:46 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/provider/json/JsonMapObject.java   | 3 +--
 .../cxf/jaxrs/provider/json/JsonMapObjectProvider.java      | 9 ++++++---
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/3f35e999/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObject.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObject.java
b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObject.java
index efecd88..1e6adcd 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObject.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObject.java
@@ -24,9 +24,8 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 
 public class JsonMapObject {
+    Map<String, Integer> updateCount;
     private Map<String, Object> values = new LinkedHashMap<String, Object>();
-    private Map<String, Integer> updateCount;
-    
     public JsonMapObject() {
         
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/3f35e999/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectProvider.java
b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectProvider.java
index f8fea4b..9387a7d 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectProvider.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectProvider.java
@@ -69,13 +69,16 @@ public class JsonMapObjectProvider implements MessageBodyReader<JsonMapObject>,
                                   MultivaluedMap<String, String> headers, InputStream
is) throws IOException,
         WebApplicationException {
         String s = IOUtils.readStringFromStream(is);
-        Map<String, Object> jsonMap = handler.fromJson(s);
+        JsonMapObject obj = new JsonMapObject(); 
+        handler.fromJson(obj, s);
         if (cls == JsonMapObject.class) {
-            return new JsonMapObject(jsonMap);
+            return obj;
         } else {
             try {
                 Constructor<?> c = cls.getConstructor(Map.class);
-                return (JsonMapObject)c.newInstance(jsonMap);
+                JsonMapObject actualObj = (JsonMapObject)c.newInstance(obj.asMap());
+                actualObj.updateCount = obj.updateCount;
+                return actualObj;
             } catch (Exception ex) {
                 throw new IOException(ex);
             }


Mime
View raw message