Skip to content

Commit

Permalink
Replace guava's with JDK streams
Browse files Browse the repository at this point in the history
Reduce dependency on guava to avoid potential conflicts when multiple
versions of guava are in the classpath.
  • Loading branch information
mickaelistria committed Jul 2, 2023
1 parent 301e839 commit a0d6f72
Showing 1 changed file with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
Expand All @@ -47,10 +48,6 @@
import org.osgi.framework.Bundle;

import com.google.common.base.Charsets;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableList;
import com.google.common.io.CharStreams;
import com.google.common.io.Closeables;
import com.google.gson.Gson;
Expand Down Expand Up @@ -110,21 +107,10 @@ public ValidationResult checkWrapper(String baseDir) throws CoreException {
};
List<Map<String, String>> versions = gson.fromJson(json, typeToken.getType());
//@formatter:off
ImmutableList<String> urls = FluentIterable
.from(versions)
.filter(new Predicate<Map<String, String>>() {
@Override
public boolean apply(Map<String, String> input) {
return input.get(WRAPPER_CHECKSUM_URL) != null;
}
})
.transform(new Function<Map<String, String>, String>() {
@Override
public String apply(Map<String, String> input) {
return input.get(WRAPPER_CHECKSUM_URL);
}
})
.toList();
List<String> urls = versions.stream()
.map(input -> input.get(WRAPPER_CHECKSUM_URL))
.filter(Objects::nonNull)
.toList();
// @formatter:on
DownloadChecksumJob downloadJob = new DownloadChecksumJob();
int count = 0;
Expand Down

0 comments on commit a0d6f72

Please sign in to comment.