Jonathan Hart

Added Collections.emptyList() to Kryo BASIC namespace

Change-Id: Iabc7a0538184a71311b54a9093b75c55c293ccae
...@@ -42,7 +42,6 @@ import org.onosproject.store.serializers.KryoNamespaces; ...@@ -42,7 +42,6 @@ import org.onosproject.store.serializers.KryoNamespaces;
42 import org.slf4j.Logger; 42 import org.slf4j.Logger;
43 43
44 import java.util.ArrayList; 44 import java.util.ArrayList;
45 -import java.util.Collections;
46 import java.util.List; 45 import java.util.List;
47 46
48 import static com.google.common.base.Preconditions.checkArgument; 47 import static com.google.common.base.Preconditions.checkArgument;
...@@ -76,9 +75,7 @@ public class GossipIntentStore ...@@ -76,9 +75,7 @@ public class GossipIntentStore
76 @Activate 75 @Activate
77 public void activate() { 76 public void activate() {
78 KryoNamespace.Builder intentSerializer = KryoNamespace.newBuilder() 77 KryoNamespace.Builder intentSerializer = KryoNamespace.newBuilder()
79 - .register(KryoNamespaces.API) 78 + .register(KryoNamespaces.API);
80 - // TODO this should be in BASIC namespace
81 - .register(Collections.emptyList().getClass());
82 intents = new EventuallyConsistentMapImpl<>("intents", clusterService, 79 intents = new EventuallyConsistentMapImpl<>("intents", clusterService,
83 clusterCommunicator, 80 clusterCommunicator,
84 intentSerializer, 81 intentSerializer,
......
...@@ -15,16 +15,19 @@ ...@@ -15,16 +15,19 @@
15 */ 15 */
16 package org.onosproject.store.serializers; 16 package org.onosproject.store.serializers;
17 17
18 -import java.net.URI; 18 +import com.google.common.collect.ImmutableList;
19 -import java.time.Duration; 19 +import com.google.common.collect.ImmutableMap;
20 -import java.util.ArrayList; 20 +import com.google.common.collect.ImmutableSet;
21 -import java.util.Arrays; 21 +import org.onlab.packet.ChassisId;
22 -import java.util.Collections; 22 +import org.onlab.packet.Ip4Address;
23 -import java.util.HashMap; 23 +import org.onlab.packet.Ip4Prefix;
24 -import java.util.HashSet; 24 +import org.onlab.packet.Ip6Address;
25 -import java.util.LinkedList; 25 +import org.onlab.packet.Ip6Prefix;
26 -import java.util.Optional; 26 +import org.onlab.packet.IpAddress;
27 - 27 +import org.onlab.packet.IpPrefix;
28 +import org.onlab.packet.MacAddress;
29 +import org.onlab.packet.VlanId;
30 +import org.onlab.util.KryoNamespace;
28 import org.onosproject.cluster.ControllerNode; 31 import org.onosproject.cluster.ControllerNode;
29 import org.onosproject.cluster.DefaultControllerNode; 32 import org.onosproject.cluster.DefaultControllerNode;
30 import org.onosproject.cluster.Leadership; 33 import org.onosproject.cluster.Leadership;
...@@ -84,8 +87,8 @@ import org.onosproject.net.intent.OpticalConnectivityIntent; ...@@ -84,8 +87,8 @@ import org.onosproject.net.intent.OpticalConnectivityIntent;
84 import org.onosproject.net.intent.OpticalPathIntent; 87 import org.onosproject.net.intent.OpticalPathIntent;
85 import org.onosproject.net.intent.PathIntent; 88 import org.onosproject.net.intent.PathIntent;
86 import org.onosproject.net.intent.PointToPointIntent; 89 import org.onosproject.net.intent.PointToPointIntent;
87 -import org.onosproject.net.intent.constraint.AnnotationConstraint;
88 import org.onosproject.net.intent.SinglePointToMultiPointIntent; 90 import org.onosproject.net.intent.SinglePointToMultiPointIntent;
91 +import org.onosproject.net.intent.constraint.AnnotationConstraint;
89 import org.onosproject.net.intent.constraint.BandwidthConstraint; 92 import org.onosproject.net.intent.constraint.BandwidthConstraint;
90 import org.onosproject.net.intent.constraint.BooleanConstraint; 93 import org.onosproject.net.intent.constraint.BooleanConstraint;
91 import org.onosproject.net.intent.constraint.LambdaConstraint; 94 import org.onosproject.net.intent.constraint.LambdaConstraint;
...@@ -115,20 +118,16 @@ import org.onosproject.store.service.VersionedValue; ...@@ -115,20 +118,16 @@ import org.onosproject.store.service.VersionedValue;
115 import org.onosproject.store.service.WriteRequest; 118 import org.onosproject.store.service.WriteRequest;
116 import org.onosproject.store.service.WriteResult; 119 import org.onosproject.store.service.WriteResult;
117 import org.onosproject.store.service.WriteStatus; 120 import org.onosproject.store.service.WriteStatus;
118 -import org.onlab.packet.ChassisId;
119 -import org.onlab.packet.IpAddress;
120 -import org.onlab.packet.Ip4Address;
121 -import org.onlab.packet.Ip6Address;
122 -import org.onlab.packet.IpPrefix;
123 -import org.onlab.packet.Ip4Prefix;
124 -import org.onlab.packet.Ip6Prefix;
125 -import org.onlab.packet.MacAddress;
126 -import org.onlab.packet.VlanId;
127 -import org.onlab.util.KryoNamespace;
128 121
129 -import com.google.common.collect.ImmutableList; 122 +import java.net.URI;
130 -import com.google.common.collect.ImmutableMap; 123 +import java.time.Duration;
131 -import com.google.common.collect.ImmutableSet; 124 +import java.util.ArrayList;
125 +import java.util.Arrays;
126 +import java.util.Collections;
127 +import java.util.HashMap;
128 +import java.util.HashSet;
129 +import java.util.LinkedList;
130 +import java.util.Optional;
132 131
133 public final class KryoNamespaces { 132 public final class KryoNamespaces {
134 133
...@@ -159,6 +158,7 @@ public final class KryoNamespaces { ...@@ -159,6 +158,7 @@ public final class KryoNamespaces {
159 .register(Duration.class) 158 .register(Duration.class)
160 .register(Collections.emptySet().getClass()) 159 .register(Collections.emptySet().getClass())
161 .register(Optional.class) 160 .register(Optional.class)
161 + .register(Collections.emptyList().getClass())
162 .build(); 162 .build();
163 163
164 /** 164 /**
......