Collections.emptyMap() produces an object that Kryo cannot serialize
Change-Id: I12c105ecbcff560a62e5e883f18c0e75dd69c078
Showing
2 changed files
with
8 additions
and
11 deletions
| ... | @@ -16,21 +16,19 @@ | ... | @@ -16,21 +16,19 @@ |
| 16 | 16 | ||
| 17 | package org.onosproject.net.intent; | 17 | package org.onosproject.net.intent; |
| 18 | 18 | ||
| 19 | -import java.util.Collections; | ||
| 20 | -import java.util.List; | ||
| 21 | -import java.util.Map; | ||
| 22 | -import java.util.Set; | ||
| 23 | - | ||
| 24 | import com.google.common.annotations.Beta; | 19 | import com.google.common.annotations.Beta; |
| 20 | +import com.google.common.base.MoreObjects; | ||
| 25 | import com.google.common.collect.ImmutableMap; | 21 | import com.google.common.collect.ImmutableMap; |
| 22 | +import com.google.common.collect.ImmutableSet; | ||
| 26 | import org.onosproject.core.ApplicationId; | 23 | import org.onosproject.core.ApplicationId; |
| 27 | import org.onosproject.net.ConnectPoint; | 24 | import org.onosproject.net.ConnectPoint; |
| 28 | import org.onosproject.net.Link; | 25 | import org.onosproject.net.Link; |
| 29 | import org.onosproject.net.flow.TrafficSelector; | 26 | import org.onosproject.net.flow.TrafficSelector; |
| 30 | import org.onosproject.net.flow.TrafficTreatment; | 27 | import org.onosproject.net.flow.TrafficTreatment; |
| 31 | 28 | ||
| 32 | -import com.google.common.base.MoreObjects; | 29 | +import java.util.List; |
| 33 | -import com.google.common.collect.ImmutableSet; | 30 | +import java.util.Map; |
| 31 | +import java.util.Set; | ||
| 34 | 32 | ||
| 35 | /** | 33 | /** |
| 36 | * Abstraction of a connectivity intent that is implemented by a set of path | 34 | * Abstraction of a connectivity intent that is implemented by a set of path |
| ... | @@ -118,7 +116,7 @@ public final class LinkCollectionIntent extends ConnectivityIntent { | ... | @@ -118,7 +116,7 @@ public final class LinkCollectionIntent extends ConnectivityIntent { |
| 118 | Set<Link> links; | 116 | Set<Link> links; |
| 119 | Set<ConnectPoint> ingressPoints; | 117 | Set<ConnectPoint> ingressPoints; |
| 120 | Set<ConnectPoint> egressPoints; | 118 | Set<ConnectPoint> egressPoints; |
| 121 | - Map<ConnectPoint, TrafficSelector> ingressSelectors = Collections.emptyMap(); | 119 | + Map<ConnectPoint, TrafficSelector> ingressSelectors = ImmutableMap.of(); |
| 122 | boolean egressTreatmentFlag; | 120 | boolean egressTreatmentFlag; |
| 123 | 121 | ||
| 124 | private Builder() { | 122 | private Builder() { | ... | ... |
| ... | @@ -25,7 +25,6 @@ import org.onosproject.net.ConnectPoint; | ... | @@ -25,7 +25,6 @@ import org.onosproject.net.ConnectPoint; |
| 25 | import org.onosproject.net.flow.TrafficSelector; | 25 | import org.onosproject.net.flow.TrafficSelector; |
| 26 | import org.onosproject.net.flow.TrafficTreatment; | 26 | import org.onosproject.net.flow.TrafficTreatment; |
| 27 | 27 | ||
| 28 | -import java.util.Collections; | ||
| 29 | import java.util.List; | 28 | import java.util.List; |
| 30 | import java.util.Map; | 29 | import java.util.Map; |
| 31 | import java.util.Set; | 30 | import java.util.Set; |
| ... | @@ -74,7 +73,7 @@ public final class MultiPointToSinglePointIntent extends ConnectivityIntent { | ... | @@ -74,7 +73,7 @@ public final class MultiPointToSinglePointIntent extends ConnectivityIntent { |
| 74 | int priority, | 73 | int priority, |
| 75 | Map<ConnectPoint, TrafficSelector> ingressSelectors | 74 | Map<ConnectPoint, TrafficSelector> ingressSelectors |
| 76 | ) { | 75 | ) { |
| 77 | - super(appId, key, Collections.emptyList(), selector, treatment, constraints, | 76 | + super(appId, key, ImmutableSet.of(), selector, treatment, constraints, |
| 78 | priority); | 77 | priority); |
| 79 | 78 | ||
| 80 | checkNotNull(ingressPoints); | 79 | checkNotNull(ingressPoints); |
| ... | @@ -127,7 +126,7 @@ public final class MultiPointToSinglePointIntent extends ConnectivityIntent { | ... | @@ -127,7 +126,7 @@ public final class MultiPointToSinglePointIntent extends ConnectivityIntent { |
| 127 | public static final class Builder extends ConnectivityIntent.Builder { | 126 | public static final class Builder extends ConnectivityIntent.Builder { |
| 128 | Set<ConnectPoint> ingressPoints; | 127 | Set<ConnectPoint> ingressPoints; |
| 129 | ConnectPoint egressPoint; | 128 | ConnectPoint egressPoint; |
| 130 | - Map<ConnectPoint, TrafficSelector> ingressSelectors = Collections.emptyMap(); | 129 | + Map<ConnectPoint, TrafficSelector> ingressSelectors = ImmutableMap.of(); |
| 131 | 130 | ||
| 132 | private Builder() { | 131 | private Builder() { |
| 133 | // Hide constructor | 132 | // Hide constructor | ... | ... |
-
Please register or login to post a comment