From f7d260b6704cf476008af4bb3e2bf59ad11ee6d5 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 2 Nov 2020 16:18:05 +0300 Subject: [PATCH] more IDEA-CR-68293 followup GitOrigin-RevId: 8e2074533d28dca341f304e8afc7e2a91eba16ac --- .../analysis-api/src/com/intellij/openapi/vfs/VfsUtil.java | 4 ++-- .../core-api/src/com/intellij/openapi/vfs/VirtualFile.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/analysis-api/src/com/intellij/openapi/vfs/VfsUtil.java b/platform/analysis-api/src/com/intellij/openapi/vfs/VfsUtil.java index 49cea79d1012..28f307d28896 100644 --- a/platform/analysis-api/src/com/intellij/openapi/vfs/VfsUtil.java +++ b/platform/analysis-api/src/com/intellij/openapi/vfs/VfsUtil.java @@ -42,7 +42,7 @@ public final class VfsUtil extends VfsUtilCore { public static void saveText(@NotNull VirtualFile file, @NotNull String text) throws IOException { Charset charset = file.getCharset(); try (OutputStream stream = file.getOutputStream(file)) { - stream.write(text.getBytes(charset.name())); + stream.write(text.getBytes(charset)); } } @@ -52,7 +52,7 @@ public final class VfsUtil extends VfsUtilCore { } Charset charset = file.getCharset(); - return text.getBytes(charset.name()); + return text.getBytes(charset); } /** diff --git a/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java b/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java index 41b7b57cbb5b..d78899430326 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java @@ -604,7 +604,7 @@ public abstract class VirtualFile extends UserDataHolderBase implements Modifica /** * Returns file content as an array of bytes. - * Has the same effect as {@link #contentsToByteArray(boolean)}. + * Has the same effect as {@link #contentsToByteArray(boolean) contentsToByteArray(true)}. * * @return file content * @throws IOException if an I/O error occurs