Yuta HIGUCHI

serialization related fixes for flow related classes

Change-Id: Id7e1241cc73645bd87b61eac4ca45acd35ad22ca
...@@ -8,7 +8,6 @@ import org.onlab.packet.IpPrefix; ...@@ -8,7 +8,6 @@ import org.onlab.packet.IpPrefix;
8 import org.onlab.packet.MacAddress; 8 import org.onlab.packet.MacAddress;
9 import org.onlab.packet.VlanId; 9 import org.onlab.packet.VlanId;
10 10
11 -import java.util.Collections;
12 import java.util.HashMap; 11 import java.util.HashMap;
13 import java.util.Map; 12 import java.util.Map;
14 import java.util.Objects; 13 import java.util.Objects;
...@@ -27,7 +26,7 @@ public final class DefaultTrafficSelector implements TrafficSelector { ...@@ -27,7 +26,7 @@ public final class DefaultTrafficSelector implements TrafficSelector {
27 * @param criteria criteria 26 * @param criteria criteria
28 */ 27 */
29 private DefaultTrafficSelector(Set<Criterion> criteria) { 28 private DefaultTrafficSelector(Set<Criterion> criteria) {
30 - this.criteria = Collections.unmodifiableSet(criteria); 29 + this.criteria = ImmutableSet.copyOf(criteria);
31 } 30 }
32 31
33 @Override 32 @Override
......
...@@ -7,7 +7,8 @@ import org.onlab.packet.IpPrefix; ...@@ -7,7 +7,8 @@ import org.onlab.packet.IpPrefix;
7 import org.onlab.packet.MacAddress; 7 import org.onlab.packet.MacAddress;
8 import org.onlab.packet.VlanId; 8 import org.onlab.packet.VlanId;
9 9
10 -import java.util.Collections; 10 +import com.google.common.collect.ImmutableList;
11 +
11 import java.util.LinkedList; 12 import java.util.LinkedList;
12 import java.util.List; 13 import java.util.List;
13 import java.util.Objects; 14 import java.util.Objects;
...@@ -25,7 +26,7 @@ public final class DefaultTrafficTreatment implements TrafficTreatment { ...@@ -25,7 +26,7 @@ public final class DefaultTrafficTreatment implements TrafficTreatment {
25 * @param instructions treatment instructions 26 * @param instructions treatment instructions
26 */ 27 */
27 private DefaultTrafficTreatment(List<Instruction> instructions) { 28 private DefaultTrafficTreatment(List<Instruction> instructions) {
28 - this.instructions = Collections.unmodifiableList(instructions); 29 + this.instructions = ImmutableList.copyOf(instructions);
29 } 30 }
30 31
31 @Override 32 @Override
......
...@@ -26,6 +26,7 @@ import org.onlab.onos.net.PortNumber; ...@@ -26,6 +26,7 @@ import org.onlab.onos.net.PortNumber;
26 import org.onlab.onos.net.device.DefaultDeviceDescription; 26 import org.onlab.onos.net.device.DefaultDeviceDescription;
27 import org.onlab.onos.net.device.DefaultPortDescription; 27 import org.onlab.onos.net.device.DefaultPortDescription;
28 import org.onlab.onos.net.flow.DefaultFlowRule; 28 import org.onlab.onos.net.flow.DefaultFlowRule;
29 +import org.onlab.onos.net.flow.DefaultTrafficSelector;
29 import org.onlab.onos.net.flow.FlowId; 30 import org.onlab.onos.net.flow.FlowId;
30 import org.onlab.onos.net.host.DefaultHostDescription; 31 import org.onlab.onos.net.host.DefaultHostDescription;
31 import org.onlab.onos.net.host.HostDescription; 32 import org.onlab.onos.net.host.HostDescription;
...@@ -88,7 +89,8 @@ public final class KryoNamespaces { ...@@ -88,7 +89,8 @@ public final class KryoNamespaces {
88 HostDescription.class, 89 HostDescription.class,
89 DefaultHostDescription.class, 90 DefaultHostDescription.class,
90 DefaultFlowRule.class, 91 DefaultFlowRule.class,
91 - FlowId.class 92 + FlowId.class,
93 + DefaultTrafficSelector.class
92 ) 94 )
93 .register(URI.class, new URISerializer()) 95 .register(URI.class, new URISerializer())
94 .register(NodeId.class, new NodeIdSerializer()) 96 .register(NodeId.class, new NodeIdSerializer())
......