Fix some unchecked conversion warnings
Change-Id: I5cfb0fceb6ab1d200fb1d7e9849ce458a2aa8ac7
Showing
5 changed files
with
18 additions
and
10 deletions
... | @@ -15,6 +15,7 @@ public class TestEventDispatcher extends DefaultEventSinkRegistry | ... | @@ -15,6 +15,7 @@ public class TestEventDispatcher extends DefaultEventSinkRegistry |
15 | implements EventDeliveryService { | 15 | implements EventDeliveryService { |
16 | 16 | ||
17 | @Override | 17 | @Override |
18 | + @SuppressWarnings("unchecked") | ||
18 | public void post(Event event) { | 19 | public void post(Event event) { |
19 | EventSink sink = getSink(event.getClass()); | 20 | EventSink sink = getSink(event.getClass()); |
20 | checkState(sink != null, "No sink for event %s", event); | 21 | checkState(sink != null, "No sink for event %s", event); | ... | ... |
1 | package org.onlab.onos.net.flow.impl; | 1 | package org.onlab.onos.net.flow.impl; |
2 | 2 | ||
3 | -import static java.util.Collections.EMPTY_LIST; | ||
4 | -import static org.junit.Assert.assertEquals; | ||
5 | -import static org.junit.Assert.assertFalse; | ||
6 | -import static org.junit.Assert.assertNotNull; | ||
7 | -import static org.junit.Assert.assertTrue; | ||
8 | -import static org.junit.Assert.fail; | ||
9 | -import static org.onlab.onos.net.flow.FlowRuleEvent.Type.RULE_ADDED; | ||
10 | -import static org.onlab.onos.net.flow.FlowRuleEvent.Type.RULE_REMOVED; | ||
11 | -import static org.onlab.onos.net.flow.FlowRuleEvent.Type.RULE_UPDATED; | ||
12 | - | ||
13 | import java.util.ArrayList; | 3 | import java.util.ArrayList; |
14 | import java.util.Collections; | 4 | import java.util.Collections; |
15 | import java.util.HashMap; | 5 | import java.util.HashMap; |
... | @@ -65,6 +55,16 @@ import com.google.common.collect.ImmutableMap; | ... | @@ -65,6 +55,16 @@ import com.google.common.collect.ImmutableMap; |
65 | import com.google.common.collect.Lists; | 55 | import com.google.common.collect.Lists; |
66 | import com.google.common.collect.Sets; | 56 | import com.google.common.collect.Sets; |
67 | 57 | ||
58 | +import static java.util.Collections.EMPTY_LIST; | ||
59 | +import static org.junit.Assert.assertEquals; | ||
60 | +import static org.junit.Assert.assertFalse; | ||
61 | +import static org.junit.Assert.assertNotNull; | ||
62 | +import static org.junit.Assert.assertTrue; | ||
63 | +import static org.junit.Assert.fail; | ||
64 | +import static org.onlab.onos.net.flow.FlowRuleEvent.Type.RULE_ADDED; | ||
65 | +import static org.onlab.onos.net.flow.FlowRuleEvent.Type.RULE_REMOVED; | ||
66 | +import static org.onlab.onos.net.flow.FlowRuleEvent.Type.RULE_UPDATED; | ||
67 | + | ||
68 | /** | 68 | /** |
69 | * Test codifying the flow rule service & flow rule provider service contracts. | 69 | * Test codifying the flow rule service & flow rule provider service contracts. |
70 | */ | 70 | */ |
... | @@ -176,6 +176,7 @@ public class FlowRuleManagerTest { | ... | @@ -176,6 +176,7 @@ public class FlowRuleManagerTest { |
176 | 176 | ||
177 | // TODO: If preserving iteration order is a requirement, redo FlowRuleStore. | 177 | // TODO: If preserving iteration order is a requirement, redo FlowRuleStore. |
178 | //backing store is sensitive to the order of additions/removals | 178 | //backing store is sensitive to the order of additions/removals |
179 | + @SuppressWarnings("unchecked") | ||
179 | private boolean validateState(Map<FlowRule, FlowEntryState> expected) { | 180 | private boolean validateState(Map<FlowRule, FlowEntryState> expected) { |
180 | Map<FlowRule, FlowEntryState> expectedToCheck = new HashMap<>(expected); | 181 | Map<FlowRule, FlowEntryState> expectedToCheck = new HashMap<>(expected); |
181 | Iterable<FlowEntry> rules = service.getFlowEntries(DID); | 182 | Iterable<FlowEntry> rules = service.getFlowEntries(DID); |
... | @@ -539,6 +540,7 @@ public class FlowRuleManagerTest { | ... | @@ -539,6 +540,7 @@ public class FlowRuleManagerTest { |
539 | } | 540 | } |
540 | 541 | ||
541 | @Override | 542 | @Override |
543 | + @SuppressWarnings("unchecked") | ||
542 | public CompletedBatchOperation get() | 544 | public CompletedBatchOperation get() |
543 | throws InterruptedException, ExecutionException { | 545 | throws InterruptedException, ExecutionException { |
544 | return new CompletedBatchOperation(true, EMPTY_LIST); | 546 | return new CompletedBatchOperation(true, EMPTY_LIST); | ... | ... |
... | @@ -35,6 +35,8 @@ public class InternalDeviceEventSerializer extends Serializer<InternalDeviceEven | ... | @@ -35,6 +35,8 @@ public class InternalDeviceEventSerializer extends Serializer<InternalDeviceEven |
35 | Class<InternalDeviceEvent> type) { | 35 | Class<InternalDeviceEvent> type) { |
36 | ProviderId providerId = (ProviderId) kryo.readClassAndObject(input); | 36 | ProviderId providerId = (ProviderId) kryo.readClassAndObject(input); |
37 | DeviceId deviceId = (DeviceId) kryo.readClassAndObject(input); | 37 | DeviceId deviceId = (DeviceId) kryo.readClassAndObject(input); |
38 | + | ||
39 | + @SuppressWarnings("unchecked") | ||
38 | Timestamped<DeviceDescription> deviceDescription | 40 | Timestamped<DeviceDescription> deviceDescription |
39 | = (Timestamped<DeviceDescription>) kryo.readClassAndObject(input); | 41 | = (Timestamped<DeviceDescription>) kryo.readClassAndObject(input); |
40 | 42 | ... | ... |
... | @@ -37,6 +37,8 @@ public class InternalPortEventSerializer extends Serializer<InternalPortEvent> { | ... | @@ -37,6 +37,8 @@ public class InternalPortEventSerializer extends Serializer<InternalPortEvent> { |
37 | Class<InternalPortEvent> type) { | 37 | Class<InternalPortEvent> type) { |
38 | ProviderId providerId = (ProviderId) kryo.readClassAndObject(input); | 38 | ProviderId providerId = (ProviderId) kryo.readClassAndObject(input); |
39 | DeviceId deviceId = (DeviceId) kryo.readClassAndObject(input); | 39 | DeviceId deviceId = (DeviceId) kryo.readClassAndObject(input); |
40 | + | ||
41 | + @SuppressWarnings("unchecked") | ||
40 | Timestamped<List<PortDescription>> portDescriptions | 42 | Timestamped<List<PortDescription>> portDescriptions |
41 | = (Timestamped<List<PortDescription>>) kryo.readClassAndObject(input); | 43 | = (Timestamped<List<PortDescription>>) kryo.readClassAndObject(input); |
42 | 44 | ... | ... |
... | @@ -6,6 +6,7 @@ import com.google.common.collect.MutableClassToInstanceMap; | ... | @@ -6,6 +6,7 @@ import com.google.common.collect.MutableClassToInstanceMap; |
6 | /** | 6 | /** |
7 | * Service directory implementation suitable for testing. | 7 | * Service directory implementation suitable for testing. |
8 | */ | 8 | */ |
9 | +@SuppressWarnings("unchecked") | ||
9 | public class TestServiceDirectory implements ServiceDirectory { | 10 | public class TestServiceDirectory implements ServiceDirectory { |
10 | 11 | ||
11 | private ClassToInstanceMap<Object> services = MutableClassToInstanceMap.create(); | 12 | private ClassToInstanceMap<Object> services = MutableClassToInstanceMap.create(); | ... | ... |
-
Please register or login to post a comment