vvysotskyi commented on a change in pull request #1397: DRILL-6633: Replace 
usage of Guava classes by JDK ones
URL: https://github.com/apache/drill/pull/1397#discussion_r210847475
 
 

 ##########
 File path: 
common/src/main/java/org/apache/drill/common/collections/MapWithOrdinal.java
 ##########
 @@ -129,22 +127,17 @@ public void clear() {
 
     @Override
     public Collection<V> values() {
-      return Lists.newArrayList(Iterables.transform(secondary.entries(), new 
Function<IntObjectMap.Entry<V>, V>() {
-        @Override
-        public V apply(IntObjectMap.Entry<V> entry) {
-          return Preconditions.checkNotNull(entry).value();
-        }
-      }));
+      return StreamSupport.stream(secondary.entries().spliterator(), false)
+          .map(entry -> Objects.requireNonNull(entry).value())
+          .collect(Collectors.toList());
     }
 
     @Override
     public Set<Entry<K, V>> entrySet() {
-      return Sets.newHashSet(Iterables.transform(primary.entrySet(), new 
Function<Entry<K, Entry<Integer, V>>, Entry<K, V>>() {
-        @Override
-        public Entry<K, V> apply(Entry<K, Entry<Integer, V>> entry) {
-          return new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), 
entry.getValue().getValue());
-        }
-      }));
+      return primary.entrySet().stream()
+          .map((Function<Entry<K, Entry<Integer, V>>, Entry<K, V>>) entry ->
 
 Review comment:
   Thanks for pointing this, removed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to