activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6016 - ensure xstream inits transients to default values when it bypasses the default creation method through object deserialization. Can make it more general if there are ever more instances
Date Fri, 30 Oct 2015 12:02:34 GMT
Repository: activemq
Updated Branches:
  refs/heads/master f8bfff0bc -> 8136e67b4


https://issues.apache.org/jira/browse/AMQ-6016 - ensure xstream inits transients to default
values when it bypasses the default creation method through object deserialization. Can make
it more general if there are ever more instances of this. It avoids the need to check for
null and sync


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

Branch: refs/heads/master
Commit: 8136e67b408a3d756241ebdf8de9347eb6135363
Parents: f8bfff0
Author: gtully <gary.tully@gmail.com>
Authored: Fri Oct 30 11:53:09 2015 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Fri Oct 30 12:01:08 2015 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/activemq/command/ConsumerInfo.java   | 5 +++++
 .../apache/activemq/transport/xstream/XStreamWireFormat.java  | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/8136e67b/activemq-client/src/main/java/org/apache/activemq/command/ConsumerInfo.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/command/ConsumerInfo.java b/activemq-client/src/main/java/org/apache/activemq/command/ConsumerInfo.java
index ed97a48..16e6f8c2 100755
--- a/activemq-client/src/main/java/org/apache/activemq/command/ConsumerInfo.java
+++ b/activemq-client/src/main/java/org/apache/activemq/command/ConsumerInfo.java
@@ -527,4 +527,9 @@ public class ConsumerInfo extends BaseCommand {
         return result;
     }
 
+    public void initTransients() {
+        assignedGroupCount = new ConcurrentHashMap<>();
+        lastDeliveredSequenceId = RemoveInfo.LAST_DELIVERED_UNSET;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/8136e67b/activemq-http/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
b/activemq-http/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
index 7174fdf..f98fc61 100755
--- a/activemq-http/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
+++ b/activemq-http/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
@@ -24,6 +24,7 @@ import com.thoughtworks.xstream.converters.MarshallingContext;
 import com.thoughtworks.xstream.converters.UnmarshallingContext;
 import com.thoughtworks.xstream.io.HierarchicalStreamReader;
 import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
+import org.apache.activemq.command.ConsumerInfo;
 import org.apache.activemq.command.MarshallAware;
 import org.apache.activemq.command.MessageDispatch;
 import org.apache.activemq.transport.stomp.XStreamSupport;
@@ -65,7 +66,11 @@ public class XStreamWireFormat extends TextWireFormat {
 
     @Override
     public Object unmarshalText(Reader reader) {
-        return getXStream().fromXML(reader);
+        Object val = getXStream().fromXML(reader);
+        if (val instanceof ConsumerInfo) {
+            ((ConsumerInfo)val).initTransients();
+        }
+        return val;
     }
 
     @Override


Mime
View raw message