Committed by
Gerrit Code Review
Use diamond operator to remove redundant type parameter declaration
Change-Id: I262ffefc2dde55f434b47ca74487dcd318301ac1
Showing
1 changed file
with
6 additions
and
8 deletions
| ... | @@ -43,8 +43,7 @@ import org.slf4j.Logger; | ... | @@ -43,8 +43,7 @@ import org.slf4j.Logger; |
| 43 | public class PolicyGroupHandler extends DefaultGroupHandler { | 43 | public class PolicyGroupHandler extends DefaultGroupHandler { |
| 44 | 44 | ||
| 45 | private final Logger log = getLogger(getClass()); | 45 | private final Logger log = getLogger(getClass()); |
| 46 | - private HashMap<PolicyGroupIdentifier, PolicyGroupIdentifier> dependentGroups = | 46 | + private HashMap<PolicyGroupIdentifier, PolicyGroupIdentifier> dependentGroups = new HashMap<>(); |
| 47 | - new HashMap<PolicyGroupIdentifier, PolicyGroupIdentifier>(); | ||
| 48 | 47 | ||
| 49 | /** | 48 | /** |
| 50 | * Policy group handler constructor. | 49 | * Policy group handler constructor. |
| ... | @@ -65,7 +64,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { | ... | @@ -65,7 +64,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { |
| 65 | 64 | ||
| 66 | public PolicyGroupIdentifier createPolicyGroupChain(String id, | 65 | public PolicyGroupIdentifier createPolicyGroupChain(String id, |
| 67 | List<PolicyGroupParams> params) { | 66 | List<PolicyGroupParams> params) { |
| 68 | - List<GroupBucketIdentifier> bucketIds = new ArrayList<GroupBucketIdentifier>(); | 67 | + List<GroupBucketIdentifier> bucketIds = new ArrayList<>(); |
| 69 | for (PolicyGroupParams param: params) { | 68 | for (PolicyGroupParams param: params) { |
| 70 | List<PortNumber> ports = param.getPorts(); | 69 | List<PortNumber> ports = param.getPorts(); |
| 71 | if (ports == null) { | 70 | if (ports == null) { |
| ... | @@ -91,7 +90,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { | ... | @@ -91,7 +90,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { |
| 91 | bucketIds.add(bucketId); | 90 | bucketIds.add(bucketId); |
| 92 | } else if (idx == 0) { | 91 | } else if (idx == 0) { |
| 93 | // Outermost Group | 92 | // Outermost Group |
| 94 | - List<GroupBucket> outBuckets = new ArrayList<GroupBucket>(); | 93 | + List<GroupBucket> outBuckets = new ArrayList<>(); |
| 95 | GroupBucketIdentifier bucketId = | 94 | GroupBucketIdentifier bucketId = |
| 96 | new GroupBucketIdentifier(label, sp); | 95 | new GroupBucketIdentifier(label, sp); |
| 97 | PolicyGroupIdentifier key = new | 96 | PolicyGroupIdentifier key = new |
| ... | @@ -160,7 +159,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { | ... | @@ -160,7 +159,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { |
| 160 | } | 159 | } |
| 161 | 160 | ||
| 162 | if (fullyResolved) { | 161 | if (fullyResolved) { |
| 163 | - List<GroupBucket> outBuckets = new ArrayList<GroupBucket>(); | 162 | + List<GroupBucket> outBuckets = new ArrayList<>(); |
| 164 | for (GroupBucketIdentifier bucketId:bucketIds) { | 163 | for (GroupBucketIdentifier bucketId:bucketIds) { |
| 165 | DeviceId neighbor = portDeviceMap. | 164 | DeviceId neighbor = portDeviceMap. |
| 166 | get(bucketId.outPort()); | 165 | get(bucketId.outPort()); |
| ... | @@ -255,7 +254,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { | ... | @@ -255,7 +254,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { |
| 255 | 254 | ||
| 256 | public PolicyGroupIdentifier generatePolicyGroupKey(String id, | 255 | public PolicyGroupIdentifier generatePolicyGroupKey(String id, |
| 257 | List<PolicyGroupParams> params) { | 256 | List<PolicyGroupParams> params) { |
| 258 | - List<GroupBucketIdentifier> bucketIds = new ArrayList<GroupBucketIdentifier>(); | 257 | + List<GroupBucketIdentifier> bucketIds = new ArrayList<>(); |
| 259 | for (PolicyGroupParams param: params) { | 258 | for (PolicyGroupParams param: params) { |
| 260 | List<PortNumber> ports = param.getPorts(); | 259 | List<PortNumber> ports = param.getPorts(); |
| 261 | if (ports == null) { | 260 | if (ports == null) { |
| ... | @@ -324,8 +323,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { | ... | @@ -324,8 +323,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { |
| 324 | 323 | ||
| 325 | public void removeGroupChain(PolicyGroupIdentifier key) { | 324 | public void removeGroupChain(PolicyGroupIdentifier key) { |
| 326 | checkArgument(key != null); | 325 | checkArgument(key != null); |
| 327 | - List<PolicyGroupIdentifier> groupsToBeDeleted = | 326 | + List<PolicyGroupIdentifier> groupsToBeDeleted = new ArrayList<>(); |
| 328 | - new ArrayList<PolicyGroupIdentifier>(); | ||
| 329 | groupsToBeDeleted.add(key); | 327 | groupsToBeDeleted.add(key); |
| 330 | 328 | ||
| 331 | Iterator<PolicyGroupIdentifier> it = | 329 | Iterator<PolicyGroupIdentifier> it = | ... | ... |
-
Please register or login to post a comment