Sho SHIMIZU
Committed by Gerrit Code Review

Introduce import statements for java.util.Optional

Change-Id: I8888a5536b5abe43408130d6dc965487e05b065d
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
15 */ 15 */
16 package org.onosproject.store.group.impl; 16 package org.onosproject.store.group.impl;
17 17
18 -import com.google.common.base.Optional;
19 import com.google.common.collect.FluentIterable; 18 import com.google.common.collect.FluentIterable;
20 import com.google.common.collect.Iterables; 19 import com.google.common.collect.Iterables;
21 20
...@@ -78,6 +77,7 @@ import java.util.ArrayList; ...@@ -78,6 +77,7 @@ import java.util.ArrayList;
78 import java.util.HashMap; 77 import java.util.HashMap;
79 import java.util.List; 78 import java.util.List;
80 import java.util.Objects; 79 import java.util.Objects;
80 +import java.util.Optional;
81 import java.util.concurrent.ConcurrentHashMap; 81 import java.util.concurrent.ConcurrentHashMap;
82 import java.util.concurrent.ConcurrentMap; 82 import java.util.concurrent.ConcurrentMap;
83 import java.util.concurrent.ExecutorService; 83 import java.util.concurrent.ExecutorService;
...@@ -628,7 +628,7 @@ public class DistributedGroupStore ...@@ -628,7 +628,7 @@ public class DistributedGroupStore
628 group.deviceId()); 628 group.deviceId());
629 synchronized (existing) { 629 synchronized (existing) {
630 for (GroupBucket bucket:group.buckets().buckets()) { 630 for (GroupBucket bucket:group.buckets().buckets()) {
631 - java.util.Optional<GroupBucket> matchingBucket = 631 + Optional<GroupBucket> matchingBucket =
632 existing.buckets().buckets() 632 existing.buckets().buckets()
633 .stream() 633 .stream()
634 .filter((existingBucket)->(existingBucket.equals(bucket))) 634 .filter((existingBucket)->(existingBucket.equals(bucket)))
......
...@@ -21,6 +21,7 @@ import static org.slf4j.LoggerFactory.getLogger; ...@@ -21,6 +21,7 @@ import static org.slf4j.LoggerFactory.getLogger;
21 import java.util.ArrayList; 21 import java.util.ArrayList;
22 import java.util.HashMap; 22 import java.util.HashMap;
23 import java.util.List; 23 import java.util.List;
24 +import java.util.Optional;
24 import java.util.concurrent.ConcurrentHashMap; 25 import java.util.concurrent.ConcurrentHashMap;
25 import java.util.concurrent.ConcurrentMap; 26 import java.util.concurrent.ConcurrentMap;
26 import java.util.concurrent.atomic.AtomicInteger; 27 import java.util.concurrent.atomic.AtomicInteger;
...@@ -418,7 +419,7 @@ public class SimpleGroupStore ...@@ -418,7 +419,7 @@ public class SimpleGroupStore
418 if (existing != null) { 419 if (existing != null) {
419 synchronized (existing) { 420 synchronized (existing) {
420 for (GroupBucket bucket:group.buckets().buckets()) { 421 for (GroupBucket bucket:group.buckets().buckets()) {
421 - java.util.Optional<GroupBucket> matchingBucket = 422 + Optional<GroupBucket> matchingBucket =
422 existing.buckets().buckets() 423 existing.buckets().buckets()
423 .stream() 424 .stream()
424 .filter((existingBucket)->(existingBucket.equals(bucket))) 425 .filter((existingBucket)->(existingBucket.equals(bucket)))
......
...@@ -21,6 +21,7 @@ import static org.onosproject.net.DeviceId.deviceId; ...@@ -21,6 +21,7 @@ import static org.onosproject.net.DeviceId.deviceId;
21 import java.util.ArrayList; 21 import java.util.ArrayList;
22 import java.util.Arrays; 22 import java.util.Arrays;
23 import java.util.List; 23 import java.util.List;
24 +import java.util.Optional;
24 25
25 import org.junit.After; 26 import org.junit.After;
26 import org.junit.Before; 27 import org.junit.Before;
...@@ -112,7 +113,7 @@ public class SimpleGroupStoreTest { ...@@ -112,7 +113,7 @@ public class SimpleGroupStoreTest {
112 createdBuckets.buckets(). 113 createdBuckets.buckets().
113 containsAll(event.subject().buckets().buckets())); 114 containsAll(event.subject().buckets().buckets()));
114 for (GroupBucket bucket:event.subject().buckets().buckets()) { 115 for (GroupBucket bucket:event.subject().buckets().buckets()) {
115 - java.util.Optional<GroupBucket> matched = createdBuckets.buckets() 116 + Optional<GroupBucket> matched = createdBuckets.buckets()
116 .stream() 117 .stream()
117 .filter((expected) -> expected.equals(bucket)) 118 .filter((expected) -> expected.equals(bucket))
118 .findFirst(); 119 .findFirst();
......