From 41fc5493e2ba8dc1ba9b8e14c463e52c8988bda5 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Fri, 26 Dec 2014 13:32:54 +0300 Subject: [PATCH] fixed test --- src/org/jetbrains/java/decompiler/main/TextBuffer.java | 7 ++++++- testData/results/TestClassVar.dec | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/TextBuffer.java b/src/org/jetbrains/java/decompiler/main/TextBuffer.java index 2016f08..93e5193 100644 --- a/src/org/jetbrains/java/decompiler/main/TextBuffer.java +++ b/src/org/jetbrains/java/decompiler/main/TextBuffer.java @@ -307,7 +307,12 @@ public class TextBuffer { if (lineMapping.length > 0) { myLineMapping = new HashMap(); for (int i = 0; i < lineMapping.length; i+=2) { - myLineMapping.put(lineMapping[i+1], lineMapping[i]); + int key = lineMapping[i + 1]; + int value = lineMapping[i]; + Integer existing = myLineMapping.get(key); + if (existing == null || value < existing) { + myLineMapping.put(key, value); + } } } } diff --git a/testData/results/TestClassVar.dec b/testData/results/TestClassVar.dec index e2395b1..14d2e07 100644 --- a/testData/results/TestClassVar.dec +++ b/testData/results/TestClassVar.dec @@ -27,7 +27,7 @@ public class TestClassVar { while(var1 < 10) {// 47 int var2; - for(var2 = var1; var1 < 10 && var1 == 0; ++var1) {// 51 + for(var2 = var1; var1 < 10 && var1 == 0; ++var1) {// 49 ; }