Skip to content

Commit

Permalink
KT-12895, EA-84877: Fix NoSuchMethodError thrown when saving a Kotlin…
Browse files Browse the repository at this point in the history
… file.

newOutputStreamSupplier() is deprecated and was deleted in Guava 18.
(cherry picked from commit bb083a5)
  • Loading branch information
yanex committed Jun 29, 2016
1 parent b0a2750 commit d99035e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.common.io.ByteSink;
import com.google.common.io.Files;
import com.google.common.primitives.UnsignedBytes;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.nio.ByteBuffer;
Expand Down Expand Up @@ -599,9 +599,9 @@ private static void writeDatabase(File file, Api info) throws IOException {
if (file.exists()) {
file.delete();
}
FileOutputStream output = Files.newOutputStreamSupplier(file).getOutput();
output.write(b);
output.close();

ByteSink sink = Files.asByteSink(file);
sink.write(b);
}

// For debugging only
Expand Down

0 comments on commit d99035e

Please sign in to comment.