From 47fad13908175108516f835dbe250ad1a57a1750 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Mon, 20 Oct 2014 16:03:59 +0400 Subject: [PATCH] decompiler: fixed incorrect line numbers in dumped mapping --- .../main/collectors/BytecodeSourceMapper.java | 2 +- .../results/TestClassSimpleBytecodeMapping.dec | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/collectors/BytecodeSourceMapper.java b/src/org/jetbrains/java/decompiler/main/collectors/BytecodeSourceMapper.java index ce328a9..26e6f78 100644 --- a/src/org/jetbrains/java/decompiler/main/collectors/BytecodeSourceMapper.java +++ b/src/org/jetbrains/java/decompiler/main/collectors/BytecodeSourceMapper.java @@ -97,7 +97,7 @@ public class BytecodeSourceMapper { buffer.append("Lines mapping:").appendLineSeparator(); Map sorted = new TreeMap(linesMapping); for (Entry entry : sorted.entrySet()) { - buffer.append(entry.getKey()).append(" <-> ").append(entry.getValue()).appendLineSeparator(); + buffer.append(entry.getKey()).append(" <-> ").append(entry.getValue()+ offset_total + 1).appendLineSeparator(); } } diff --git a/testData/results/TestClassSimpleBytecodeMapping.dec b/testData/results/TestClassSimpleBytecodeMapping.dec index e5dfb1c..9a46f78 100644 --- a/testData/results/TestClassSimpleBytecodeMapping.dec +++ b/testData/results/TestClassSimpleBytecodeMapping.dec @@ -58,12 +58,12 @@ class 'pkg/TestClassSimpleBytecodeMapping' { } Lines mapping: -12 <-> 2 -14 <-> 3 -17 <-> 5 -21 <-> 8 -22 <-> 9 -23 <-> 10 -25 <-> 12 -26 <-> 13 -31 <-> 18 +12 <-> 5 +14 <-> 6 +17 <-> 8 +21 <-> 11 +22 <-> 12 +23 <-> 13 +25 <-> 15 +26 <-> 16 +31 <-> 21