Skip to content

Commit

Permalink
Merge b841a3b into 7f9aacb
Browse files Browse the repository at this point in the history
  • Loading branch information
lazaroclapp committed Jun 29, 2020
2 parents 7f9aacb + b841a3b commit 1d029e5
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -280,7 +280,7 @@ public static void annotateBytecodeInJar(
// Reference: https://bugs.openjdk.java.net/browse/JDK-8215788
// Note: we can't just put the code below inside stream().forach(), because it can throw
// IOException.
for (JarEntry jarEntry : inputJar.stream().collect(ImmutableList.toImmutableList())) {
for (JarEntry jarEntry : (Iterable<JarEntry>) inputJar.stream()::iterator) {
InputStream is = inputJar.getInputStream(jarEntry);
copyAndAnnotateJarEntry(
jarEntry,
Expand Down Expand Up @@ -317,9 +317,9 @@ public static void annotateBytecodeInAar(
LOG(debug, "DEBUG", "nullableReturns: " + nullableReturns);
LOG(debug, "DEBUG", "nonnullParams: " + nonnullParams);
// Error Prone doesn't like usages of the old Java Enumerator APIs. ZipFile does not implement
// Iterable, and likely
// never will (see https://bugs.openjdk.java.net/browse/JDK-6581715). So this seems like the
// best remaining way:
// Iterable, and likely never will (see https://bugs.openjdk.java.net/browse/JDK-6581715).
// Additionally, inputZip.stream() returns a Stream<? extends ZipEntry>, and the ::iterator
// method has trouble handling that. So this seems like the best remaining way:
for (ZipEntry zipEntry : inputZip.stream().collect(ImmutableList.toImmutableList())) {
InputStream is = inputZip.getInputStream(zipEntry);
zipOS.putNextEntry(new ZipEntry(zipEntry.getName()));
Expand Down

0 comments on commit 1d029e5

Please sign in to comment.