Use diamond operator to remove redundant type parameter declaration
Change-Id: I262ffefc2dde55f434b47ca74487dcd318301ac1
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/PolicyGroupHandler.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/PolicyGroupHandler.java
index 52242b8..a2a1b09 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/PolicyGroupHandler.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/PolicyGroupHandler.java
@@ -43,8 +43,7 @@
public class PolicyGroupHandler extends DefaultGroupHandler {
private final Logger log = getLogger(getClass());
- private HashMap<PolicyGroupIdentifier, PolicyGroupIdentifier> dependentGroups =
- new HashMap<PolicyGroupIdentifier, PolicyGroupIdentifier>();
+ private HashMap<PolicyGroupIdentifier, PolicyGroupIdentifier> dependentGroups = new HashMap<>();
/**
* Policy group handler constructor.
@@ -65,7 +64,7 @@
public PolicyGroupIdentifier createPolicyGroupChain(String id,
List<PolicyGroupParams> params) {
- List<GroupBucketIdentifier> bucketIds = new ArrayList<GroupBucketIdentifier>();
+ List<GroupBucketIdentifier> bucketIds = new ArrayList<>();
for (PolicyGroupParams param: params) {
List<PortNumber> ports = param.getPorts();
if (ports == null) {
@@ -91,7 +90,7 @@
bucketIds.add(bucketId);
} else if (idx == 0) {
// Outermost Group
- List<GroupBucket> outBuckets = new ArrayList<GroupBucket>();
+ List<GroupBucket> outBuckets = new ArrayList<>();
GroupBucketIdentifier bucketId =
new GroupBucketIdentifier(label, sp);
PolicyGroupIdentifier key = new
@@ -160,7 +159,7 @@
}
if (fullyResolved) {
- List<GroupBucket> outBuckets = new ArrayList<GroupBucket>();
+ List<GroupBucket> outBuckets = new ArrayList<>();
for (GroupBucketIdentifier bucketId:bucketIds) {
DeviceId neighbor = portDeviceMap.
get(bucketId.outPort());
@@ -255,7 +254,7 @@
public PolicyGroupIdentifier generatePolicyGroupKey(String id,
List<PolicyGroupParams> params) {
- List<GroupBucketIdentifier> bucketIds = new ArrayList<GroupBucketIdentifier>();
+ List<GroupBucketIdentifier> bucketIds = new ArrayList<>();
for (PolicyGroupParams param: params) {
List<PortNumber> ports = param.getPorts();
if (ports == null) {
@@ -324,8 +323,7 @@
public void removeGroupChain(PolicyGroupIdentifier key) {
checkArgument(key != null);
- List<PolicyGroupIdentifier> groupsToBeDeleted =
- new ArrayList<PolicyGroupIdentifier>();
+ List<PolicyGroupIdentifier> groupsToBeDeleted = new ArrayList<>();
groupsToBeDeleted.add(key);
Iterator<PolicyGroupIdentifier> it =