diff --git a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java index 3fe0e01..66cfa63 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java @@ -282,12 +282,13 @@ public class ClassesProcessor { buffer.append(classBuffer); - if(DecompilerContext.getOption(IFernflowerPreferences.BYTECODE_SOURCE_MAPPING)) { + if (DecompilerContext.getOption(IFernflowerPreferences.BYTECODE_SOURCE_MAPPING)) { BytecodeSourceMapper mapper = DecompilerContext.getBytecodeSourceMapper(); mapper.addTotalOffset(total_offset_lines); - - buffer.append(lineSeparator); - mapper.dumpMapping(buffer, true); + if (DecompilerContext.getOption(IFernflowerPreferences.UNIT_TEST_MODE)) { + buffer.append(lineSeparator); + mapper.dumpMapping(buffer, true); + } } } finally { diff --git a/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java b/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java index 677d05d..9e8dc72 100644 --- a/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java +++ b/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java @@ -43,7 +43,6 @@ public interface IFernflowerPreferences { String FINALLY_DEINLINE = "fdi"; String IDEA_NOT_NULL_ANNOTATION = "inn"; String LAMBDA_TO_ANONYMOUS_CLASS = "lac"; - String BYTECODE_SOURCE_MAPPING = "bsm"; String USE_DEBUG_LINE_NUMBERS = "udl"; @@ -53,9 +52,10 @@ public interface IFernflowerPreferences { String USER_RENAMER_CLASS = "urc"; String NEW_LINE_SEPARATOR = "nls"; String INDENT_STRING = "ind"; - String BANNER = "ban"; + String UNIT_TEST_MODE = "__unit_test_mode__"; + String LINE_SEPARATOR_WIN = "\r\n"; String LINE_SEPARATOR_LIN = "\n"; @@ -81,16 +81,15 @@ public interface IFernflowerPreferences { put(FINALLY_DEINLINE, "1"); put(IDEA_NOT_NULL_ANNOTATION, "1"); put(LAMBDA_TO_ANONYMOUS_CLASS, "0"); - put(BYTECODE_SOURCE_MAPPING, "0"); put(USE_DEBUG_LINE_NUMBERS, "0"); - put(BANNER, ""); - put(LOG_LEVEL, IFernflowerLogger.Severity.INFO.name()); put(MAX_PROCESSING_METHOD, "0"); put(RENAME_ENTITIES, "0"); put(NEW_LINE_SEPARATOR, (InterpreterUtil.IS_WINDOWS ? "0" : "1")); put(INDENT_STRING, " "); + put(BANNER, ""); + put(UNIT_TEST_MODE, "0"); }}); } diff --git a/test/org/jetbrains/java/decompiler/DecompilerTestFixture.java b/test/org/jetbrains/java/decompiler/DecompilerTestFixture.java index 9508c61..d0d869c 100644 --- a/test/org/jetbrains/java/decompiler/DecompilerTestFixture.java +++ b/test/org/jetbrains/java/decompiler/DecompilerTestFixture.java @@ -56,6 +56,7 @@ public class DecompilerTestFixture { put(IFernflowerPreferences.REMOVE_SYNTHETIC, "1"); put(IFernflowerPreferences.REMOVE_BRIDGE, "1"); put(IFernflowerPreferences.LITERALS_AS_IS, "1"); + put(IFernflowerPreferences.UNIT_TEST_MODE, "1"); putAll(options); }}); }