Sho SHIMIZU
Committed by Gerrit Code Review

Use JDK's Objects instead of Guava's Objects

Change-Id: I58e5013e953b3528a99c54712ac4f6a7f10b4cb4
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
15 */ 15 */
16 package org.onosproject.store.flow.impl; 16 package org.onosproject.store.flow.impl;
17 17
18 - import com.google.common.base.Objects;
19 import com.google.common.collect.ImmutableList; 18 import com.google.common.collect.ImmutableList;
20 import com.google.common.collect.ImmutableMap; 19 import com.google.common.collect.ImmutableMap;
21 import com.google.common.collect.Iterables; 20 import com.google.common.collect.Iterables;
...@@ -85,6 +84,7 @@ package org.onosproject.store.flow.impl; ...@@ -85,6 +84,7 @@ package org.onosproject.store.flow.impl;
85 import java.util.HashSet; 84 import java.util.HashSet;
86 import java.util.List; 85 import java.util.List;
87 import java.util.Map; 86 import java.util.Map;
87 + import java.util.Objects;
88 import java.util.Set; 88 import java.util.Set;
89 import java.util.concurrent.ExecutorService; 89 import java.util.concurrent.ExecutorService;
90 import java.util.concurrent.Executors; 90 import java.util.concurrent.Executors;
...@@ -364,7 +364,7 @@ public class NewDistributedFlowRuleStore ...@@ -364,7 +364,7 @@ public class NewDistributedFlowRuleStore
364 return null; 364 return null;
365 } 365 }
366 366
367 - if (Objects.equal(local, master)) { 367 + if (Objects.equals(local, master)) {
368 return flowTable.getFlowEntry(rule); 368 return flowTable.getFlowEntry(rule);
369 } 369 }
370 370
...@@ -390,7 +390,7 @@ public class NewDistributedFlowRuleStore ...@@ -390,7 +390,7 @@ public class NewDistributedFlowRuleStore
390 return Collections.emptyList(); 390 return Collections.emptyList();
391 } 391 }
392 392
393 - if (Objects.equal(local, master)) { 393 + if (Objects.equals(local, master)) {
394 return flowTable.getFlowEntries(deviceId); 394 return flowTable.getFlowEntries(deviceId);
395 } 395 }
396 396
...@@ -437,7 +437,7 @@ public class NewDistributedFlowRuleStore ...@@ -437,7 +437,7 @@ public class NewDistributedFlowRuleStore
437 return; 437 return;
438 } 438 }
439 439
440 - if (Objects.equal(local, master)) { 440 + if (Objects.equals(local, master)) {
441 storeBatchInternal(operation); 441 storeBatchInternal(operation);
442 return; 442 return;
443 } 443 }
...@@ -512,7 +512,7 @@ public class NewDistributedFlowRuleStore ...@@ -512,7 +512,7 @@ public class NewDistributedFlowRuleStore
512 } 512 }
513 return null; 513 return null;
514 } 514 }
515 - ).filter(op -> op != null).collect(Collectors.toSet()); 515 + ).filter(Objects::nonNull).collect(Collectors.toSet());
516 } 516 }
517 517
518 @Override 518 @Override
...@@ -528,7 +528,7 @@ public class NewDistributedFlowRuleStore ...@@ -528,7 +528,7 @@ public class NewDistributedFlowRuleStore
528 @Override 528 @Override
529 public FlowRuleEvent addOrUpdateFlowRule(FlowEntry rule) { 529 public FlowRuleEvent addOrUpdateFlowRule(FlowEntry rule) {
530 NodeId master = mastershipService.getMasterFor(rule.deviceId()); 530 NodeId master = mastershipService.getMasterFor(rule.deviceId());
531 - if (Objects.equal(local, master)) { 531 + if (Objects.equals(local, master)) {
532 return addOrUpdateFlowRuleInternal(rule); 532 return addOrUpdateFlowRuleInternal(rule);
533 } 533 }
534 534
...@@ -564,7 +564,7 @@ public class NewDistributedFlowRuleStore ...@@ -564,7 +564,7 @@ public class NewDistributedFlowRuleStore
564 final DeviceId deviceId = rule.deviceId(); 564 final DeviceId deviceId = rule.deviceId();
565 NodeId master = mastershipService.getMasterFor(deviceId); 565 NodeId master = mastershipService.getMasterFor(deviceId);
566 566
567 - if (Objects.equal(local, master)) { 567 + if (Objects.equals(local, master)) {
568 // bypass and handle it locally 568 // bypass and handle it locally
569 return removeFlowRuleInternal(rule); 569 return removeFlowRuleInternal(rule);
570 } 570 }
...@@ -619,7 +619,7 @@ public class NewDistributedFlowRuleStore ...@@ -619,7 +619,7 @@ public class NewDistributedFlowRuleStore
619 619
620 final DeviceId deviceId = operation.deviceId(); 620 final DeviceId deviceId = operation.deviceId();
621 NodeId master = mastershipService.getMasterFor(deviceId); 621 NodeId master = mastershipService.getMasterFor(deviceId);
622 - if (!Objects.equal(local, master)) { 622 + if (!Objects.equals(local, master)) {
623 Set<FlowRule> failures = new HashSet<>(operation.size()); 623 Set<FlowRule> failures = new HashSet<>(operation.size());
624 for (FlowRuleBatchEntry op : operation.getOperations()) { 624 for (FlowRuleBatchEntry op : operation.getOperations()) {
625 failures.add(op.target()); 625 failures.add(op.target());
...@@ -656,13 +656,13 @@ public class NewDistributedFlowRuleStore ...@@ -656,13 +656,13 @@ public class NewDistributedFlowRuleStore
656 if (event.type() == ReplicaInfoEvent.Type.BACKUPS_CHANGED) { 656 if (event.type() == ReplicaInfoEvent.Type.BACKUPS_CHANGED) {
657 DeviceId deviceId = event.subject(); 657 DeviceId deviceId = event.subject();
658 NodeId master = mastershipService.getMasterFor(deviceId); 658 NodeId master = mastershipService.getMasterFor(deviceId);
659 - if (!Objects.equal(local, master)) { 659 + if (!Objects.equals(local, master)) {
660 // ignore since this event is for a device this node does not manage. 660 // ignore since this event is for a device this node does not manage.
661 return; 661 return;
662 } 662 }
663 NodeId newBackupNode = getBackupNode(deviceId); 663 NodeId newBackupNode = getBackupNode(deviceId);
664 NodeId currentBackupNode = lastBackupNodes.get(deviceId); 664 NodeId currentBackupNode = lastBackupNodes.get(deviceId);
665 - if (Objects.equal(newBackupNode, currentBackupNode)) { 665 + if (Objects.equals(newBackupNode, currentBackupNode)) {
666 // ignore since backup location hasn't changed. 666 // ignore since backup location hasn't changed.
667 return; 667 return;
668 } 668 }
...@@ -834,7 +834,7 @@ public class NewDistributedFlowRuleStore ...@@ -834,7 +834,7 @@ public class NewDistributedFlowRuleStore
834 NodeId lastBackupNode = lastBackupNodes.get(deviceId); 834 NodeId lastBackupNode = lastBackupNodes.get(deviceId);
835 NodeId newBackupNode = getBackupNode(deviceId); 835 NodeId newBackupNode = getBackupNode(deviceId);
836 return lastBackupTime == null 836 return lastBackupTime == null
837 - || !Objects.equal(lastBackupNode, newBackupNode) 837 + || !Objects.equals(lastBackupNode, newBackupNode)
838 || (lastUpdateTime != null && lastUpdateTime > lastBackupTime); 838 || (lastUpdateTime != null && lastUpdateTime > lastBackupTime);
839 }) 839 })
840 .collect(Collectors.toSet()); 840 .collect(Collectors.toSet());
...@@ -862,7 +862,7 @@ public class NewDistributedFlowRuleStore ...@@ -862,7 +862,7 @@ public class NewDistributedFlowRuleStore
862 try { 862 try {
863 flowTables.forEach((deviceId, deviceFlowTable) -> { 863 flowTables.forEach((deviceId, deviceFlowTable) -> {
864 // Only process those devices are that not managed by the local node. 864 // Only process those devices are that not managed by the local node.
865 - if (!Objects.equal(local, mastershipService.getMasterFor(deviceId))) { 865 + if (!Objects.equals(local, mastershipService.getMasterFor(deviceId))) {
866 Map<FlowId, Map<StoredFlowEntry, StoredFlowEntry>> backupFlowTable = 866 Map<FlowId, Map<StoredFlowEntry, StoredFlowEntry>> backupFlowTable =
867 getFlowTable(deviceId); 867 getFlowTable(deviceId);
868 backupFlowTable.clear(); 868 backupFlowTable.clear();
......