Remove explicit type parameters which can be inferred
Change-Id: I62cd4df252bab6208e1b1cd37f8f8757b0cfc17e
diff --git a/core/api/src/main/java/org/onosproject/net/PortNumber.java b/core/api/src/main/java/org/onosproject/net/PortNumber.java
index df45c54..dd77d0c 100644
--- a/core/api/src/main/java/org/onosproject/net/PortNumber.java
+++ b/core/api/src/main/java/org/onosproject/net/PortNumber.java
@@ -95,7 +95,7 @@
// lazily populated Logical port number to PortNumber
static final Supplier<Map<Long, Logical>> LOGICAL = Suppliers.memoize(() -> {
- Builder<Long, Logical> builder = ImmutableMap.<Long, Logical>builder();
+ Builder<Long, Logical> builder = ImmutableMap.builder();
for (Logical lp : Logical.values()) {
builder.put(lp.number(), lp);
}
diff --git a/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java b/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java
index 915892b..3503eca 100644
--- a/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java
+++ b/core/api/src/main/java/org/onosproject/net/host/DefaultHostDescription.java
@@ -52,7 +52,7 @@
public DefaultHostDescription(MacAddress mac, VlanId vlan,
HostLocation location,
SparseAnnotations... annotations) {
- this(mac, vlan, location, Collections.<IpAddress>emptySet(),
+ this(mac, vlan, location, Collections.emptySet(),
annotations);
}
diff --git a/core/api/src/test/java/org/onosproject/store/service/VersionedTest.java b/core/api/src/test/java/org/onosproject/store/service/VersionedTest.java
index 86c497c..2533abe 100644
--- a/core/api/src/test/java/org/onosproject/store/service/VersionedTest.java
+++ b/core/api/src/test/java/org/onosproject/store/service/VersionedTest.java
@@ -54,7 +54,7 @@
*/
@Test
public void testMap() {
- Versioned<String> tempObj = stats1.<String>map(VersionedTest::transform);
+ Versioned<String> tempObj = stats1.map(VersionedTest::transform);
assertThat(tempObj.value(), is("1"));
}
diff --git a/core/common/src/test/java/org/onosproject/store/trivial/SimpleApplicationIdStore.java b/core/common/src/test/java/org/onosproject/store/trivial/SimpleApplicationIdStore.java
index a6b2f20..2999639 100644
--- a/core/common/src/test/java/org/onosproject/store/trivial/SimpleApplicationIdStore.java
+++ b/core/common/src/test/java/org/onosproject/store/trivial/SimpleApplicationIdStore.java
@@ -42,7 +42,7 @@
@Override
public Set<ApplicationId> getAppIds() {
- return ImmutableSet.<ApplicationId>copyOf(appIds.values());
+ return ImmutableSet.copyOf(appIds.values());
}
@Override
diff --git a/core/common/src/test/java/org/onosproject/store/trivial/SimpleDeviceStore.java b/core/common/src/test/java/org/onosproject/store/trivial/SimpleDeviceStore.java
index b51a1d1..14e37b8 100644
--- a/core/common/src/test/java/org/onosproject/store/trivial/SimpleDeviceStore.java
+++ b/core/common/src/test/java/org/onosproject/store/trivial/SimpleDeviceStore.java
@@ -348,7 +348,7 @@
// exist, it creates and registers a new one.
private ConcurrentMap<PortNumber, Port> getPortMap(DeviceId deviceId) {
return createIfAbsentUnchecked(devicePorts, deviceId,
- NewConcurrentHashMap.<PortNumber, Port>ifNeeded());
+ NewConcurrentHashMap.ifNeeded());
}
private Map<ProviderId, DeviceDescriptions> getOrCreateDeviceDescriptions(
diff --git a/core/common/src/test/java/org/onosproject/store/trivial/SimpleDeviceStoreTest.java b/core/common/src/test/java/org/onosproject/store/trivial/SimpleDeviceStoreTest.java
index b71faef..f8eb1ba 100644
--- a/core/common/src/test/java/org/onosproject/store/trivial/SimpleDeviceStoreTest.java
+++ b/core/common/src/test/java/org/onosproject/store/trivial/SimpleDeviceStoreTest.java
@@ -265,7 +265,7 @@
@Test
public final void testUpdatePorts() {
putDevice(DID1, SW1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true),
new DefaultPortDescription(P2, true)
);
@@ -283,7 +283,7 @@
assertTrue("Event for all expectedport appeared", expectedPorts.isEmpty());
- List<PortDescription> pds2 = Arrays.<PortDescription>asList(
+ List<PortDescription> pds2 = Arrays.asList(
new DefaultPortDescription(P1, false),
new DefaultPortDescription(P2, true),
new DefaultPortDescription(P3, true)
@@ -308,7 +308,7 @@
}
}
- List<PortDescription> pds3 = Arrays.<PortDescription>asList(
+ List<PortDescription> pds3 = Arrays.asList(
new DefaultPortDescription(P1, false),
new DefaultPortDescription(P2, true)
);
@@ -334,7 +334,7 @@
@Test
public final void testUpdatePortStatus() {
putDevice(DID1, SW1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true)
);
deviceStore.updatePorts(PID, DID1, pds);
@@ -352,7 +352,7 @@
public final void testUpdatePortStatusAncillary() {
putDeviceAncillary(DID1, SW1);
putDevice(DID1, SW1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true, A1)
);
deviceStore.updatePorts(PID, DID1, pds);
@@ -416,7 +416,7 @@
public final void testGetPort() {
putDevice(DID1, SW1);
putDevice(DID2, SW1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true),
new DefaultPortDescription(P2, false)
);
@@ -437,7 +437,7 @@
@Test
public final void testRemoveDevice() {
putDevice(DID1, SW1, A1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true, A2)
);
deviceStore.updatePorts(PID, DID1, pds);
@@ -457,7 +457,7 @@
// putBack Device, Port w/o annotation
putDevice(DID1, SW1);
- List<PortDescription> pds2 = Arrays.<PortDescription>asList(
+ List<PortDescription> pds2 = Arrays.asList(
new DefaultPortDescription(P1, true)
);
deviceStore.updatePorts(PID, DID1, pds2);
diff --git a/core/common/src/test/java/org/onosproject/store/trivial/SimpleFlowRuleStore.java b/core/common/src/test/java/org/onosproject/store/trivial/SimpleFlowRuleStore.java
index 8924b61..bc8805d 100644
--- a/core/common/src/test/java/org/onosproject/store/trivial/SimpleFlowRuleStore.java
+++ b/core/common/src/test/java/org/onosproject/store/trivial/SimpleFlowRuleStore.java
@@ -164,7 +164,7 @@
}
private static NewConcurrentHashMap<FlowId, List<StoredFlowEntry>> lazyEmptyFlowTable() {
- return NewConcurrentHashMap.<FlowId, List<StoredFlowEntry>>ifNeeded();
+ return NewConcurrentHashMap.ifNeeded();
}
/**
diff --git a/core/common/src/test/java/org/onosproject/store/trivial/SimpleGroupStore.java b/core/common/src/test/java/org/onosproject/store/trivial/SimpleGroupStore.java
index 213244f..e019ed9 100644
--- a/core/common/src/test/java/org/onosproject/store/trivial/SimpleGroupStore.java
+++ b/core/common/src/test/java/org/onosproject/store/trivial/SimpleGroupStore.java
@@ -101,22 +101,22 @@
private static NewConcurrentHashMap<GroupKey, StoredGroupEntry>
lazyEmptyGroupKeyTable() {
- return NewConcurrentHashMap.<GroupKey, StoredGroupEntry>ifNeeded();
+ return NewConcurrentHashMap.ifNeeded();
}
private static NewConcurrentHashMap<GroupId, StoredGroupEntry>
lazyEmptyGroupIdTable() {
- return NewConcurrentHashMap.<GroupId, StoredGroupEntry>ifNeeded();
+ return NewConcurrentHashMap.ifNeeded();
}
private static NewConcurrentHashMap<GroupKey, StoredGroupEntry>
lazyEmptyPendingGroupKeyTable() {
- return NewConcurrentHashMap.<GroupKey, StoredGroupEntry>ifNeeded();
+ return NewConcurrentHashMap.ifNeeded();
}
private static NewConcurrentHashMap<GroupId, Group>
lazyEmptyExtraneousGroupIdTable() {
- return NewConcurrentHashMap.<GroupId, Group>ifNeeded();
+ return NewConcurrentHashMap.ifNeeded();
}
/**
diff --git a/core/common/src/test/java/org/onosproject/store/trivial/SimpleHostStore.java b/core/common/src/test/java/org/onosproject/store/trivial/SimpleHostStore.java
index a635742..98a9252 100644
--- a/core/common/src/test/java/org/onosproject/store/trivial/SimpleHostStore.java
+++ b/core/common/src/test/java/org/onosproject/store/trivial/SimpleHostStore.java
@@ -177,7 +177,7 @@
@Override
public Iterable<Host> getHosts() {
- return ImmutableSet.<Host>copyOf(hosts.values());
+ return ImmutableSet.copyOf(hosts.values());
}
@Override
diff --git a/core/net/src/main/java/org/onosproject/net/topology/impl/DefaultTopologyProvider.java b/core/net/src/main/java/org/onosproject/net/topology/impl/DefaultTopologyProvider.java
index 5adec7c..9f03d4a 100644
--- a/core/net/src/main/java/org/onosproject/net/topology/impl/DefaultTopologyProvider.java
+++ b/core/net/src/main/java/org/onosproject/net/topology/impl/DefaultTopologyProvider.java
@@ -198,7 +198,7 @@
@Override
public void triggerRecompute() {
- triggerTopologyBuild(Collections.<Event>emptyList());
+ triggerTopologyBuild(Collections.emptyList());
}
/**
diff --git a/core/net/src/test/java/org/onosproject/net/edgeservice/impl/EdgeManagerTest.java b/core/net/src/test/java/org/onosproject/net/edgeservice/impl/EdgeManagerTest.java
index b01ec39..67c82e1 100644
--- a/core/net/src/test/java/org/onosproject/net/edgeservice/impl/EdgeManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/edgeservice/impl/EdgeManagerTest.java
@@ -37,7 +37,6 @@
import org.onosproject.net.device.DeviceServiceAdapter;
import org.onosproject.net.edge.EdgePortEvent;
import org.onosproject.net.edge.EdgePortListener;
-import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.link.LinkEvent;
import org.onosproject.net.packet.OutboundPacket;
import org.onosproject.net.packet.PacketServiceAdapter;
@@ -352,7 +351,7 @@
true)));
}
- mgr.emitPacket(ByteBuffer.wrap(arr), Optional.<TrafficTreatment>empty());
+ mgr.emitPacket(ByteBuffer.wrap(arr), Optional.empty());
assertEquals("There were an unexpected number of emitted packets",
(totalPorts - numInfraPorts) * numDevices, packets.size());
@@ -364,7 +363,7 @@
}
//Start testing emission to a specific device
packets.clear();
- mgr.emitPacket(NetTestTools.did(Integer.toString(1)), ByteBuffer.wrap(arr), Optional.<TrafficTreatment>empty());
+ mgr.emitPacket(NetTestTools.did(Integer.toString(1)), ByteBuffer.wrap(arr), Optional.empty());
assertEquals("Unexpected number of outbound packets were emitted.",
totalPorts - numInfraPorts, packets.size());
@@ -530,4 +529,4 @@
events.add(event);
}
}
-}
\ No newline at end of file
+}
diff --git a/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java b/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java
index 014cb95..88a7e7a 100644
--- a/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java
@@ -554,14 +554,14 @@
@Override
public CompletedBatchOperation get()
throws InterruptedException, ExecutionException {
- return new CompletedBatchOperation(true, Collections.<FlowRule>emptySet(), null);
+ return new CompletedBatchOperation(true, Collections.emptySet(), null);
}
@Override
public CompletedBatchOperation get(long timeout, TimeUnit unit)
throws InterruptedException,
ExecutionException, TimeoutException {
- return new CompletedBatchOperation(true, Collections.<FlowRule>emptySet(), null);
+ return new CompletedBatchOperation(true, Collections.emptySet(), null);
}
@Override
diff --git a/core/net/src/test/java/org/onosproject/net/proxyarp/impl/ProxyArpManagerTest.java b/core/net/src/test/java/org/onosproject/net/proxyarp/impl/ProxyArpManagerTest.java
index 50baee9..6e91ab0 100644
--- a/core/net/src/test/java/org/onosproject/net/proxyarp/impl/ProxyArpManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/proxyarp/impl/ProxyArpManagerTest.java
@@ -416,7 +416,7 @@
*/
@Test
public void testNotKnown() {
- expect(hostService.getHostsByIp(IP1)).andReturn(Collections.<Host>emptySet());
+ expect(hostService.getHostsByIp(IP1)).andReturn(Collections.emptySet());
replay(hostService);
replay(interfaceService);
diff --git a/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java b/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
index d38821f..8e2a370 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
@@ -783,7 +783,7 @@
// exist, it creates and registers a new one.
private ConcurrentMap<PortNumber, Port> getPortMap(DeviceId deviceId) {
return createIfAbsentUnchecked(devicePorts, deviceId,
- NewConcurrentHashMap.<PortNumber, Port>ifNeeded());
+ NewConcurrentHashMap.ifNeeded());
}
private Map<ProviderId, DeviceDescriptions> getOrCreateDeviceDescriptionsMap(
diff --git a/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java b/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
index 764fe9e..554ef2a 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
@@ -241,12 +241,12 @@
private static NewConcurrentHashMap<GroupId, Group>
lazyEmptyExtraneousGroupIdTable() {
- return NewConcurrentHashMap.<GroupId, Group>ifNeeded();
+ return NewConcurrentHashMap.ifNeeded();
}
private static NewConcurrentHashMap<GroupId, StoredGroupEntry>
lazyEmptyGroupIdTable() {
- return NewConcurrentHashMap.<GroupId, StoredGroupEntry>ifNeeded();
+ return NewConcurrentHashMap.ifNeeded();
}
/**
diff --git a/core/store/dist/src/main/java/org/onosproject/store/topology/impl/DistributedTopologyStore.java b/core/store/dist/src/main/java/org/onosproject/store/topology/impl/DistributedTopologyStore.java
index 0b26ef4..cbfacad 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/topology/impl/DistributedTopologyStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/topology/impl/DistributedTopologyStore.java
@@ -30,7 +30,6 @@
import org.onosproject.event.Event;
import org.onosproject.mastership.MastershipService;
import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.DisjointPath;
import org.onosproject.net.Link;
@@ -96,8 +95,8 @@
private volatile DefaultTopology current =
new DefaultTopology(ProviderId.NONE,
new DefaultGraphDescription(0L, System.currentTimeMillis(),
- Collections.<Device>emptyList(),
- Collections.<Link>emptyList()));
+ Collections.emptyList(),
+ Collections.emptyList()));
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected StorageService storageService;
diff --git a/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java b/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java
index bda9e9a..9c9ef2c 100644
--- a/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java
+++ b/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java
@@ -133,7 +133,7 @@
private static final NodeId NID2 = new NodeId("remote");
private static final ControllerNode ONOS2 =
new DefaultControllerNode(NID2, IpAddress.valueOf("127.0.0.2"));
- private static final List<SparseAnnotations> NO_ANNOTATION = Collections.<SparseAnnotations>emptyList();
+ private static final List<SparseAnnotations> NO_ANNOTATION = Collections.emptyList();
EventuallyConsistentMapBuilder ecMapBuilder;
EventuallyConsistentMap ecMap;
@@ -492,7 +492,7 @@
@Test
public final void testUpdatePorts() {
putDevice(DID1, SW1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true),
new DefaultPortDescription(P2, true)
);
@@ -517,7 +517,7 @@
assertTrue("Event for all expectedport appeared", expectedPorts.isEmpty());
- List<PortDescription> pds2 = Arrays.<PortDescription>asList(
+ List<PortDescription> pds2 = Arrays.asList(
new DefaultPortDescription(P1, false),
new DefaultPortDescription(P2, true),
new DefaultPortDescription(P3, true)
@@ -547,7 +547,7 @@
}
}
- List<PortDescription> pds3 = Arrays.<PortDescription>asList(
+ List<PortDescription> pds3 = Arrays.asList(
new DefaultPortDescription(P1, false),
new DefaultPortDescription(P2, true)
);
@@ -577,7 +577,7 @@
@Test
public final void testUpdatePortStatus() {
putDevice(DID1, SW1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true)
);
deviceStore.updatePorts(PID, DID1, pds);
@@ -602,7 +602,7 @@
public final void testUpdatePortStatusAncillary() throws IOException {
putDeviceAncillary(DID1, SW1);
putDevice(DID1, SW1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true, A1)
);
deviceStore.updatePorts(PID, DID1, pds);
@@ -727,7 +727,7 @@
public final void testGetPorts() {
putDevice(DID1, SW1);
putDevice(DID2, SW1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true),
new DefaultPortDescription(P2, true)
);
@@ -750,7 +750,7 @@
public final void testGetPort() {
putDevice(DID1, SW1);
putDevice(DID2, SW1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true),
new DefaultPortDescription(P2, false)
);
@@ -771,7 +771,7 @@
@Test
public final void testRemoveDevice() {
putDevice(DID1, SW1, A1);
- List<PortDescription> pds = Arrays.<PortDescription>asList(
+ List<PortDescription> pds = Arrays.asList(
new DefaultPortDescription(P1, true, A2)
);
deviceStore.updatePorts(PID, DID1, pds);
@@ -800,7 +800,7 @@
// putBack Device, Port w/o annotation
putDevice(DID1, SW1);
- List<PortDescription> pds2 = Arrays.<PortDescription>asList(
+ List<PortDescription> pds2 = Arrays.asList(
new DefaultPortDescription(P1, true)
);
deviceStore.updatePorts(PID, DID1, pds2);