Committed by
Gerrit Code Review
Create of immutable copy of set in the constructor. Fixes a kryo serialization bug
Change-Id: Ib4e5ae9330fc7e7fecb45bd0e65c9cd166f4f8b4
Showing
1 changed file
with
3 additions
and
1 deletions
... | @@ -16,7 +16,9 @@ | ... | @@ -16,7 +16,9 @@ |
16 | package org.onosproject.store.resource.impl; | 16 | package org.onosproject.store.resource.impl; |
17 | 17 | ||
18 | import com.google.common.base.MoreObjects; | 18 | import com.google.common.base.MoreObjects; |
19 | +import com.google.common.collect.ImmutableSet; | ||
19 | import com.google.common.collect.Sets; | 20 | import com.google.common.collect.Sets; |
21 | + | ||
20 | import org.onosproject.net.resource.DiscreteResource; | 22 | import org.onosproject.net.resource.DiscreteResource; |
21 | import org.onosproject.net.resource.DiscreteResourceId; | 23 | import org.onosproject.net.resource.DiscreteResourceId; |
22 | import org.onosproject.net.resource.Resources; | 24 | import org.onosproject.net.resource.Resources; |
... | @@ -39,7 +41,7 @@ final class GenericDiscreteResources implements DiscreteResources { | ... | @@ -39,7 +41,7 @@ final class GenericDiscreteResources implements DiscreteResources { |
39 | } | 41 | } |
40 | 42 | ||
41 | private GenericDiscreteResources(Set<DiscreteResource> values) { | 43 | private GenericDiscreteResources(Set<DiscreteResource> values) { |
42 | - this.values = values; | 44 | + this.values = ImmutableSet.copyOf(values); |
43 | } | 45 | } |
44 | 46 | ||
45 | // for serializer | 47 | // for serializer | ... | ... |
-
Please register or login to post a comment