From d99035e27db5b2d14544850b978e32197e78665d Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Wed, 29 Jun 2016 17:47:46 +0300 Subject: [PATCH] KT-12895, EA-84877: Fix NoSuchMethodError thrown when saving a Kotlin file. newOutputStreamSupplier() is deprecated and was deleted in Guava 18. (cherry picked from commit bb083a5) --- .../src/com/android/tools/klint/checks/ApiLookup.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/lint/lint-checks/src/com/android/tools/klint/checks/ApiLookup.java b/plugins/lint/lint-checks/src/com/android/tools/klint/checks/ApiLookup.java index f3bc783208325..cf8588b25f0b4 100644 --- a/plugins/lint/lint-checks/src/com/android/tools/klint/checks/ApiLookup.java +++ b/plugins/lint/lint-checks/src/com/android/tools/klint/checks/ApiLookup.java @@ -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; @@ -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