Sho SHIMIZU
Committed by Gerrit Code Review

Introduce import statements for java.util.Optional

Change-Id: I8888a5536b5abe43408130d6dc965487e05b065d
......@@ -15,7 +15,6 @@
*/
package org.onosproject.store.group.impl;
import com.google.common.base.Optional;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Iterables;
......@@ -78,6 +77,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
......@@ -628,7 +628,7 @@ public class DistributedGroupStore
group.deviceId());
synchronized (existing) {
for (GroupBucket bucket:group.buckets().buckets()) {
java.util.Optional<GroupBucket> matchingBucket =
Optional<GroupBucket> matchingBucket =
existing.buckets().buckets()
.stream()
.filter((existingBucket)->(existingBucket.equals(bucket)))
......
......@@ -21,6 +21,7 @@ import static org.slf4j.LoggerFactory.getLogger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;
......@@ -418,7 +419,7 @@ public class SimpleGroupStore
if (existing != null) {
synchronized (existing) {
for (GroupBucket bucket:group.buckets().buckets()) {
java.util.Optional<GroupBucket> matchingBucket =
Optional<GroupBucket> matchingBucket =
existing.buckets().buckets()
.stream()
.filter((existingBucket)->(existingBucket.equals(bucket)))
......
......@@ -21,6 +21,7 @@ import static org.onosproject.net.DeviceId.deviceId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import org.junit.After;
import org.junit.Before;
......@@ -112,7 +113,7 @@ public class SimpleGroupStoreTest {
createdBuckets.buckets().
containsAll(event.subject().buckets().buckets()));
for (GroupBucket bucket:event.subject().buckets().buckets()) {
java.util.Optional<GroupBucket> matched = createdBuckets.buckets()
Optional<GroupBucket> matched = createdBuckets.buckets()
.stream()
.filter((expected) -> expected.equals(bucket))
.findFirst();
......