From 4572aecdb298fdfd9b377eac81ff7b2ed4fbfcbf Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 1 Sep 2014 16:19:31 +0400 Subject: [PATCH] java-decompiler: post-import cleanup (OS-dependent line separator) --- plugins/java-decompiler/engine/readme.txt | 2 +- .../java/decompiler/main/extern/IFernflowerPreferences.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/java-decompiler/engine/readme.txt b/plugins/java-decompiler/engine/readme.txt index 8947fde1a213..b0ea2733f6f3 100644 --- a/plugins/java-decompiler/engine/readme.txt +++ b/plugins/java-decompiler/engine/readme.txt @@ -64,7 +64,7 @@ urc : full name of user-supplied class implementing IIdentifierRenamer. It is should be renamed and provides new identifier names. For more information see section 5 inn (1): check for IntelliJ IDEA-specific @NotNull annotation and remove inserted code if found lac (0): decompile lambda expressions to anonymous classes -nls (0): define new line character to be used for output. 0 - '\r\n' (Windows), 1 - '\n' (Linux) +nls (0): define new line character to be used for output. 0 - '\r\n' (Windows), 1 - '\n' (Linux), default is OS-dependent ind : indentation string (default is " " (3 spaces)) The default logging level is INFO. This value can be overwritten by setting the option 'log' as follows: diff --git a/plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java b/plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java index 2052a99bb06d..4ef8ba9f8d48 100644 --- a/plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java +++ b/plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java @@ -75,9 +75,10 @@ public interface IFernflowerPreferences { put(IDEA_NOT_NULL_ANNOTATION, "1"); put(LAMBDA_TO_ANONYMOUS_CLASS, "0"); + boolean win = System.getProperty("os.name", "").startsWith("Windows"); put(MAX_PROCESSING_METHOD, "0"); put(RENAME_ENTITIES, "0"); - put(NEW_LINE_SEPARATOR, "0"); + put(NEW_LINE_SEPARATOR, (win ? "0" : "1")); put(INDENT_STRING, " "); }}); }