KT-12895, EA-84877: Fix NoSuchMethodError thrown when saving a Kotlin file.
newOutputStreamSupplier() is deprecated and was deleted in Guava 18.
This commit is contained in:
@@ -29,11 +29,11 @@ import com.google.common.base.Charsets;
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
import com.google.common.io.ByteSink;
|
||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
import com.google.common.primitives.UnsignedBytes;
|
import com.google.common.primitives.UnsignedBytes;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
@@ -599,9 +599,9 @@ public class ApiLookup {
|
|||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
file.delete();
|
file.delete();
|
||||||
}
|
}
|
||||||
FileOutputStream output = Files.newOutputStreamSupplier(file).getOutput();
|
|
||||||
output.write(b);
|
ByteSink sink = Files.asByteSink(file);
|
||||||
output.close();
|
sink.write(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For debugging only
|
// For debugging only
|
||||||
|
|||||||
Reference in New Issue
Block a user