Sho SHIMIZU
Committed by Yuta HIGUCHI

Remove explicit type parameters which can be inferred

Change-Id: I62cd4df252bab6208e1b1cd37f8f8757b0cfc17e
......@@ -95,7 +95,7 @@ public final class PortNumber {
// 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);
}
......
......@@ -52,7 +52,7 @@ public class DefaultHostDescription extends AbstractDescription
public DefaultHostDescription(MacAddress mac, VlanId vlan,
HostLocation location,
SparseAnnotations... annotations) {
this(mac, vlan, location, Collections.<IpAddress>emptySet(),
this(mac, vlan, location, Collections.emptySet(),
annotations);
}
......
......@@ -54,7 +54,7 @@ public class VersionedTest {
*/
@Test
public void testMap() {
Versioned<String> tempObj = stats1.<String>map(VersionedTest::transform);
Versioned<String> tempObj = stats1.map(VersionedTest::transform);
assertThat(tempObj.value(), is("1"));
}
......
......@@ -42,7 +42,7 @@ public class SimpleApplicationIdStore implements ApplicationIdStore {
@Override
public Set<ApplicationId> getAppIds() {
return ImmutableSet.<ApplicationId>copyOf(appIds.values());
return ImmutableSet.copyOf(appIds.values());
}
@Override
......
......@@ -348,7 +348,7 @@ public class SimpleDeviceStore
// 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(
......
......@@ -265,7 +265,7 @@ public class SimpleDeviceStoreTest {
@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 @@ public class SimpleDeviceStoreTest {
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 @@ public class SimpleDeviceStoreTest {
}
}
List<PortDescription> pds3 = Arrays.<PortDescription>asList(
List<PortDescription> pds3 = Arrays.asList(
new DefaultPortDescription(P1, false),
new DefaultPortDescription(P2, true)
);
......@@ -334,7 +334,7 @@ public class SimpleDeviceStoreTest {
@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 class SimpleDeviceStoreTest {
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 class SimpleDeviceStoreTest {
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 @@ public class SimpleDeviceStoreTest {
@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 @@ public class SimpleDeviceStoreTest {
// 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);
......
......@@ -164,7 +164,7 @@ public class SimpleFlowRuleStore
}
private static NewConcurrentHashMap<FlowId, List<StoredFlowEntry>> lazyEmptyFlowTable() {
return NewConcurrentHashMap.<FlowId, List<StoredFlowEntry>>ifNeeded();
return NewConcurrentHashMap.ifNeeded();
}
/**
......
......@@ -101,22 +101,22 @@ public class SimpleGroupStore
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();
}
/**
......
......@@ -177,7 +177,7 @@ public class SimpleHostStore
@Override
public Iterable<Host> getHosts() {
return ImmutableSet.<Host>copyOf(hosts.values());
return ImmutableSet.copyOf(hosts.values());
}
@Override
......
......@@ -198,7 +198,7 @@ public class DefaultTopologyProvider extends AbstractProvider
@Override
public void triggerRecompute() {
triggerTopologyBuild(Collections.<Event>emptyList());
triggerTopologyBuild(Collections.emptyList());
}
/**
......
......@@ -37,7 +37,6 @@ import org.onosproject.net.device.DeviceListener;
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 @@ public class EdgeManagerTest {
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 @@ public class EdgeManagerTest {
}
//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 @@ public class EdgeManagerTest {
events.add(event);
}
}
}
\ No newline at end of file
}
......
......@@ -554,14 +554,14 @@ public class FlowRuleManagerTest {
@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
......
......@@ -416,7 +416,7 @@ public class ProxyArpManagerTest {
*/
@Test
public void testNotKnown() {
expect(hostService.getHostsByIp(IP1)).andReturn(Collections.<Host>emptySet());
expect(hostService.getHostsByIp(IP1)).andReturn(Collections.emptySet());
replay(hostService);
replay(interfaceService);
......
......@@ -783,7 +783,7 @@ public class GossipDeviceStore
// 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(
......
......@@ -241,12 +241,12 @@ public class DistributedGroupStore
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();
}
/**
......
......@@ -30,7 +30,6 @@ import org.onosproject.common.DefaultTopology;
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 @@ public class DistributedTopologyStore
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;
......
......@@ -133,7 +133,7 @@ public class GossipDeviceStoreTest {
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 @@ public class GossipDeviceStoreTest {
@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 @@ public class GossipDeviceStoreTest {
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 @@ public class GossipDeviceStoreTest {
}
}
List<PortDescription> pds3 = Arrays.<PortDescription>asList(
List<PortDescription> pds3 = Arrays.asList(
new DefaultPortDescription(P1, false),
new DefaultPortDescription(P2, true)
);
......@@ -577,7 +577,7 @@ public class GossipDeviceStoreTest {
@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 class GossipDeviceStoreTest {
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 class GossipDeviceStoreTest {
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 class GossipDeviceStoreTest {
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 @@ public class GossipDeviceStoreTest {
@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 @@ public class GossipDeviceStoreTest {
// 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);
......