Use diamond operator
Change-Id: I9bb7e90ce7f45e65b4081a5bf85570b97e44712e
diff --git a/core/store/dist/src/main/java/org/onosproject/store/device/impl/DeviceDescriptions.java b/core/store/dist/src/main/java/org/onosproject/store/device/impl/DeviceDescriptions.java
index fd7fcd8..2320672 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/device/impl/DeviceDescriptions.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/device/impl/DeviceDescriptions.java
@@ -82,7 +82,7 @@
if (oldOne != null) {
SparseAnnotations merged = union(oldOne.value().annotations(),
newDesc.value().annotations());
- newOne = new Timestamped<DeviceDescription>(
+ newOne = new Timestamped<>(
new DefaultDeviceDescription(newDesc.value(), merged),
newDesc.timestamp());
}
@@ -104,27 +104,27 @@
switch (newDesc.value().type()) {
case OMS:
OmsPortDescription omsDesc = (OmsPortDescription) (newDesc.value());
- newOne = new Timestamped<PortDescription>(
+ newOne = new Timestamped<>(
new OmsPortDescription(
omsDesc, omsDesc.minFrequency(), omsDesc.maxFrequency(), omsDesc.grid(), merged),
newDesc.timestamp());
break;
case OCH:
OchPortDescription ochDesc = (OchPortDescription) (newDesc.value());
- newOne = new Timestamped<PortDescription>(
+ newOne = new Timestamped<>(
new OchPortDescription(
ochDesc, ochDesc.signalType(), ochDesc.isTunable(), ochDesc.lambda(), merged),
newDesc.timestamp());
break;
case ODUCLT:
OduCltPortDescription ocDesc = (OduCltPortDescription) (newDesc.value());
- newOne = new Timestamped<PortDescription>(
+ newOne = new Timestamped<>(
new OduCltPortDescription(
ocDesc, ocDesc.signalType(), merged),
newDesc.timestamp());
break;
default:
- newOne = new Timestamped<PortDescription>(
+ newOne = new Timestamped<>(
new DefaultPortDescription(newDesc.value(), merged),
newDesc.timestamp());
}
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 cf48dcb..97333eb 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
@@ -131,8 +131,7 @@
private ExecutorService messageHandlingExecutor;
private static final int MESSAGE_HANDLER_THREAD_POOL_SIZE = 1;
- private final HashMap<DeviceId, Boolean> deviceAuditStatus =
- new HashMap<DeviceId, Boolean>();
+ private final HashMap<DeviceId, Boolean> deviceAuditStatus = new HashMap<>();
private final AtomicInteger groupIdGen = new AtomicInteger();
@@ -685,8 +684,7 @@
UpdateType type,
GroupBuckets buckets) {
GroupBuckets oldBuckets = oldGroup.buckets();
- List<GroupBucket> newBucketList = new ArrayList<GroupBucket>(
- oldBuckets.buckets());
+ List<GroupBucket> newBucketList = new ArrayList<>(oldBuckets.buckets());
boolean groupDescUpdated = false;
if (type == UpdateType.ADD) {
diff --git a/core/store/dist/src/main/java/org/onosproject/store/link/impl/GossipLinkStore.java b/core/store/dist/src/main/java/org/onosproject/store/link/impl/GossipLinkStore.java
index 767ede5..105c77d 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/link/impl/GossipLinkStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/link/impl/GossipLinkStore.java
@@ -62,7 +62,6 @@
import org.slf4j.Logger;
import java.io.IOException;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -551,7 +550,7 @@
*/
private static <K, V> SetMultimap<K, V> createSynchronizedHashMultiMap() {
return synchronizedSetMultimap(
- Multimaps.newSetMultimap(new ConcurrentHashMap<K, Collection<V>>(),
+ Multimaps.newSetMultimap(new ConcurrentHashMap<>(),
() -> Sets.newConcurrentHashSet()));
}
diff --git a/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/RoleValue.java b/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/RoleValue.java
index 9d3b168..5a38a34 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/RoleValue.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/RoleValue.java
@@ -45,9 +45,9 @@
* Constructs empty RoleValue.
*/
public RoleValue() {
- value.put(MastershipRole.MASTER, new LinkedList<NodeId>());
- value.put(MastershipRole.STANDBY, new LinkedList<NodeId>());
- value.put(MastershipRole.NONE, new LinkedList<NodeId>());
+ value.put(MastershipRole.MASTER, new LinkedList<>());
+ value.put(MastershipRole.STANDBY, new LinkedList<>());
+ value.put(MastershipRole.NONE, new LinkedList<>());
}
/**
diff --git a/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/UpdateResultTest.java b/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/UpdateResultTest.java
index 84dc915..dd4c63b 100644
--- a/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/UpdateResultTest.java
+++ b/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/UpdateResultTest.java
@@ -15,8 +15,8 @@
@Test
public void testGetters() {
- Versioned<String> oldValue = new Versioned<String>("a", 1);
- Versioned<String> newValue = new Versioned<String>("b", 2);
+ Versioned<String> oldValue = new Versioned<>("a", 1);
+ Versioned<String> newValue = new Versioned<>("b", 2);
UpdateResult<String, String> ur =
new UpdateResult<>(true, "foo", "k", oldValue, newValue);
@@ -29,8 +29,8 @@
@Test
public void testToMapEvent() {
- Versioned<String> oldValue = new Versioned<String>("a", 1);
- Versioned<String> newValue = new Versioned<String>("b", 2);
+ Versioned<String> oldValue = new Versioned<>("a", 1);
+ Versioned<String> newValue = new Versioned<>("b", 2);
UpdateResult<String, String> ur1 =
new UpdateResult<>(true, "foo", "k", oldValue, newValue);
MapEvent<String, String> event1 = ur1.toMapEvent();
@@ -59,8 +59,8 @@
@Test
public void testMap() {
- Versioned<String> oldValue = new Versioned<String>("a", 1);
- Versioned<String> newValue = new Versioned<String>("b", 2);
+ Versioned<String> oldValue = new Versioned<>("a", 1);
+ Versioned<String> newValue = new Versioned<>("b", 2);
UpdateResult<String, String> ur1 =
new UpdateResult<>(true, "foo", "k", oldValue, newValue);
UpdateResult<Integer, Integer> ur2 = ur1.map(s -> s.length(), s -> s.length());
diff --git a/core/store/dist/src/test/java/org/onosproject/store/flow/impl/ReplicaInfoManagerTest.java b/core/store/dist/src/test/java/org/onosproject/store/flow/impl/ReplicaInfoManagerTest.java
index d429752..76ff804 100644
--- a/core/store/dist/src/test/java/org/onosproject/store/flow/impl/ReplicaInfoManagerTest.java
+++ b/core/store/dist/src/test/java/org/onosproject/store/flow/impl/ReplicaInfoManagerTest.java
@@ -101,7 +101,7 @@
// fake MastershipEvent
eventDispatcher.post(new MastershipEvent(Type.MASTER_CHANGED, DID1,
- new RoleInfo(NID1, new LinkedList<NodeId>())));
+ new RoleInfo(NID1, new LinkedList<>())));
assertTrue(latch.await(1, TimeUnit.SECONDS));
}