diff --git a/org.mapleir.ir/src/main/java/org/mapleir/ir/cfg/ControlFlowGraph.java b/org.mapleir.ir/src/main/java/org/mapleir/ir/cfg/ControlFlowGraph.java index 3ba05575..01ff040f 100644 --- a/org.mapleir.ir/src/main/java/org/mapleir/ir/cfg/ControlFlowGraph.java +++ b/org.mapleir.ir/src/main/java/org/mapleir/ir/cfg/ControlFlowGraph.java @@ -1,6 +1,5 @@ package org.mapleir.ir.cfg; -import com.google.common.collect.Streams; import org.mapleir.dot4j.model.DotGraph; import org.mapleir.flowgraph.ExceptionRange; import org.mapleir.flowgraph.FlowGraph; @@ -30,6 +29,7 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; +import java.util.stream.StreamSupport; import static org.mapleir.ir.code.Opcode.PHI_STORE; @@ -58,7 +58,8 @@ public int makeBlockId() { } public Stream allExprStream() { - return vertices().stream().flatMap(Collection::stream).map(Stmt::enumerateWithSelf).flatMap(Streams::stream); + return vertices().stream().flatMap(Collection::stream).map(Stmt::enumerateWithSelf) + .flatMap(codeUnits -> StreamSupport.stream(codeUnits.spliterator(), false)); } /** diff --git a/org.mapleir.main/pom.xml b/org.mapleir.main/pom.xml index 31dc4e7b..6f0f0758 100644 --- a/org.mapleir.main/pom.xml +++ b/org.mapleir.main/pom.xml @@ -9,11 +9,6 @@ org.mapleir main - - com.google.guava - guava - 22.0 - junit junit diff --git a/org.mapleir.parent/pom.xml b/org.mapleir.parent/pom.xml index 39f132d1..1c13c9cd 100644 --- a/org.mapleir.parent/pom.xml +++ b/org.mapleir.parent/pom.xml @@ -27,11 +27,6 @@ log4j 1.2.17 - - com.google.guava - guava - 22.0 - ../org.mapleir.app-services diff --git a/org.mapleir.stdlib/src/test/java/org/mapleir/stdlib/collections/graph/algorithms/DfsTest.java b/org.mapleir.stdlib/src/test/java/org/mapleir/stdlib/collections/graph/algorithms/DfsTest.java index 15338f53..bc999c7c 100644 --- a/org.mapleir.stdlib/src/test/java/org/mapleir/stdlib/collections/graph/algorithms/DfsTest.java +++ b/org.mapleir.stdlib/src/test/java/org/mapleir/stdlib/collections/graph/algorithms/DfsTest.java @@ -10,9 +10,6 @@ import org.mapleir.stdlib.collections.graph.util.OrderedNode.ODirectedGraph; import org.mapleir.stdlib.collections.graph.util.OrderedNode.OGraph; -import com.google.common.base.Predicates; -import com.google.common.collect.Iterators; - import junit.framework.TestCase; @@ -60,8 +57,8 @@ private void assertPreOrdered(List nodes) { OrderedNode node = nodes.get(i); visited.add(node); OrderedNode prev = nodes.get(i - 1); - if (!Iterators.all(g.getSuccessors(prev).iterator(), Predicates.in(visited))) - assertTrue("unvisited pred", Iterators.contains(g.getPredecessors(node).iterator(), prev)); + if (g.getSuccessors(prev).anyMatch(x -> !visited.contains(x))) + assertTrue("unvisited pred", g.getPredecessors(node).anyMatch(prev::equals)); } } @@ -70,7 +67,7 @@ private void assertTopoOrdered(List nodes) { assertEquals("missing nodes", new HashSet<>(nodes), g.vertices()); for (OrderedNode node : nodes) { visited.add(node); - assertTrue("unvisited pred", Iterators.all(g.getPredecessors(node).iterator(), Predicates.in(visited))); + assertTrue("unvisited pred", g.getPredecessors(node).allMatch(visited::contains)); } } diff --git a/org.mapleir.topdank-services/src/main/java/org/topdank/byteio/in/SingleJarDownloader.java b/org.mapleir.topdank-services/src/main/java/org/topdank/byteio/in/SingleJarDownloader.java index a5f11138..b008df6c 100644 --- a/org.mapleir.topdank-services/src/main/java/org/topdank/byteio/in/SingleJarDownloader.java +++ b/org.mapleir.topdank-services/src/main/java/org/topdank/byteio/in/SingleJarDownloader.java @@ -1,5 +1,6 @@ package org.topdank.byteio.in; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.JarURLConnection; @@ -16,8 +17,6 @@ import org.topdank.byteengineer.commons.data.JarResource; import org.topdank.byteengineer.commons.data.LocateableJarContents; -import com.google.common.io.ByteStreams; - public class SingleJarDownloader extends AbstractJarDownloader { protected final JarInfo jarInfo; @@ -64,6 +63,12 @@ public void download() throws IOException { } private byte[] read(InputStream inputStream) throws IOException { - return ByteStreams.toByteArray(inputStream); + byte[] buf = new byte[8192]; + ByteArrayOutputStream baos = new ByteArrayOutputStream(Math.max(8192, inputStream.available())); + int r; + while ((r = inputStream.read(buf)) >= 0) { + baos.write(buf, 0, r); + } + return baos.toByteArray(); } }