Commit a6667981 authored by afreyssin's avatar afreyssin
Browse files

Clone the message to avoid modification of source message in the acquisition destination.

parent 8fa4547f
......@@ -50,7 +50,7 @@ public class DistributionHandlerTest implements DistributionHandler {
}
private static synchronized void addMessage(Message msg) {
messages.add(msg);
messages.add(msg.clone());
}
public static synchronized List getAllMessages() {
......
......@@ -53,7 +53,7 @@ public class DistributionHandlerTest2 implements DistributionHandler {
}
private static synchronized void addMessage(Message msg) {
messages.add(msg);
messages.add(msg.clone());
}
public static synchronized List getAllMessages() {
......
......@@ -44,7 +44,9 @@ public class DistributionHandlerTest3 implements DistributionHandler {
}
private static synchronized void addMessage(Message msg) {
messages.add(msg);
// Be careful, clone the message to avoid modification of source message
// in the acquisition destination.
messages.add(msg.clone());
}
public static synchronized List getAllMessages() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment