Fix empty-zip change.
Forgot to actually set the stream when creating it. :-\
R=sgjesse@google.com
Change-Id: Ib863ef2802ed79483e5520bf433f8a4536d4d276
diff --git a/src/main/java/com/android/tools/r8/utils/ArchiveBuilder.java b/src/main/java/com/android/tools/r8/utils/ArchiveBuilder.java
index 25512f7..1a64ab0 100644
--- a/src/main/java/com/android/tools/r8/utils/ArchiveBuilder.java
+++ b/src/main/java/com/android/tools/r8/utils/ArchiveBuilder.java
@@ -57,19 +57,18 @@
if (stream != null) {
return stream;
}
- return new ZipOutputStream(Files.newOutputStream(
+ stream = new ZipOutputStream(Files.newOutputStream(
archive, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING));
+ return stream;
}
/** Get or open the zip output stream. */
private synchronized ZipOutputStream getStream(DiagnosticsHandler handler) {
assert !closed;
- if (stream == null) {
- try {
- getStreamRaw();
- } catch (IOException e) {
- handler.error(new ExceptionDiagnostic(e, origin));
- }
+ try {
+ getStreamRaw();
+ } catch (IOException e) {
+ handler.error(new ExceptionDiagnostic(e, origin));
}
return stream;
}