From a05c96972edd4d7554671cb5d2e03537014ba1f1 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 6 Oct 2016 14:27:40 +0300 Subject: [PATCH] renamed ambiguous getBom to getPossibleBom --- .../intellij/diff/tools/external/ExternalDiffToolUtil.java | 2 +- .../util/src/com/intellij/openapi/vfs/CharsetToolkit.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/diff-impl/src/com/intellij/diff/tools/external/ExternalDiffToolUtil.java b/platform/diff-impl/src/com/intellij/diff/tools/external/ExternalDiffToolUtil.java index 2eccc8d703ed..936ee405660f 100644 --- a/platform/diff-impl/src/com/intellij/diff/tools/external/ExternalDiffToolUtil.java +++ b/platform/diff-impl/src/com/intellij/diff/tools/external/ExternalDiffToolUtil.java @@ -129,7 +129,7 @@ public class ExternalDiffToolUtil { byte[] bytes = contentData.getBytes(charset); - byte[] bom = hasBom ? CharsetToolkit.getBom(charset) : null; + byte[] bom = hasBom ? CharsetToolkit.getPossibleBom(charset) : null; if (bom != null) { bytes = ArrayUtil.mergeArrays(bom, bytes); } diff --git a/platform/util/src/com/intellij/openapi/vfs/CharsetToolkit.java b/platform/util/src/com/intellij/openapi/vfs/CharsetToolkit.java index 178936acf6ec..b8f94ab9e12e 100644 --- a/platform/util/src/com/intellij/openapi/vfs/CharsetToolkit.java +++ b/platform/util/src/com/intellij/openapi/vfs/CharsetToolkit.java @@ -624,8 +624,12 @@ public class CharsetToolkit { return CHARSET_TO_MANDATORY_BOM.get(charset); } + /** + * @return BOM which can be associated with this charset, or null otherwise. + * Currently these are UTF-16xx, UTF-32xx and UTF-8. + */ @Nullable - public static byte[] getBom(@NotNull Charset charset) { + public static byte[] getPossibleBom(@NotNull Charset charset) { if (charset.equals(UTF8_CHARSET)) return UTF8_BOM; return CHARSET_TO_MANDATORY_BOM.get(charset); }