From 500f8b12d8226e5177b964ac697ba057eea95a82 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Tue, 24 Mar 2015 17:56:33 +0300 Subject: [PATCH] decompiler: map dummy return line to the method closing bracket --- .../java/decompiler/main/ClassWriter.java | 14 +-- .../collectors/BytecodeMappingTracer.java | 12 ++- .../main/collectors/BytecodeSourceMapper.java | 16 +++- .../modules/decompiler/DomHelper.java | 5 +- .../modules/decompiler/ExitHelper.java | 7 +- .../decompiler/stats/DummyExitStatement.java | 42 +++++++++ .../decompiler/stats/RootStatement.java | 10 +-- testData/results/InvalidMethodSignature.dec | 18 ++-- testData/results/TestAbstractMethods.dec | 4 +- testData/results/TestAmbiguousCall.dec | 18 +++- .../TestAmbiguousCallWithDebugInfo.dec | 18 +++- testData/results/TestAnonymousClass.dec | 54 +++++++++--- testData/results/TestClassCast.dec | 4 +- testData/results/TestClassFields.dec | 6 +- testData/results/TestClassLambda.dec | 45 +++++++--- testData/results/TestClassLoop.dec | 5 ++ .../results/TestClassNestedInitializer.dec | 5 +- .../TestClassSimpleBytecodeMapping.dec | 23 +++-- testData/results/TestClassSwitch.dec | 4 +- testData/results/TestClassTypes.dec | 15 +++- testData/results/TestClassVar.dec | 10 ++- testData/results/TestCodeConstructs.dec | 4 +- testData/results/TestConstants.dec | 73 +++++++++++++--- testData/results/TestDeprecations.dec | 16 +++- testData/results/TestEnum.dec | 37 ++++++-- .../results/TestInnerClassConstructor.dec | 14 ++- testData/results/TestInnerLocal.dec | 34 ++++++-- testData/results/TestInnerLocalPkg.dec | 34 ++++++-- testData/results/TestInnerSignature.dec | 16 +++- testData/results/TestLocalClass.dec | 16 +++- testData/results/TestMethodParameters.dec | 86 ++++++++++++++++--- testData/results/TestSynchronizedMapping.dec | 6 +- testData/results/TestThrowException.dec | 10 ++- testData/results/TestTryCatchFinally.dec | 12 ++- 34 files changed, 565 insertions(+), 128 deletions(-) create mode 100644 src/org/jetbrains/java/decompiler/modules/decompiler/stats/DummyExitStatement.java diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index 502e989..03318a9 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -534,8 +534,8 @@ public class ClassWriter { indent += 1; } + RootStatement root = classWrapper.getMethodWrapper(mt.getName(), mt.getDescriptor()).root; if (!methodWrapper.decompiledWithErrors) { - RootStatement root = classWrapper.getMethodWrapper(mt.getName(), mt.getDescriptor()).root; if (root != null) { // check for existence try { buffer.append(root.toJava(indent, tracer)); @@ -553,12 +553,13 @@ public class ClassWriter { buffer.appendLineSeparator(); } + if (root != null) { + tracer.addMapping(root.getDummyExit().bytecode); + } + if (!codeOnly) { indent -= 1; - - buffer.appendIndent(indent); - buffer.append('}'); - buffer.appendLineSeparator(); + buffer.appendIndent(indent).append('}').appendLineSeparator(); } } finally { @@ -869,6 +870,9 @@ public class ClassWriter { tracer.incrementCurrentSourceLine(); } + if (root != null) { + tracer.addMapping(root.getDummyExit().bytecode); + } buffer.appendIndent(indent).append('}').appendLineSeparator(); tracer.incrementCurrentSourceLine(); } diff --git a/src/org/jetbrains/java/decompiler/main/collectors/BytecodeMappingTracer.java b/src/org/jetbrains/java/decompiler/main/collectors/BytecodeMappingTracer.java index 9827ffc..8a4fc44 100644 --- a/src/org/jetbrains/java/decompiler/main/collectors/BytecodeMappingTracer.java +++ b/src/org/jetbrains/java/decompiler/main/collectors/BytecodeMappingTracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,6 +89,12 @@ public class BytecodeMappingTracer { this.lineNumberTable = lineNumberTable; } + private final Set unmappedLines = new HashSet(); + + public Set getUnmappedLines() { + return unmappedLines; + } + public Map getOriginalLinesMapping() { if (lineNumberTable == null) { return Collections.emptyMap(); @@ -103,11 +109,15 @@ public class BytecodeMappingTracer { if (newLine != null) { res.put(originalLine, newLine); } + else { + unmappedLines.add(originalLine); + } } for (Entry entry : mapping.entrySet()) { int originalLine = lineNumberTable.findLineNumber(entry.getKey()); if (originalLine > -1) { res.put(originalLine, entry.getValue()); + unmappedLines.remove(originalLine); } } return res; diff --git a/src/org/jetbrains/java/decompiler/main/collectors/BytecodeSourceMapper.java b/src/org/jetbrains/java/decompiler/main/collectors/BytecodeSourceMapper.java index 26e6f78..8d3770b 100644 --- a/src/org/jetbrains/java/decompiler/main/collectors/BytecodeSourceMapper.java +++ b/src/org/jetbrains/java/decompiler/main/collectors/BytecodeSourceMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ public class BytecodeSourceMapper { // original line to decompiled line private final Map linesMapping = new HashMap(); + private final Set unmappedLines = new TreeSet(); public void addMapping(String className, String methodName, int bytecodeOffset, int sourceLine) { Map> class_mapping = mapping.get(className); @@ -53,6 +54,7 @@ public class BytecodeSourceMapper { addMapping(className, methodName, entry.getKey(), entry.getValue()); } linesMapping.putAll(tracer.getOriginalLinesMapping()); + unmappedLines.addAll(tracer.getUnmappedLines()); } public void dumpMapping(TextBuffer buffer, boolean offsetsToHex) { @@ -97,7 +99,16 @@ 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()+ offset_total + 1).appendLineSeparator(); + buffer.append(entry.getKey()).append(" <-> ").append(entry.getValue() + offset_total + 1).appendLineSeparator(); + } + + if (!unmappedLines.isEmpty()) { + buffer.append("Not mapped:").appendLineSeparator(); + for (Integer line : unmappedLines) { + if (!linesMapping.containsKey(line)) { + buffer.append(line).appendLineSeparator(); + } + } } } @@ -121,6 +132,7 @@ public class BytecodeSourceMapper { int i = 0; for (Entry entry : linesMapping.entrySet()) { res[i] = entry.getKey(); + unmappedLines.remove(entry.getKey()); res[i + 1] = entry.getValue() + offset_total + 1; // make it 1 based i += 2; } diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/DomHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/DomHelper.java index 9527326..c93be38 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/DomHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/DomHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,8 +46,7 @@ public class DomHelper { // head statement Statement firstst = stats.getWithKey(firstblock.id); // dummy exit statement - Statement dummyexit = new Statement(); - dummyexit.type = Statement.TYPE_DUMMYEXIT; + DummyExitStatement dummyexit = new DummyExitStatement(); Statement general; if (stats.size() > 1 || firstblock.isSuccessor(firstblock)) { // multiple basic blocks or an infinite loop of one block diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/ExitHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/ExitHelper.java index a7ccf24..d467cdc 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/ExitHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/ExitHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -247,7 +247,9 @@ public class ExitHelper { boolean res = false; - for (StatEdge edge : root.getDummyExit().getAllPredecessorEdges()) { + DummyExitStatement dummyExit = root.getDummyExit(); + + for (StatEdge edge : dummyExit.getAllPredecessorEdges()) { if (!edge.explicit) { Statement source = edge.getSource(); List lstExpr = source.getExprents(); @@ -257,6 +259,7 @@ public class ExitHelper { ExitExprent ex = (ExitExprent)expr; if (ex.getExitType() == ExitExprent.EXIT_RETURN && ex.getValue() == null) { // remove redundant return + dummyExit.addBytecodeOffsets(ex.bytecode); lstExpr.remove(lstExpr.size() - 1); res = true; } diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/DummyExitStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/DummyExitStatement.java new file mode 100644 index 0000000..ba82182 --- /dev/null +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/DummyExitStatement.java @@ -0,0 +1,42 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.java.decompiler.modules.decompiler.stats; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +/** + * @author egor + */ +public class DummyExitStatement extends Statement { + public Set bytecode = null; // offsets of bytecode instructions mapped to dummy exit + + public DummyExitStatement() { + type = Statement.TYPE_DUMMYEXIT; + } + + public void addBytecodeOffsets(Collection bytecodeOffsets) { + if (bytecodeOffsets != null && !bytecodeOffsets.isEmpty()) { + if (bytecode == null) { + bytecode = new HashSet(bytecodeOffsets); + } + else { + bytecode.addAll(bytecodeOffsets); + } + } + } +} diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/RootStatement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/RootStatement.java index 42323fc..7193f9a 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/RootStatement.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/RootStatement.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,9 +22,9 @@ import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor; public class RootStatement extends Statement { - private Statement dummyExit; + private DummyExitStatement dummyExit; - public RootStatement(Statement head, Statement dummyExit) { + public RootStatement(Statement head, DummyExitStatement dummyExit) { type = Statement.TYPE_ROOT; @@ -39,11 +39,11 @@ public class RootStatement extends Statement { return ExprProcessor.listToJava(varDefinitions, indent, tracer).append(first.toJava(indent, tracer)); } - public Statement getDummyExit() { + public DummyExitStatement getDummyExit() { return dummyExit; } - public void setDummyExit(Statement dummyExit) { + public void setDummyExit(DummyExitStatement dummyExit) { this.dummyExit = dummyExit; } } diff --git a/testData/results/InvalidMethodSignature.dec b/testData/results/InvalidMethodSignature.dec index 24b7c85..34f2236 100644 --- a/testData/results/InvalidMethodSignature.dec +++ b/testData/results/InvalidMethodSignature.dec @@ -13,22 +13,23 @@ class i implements bg { i(b var1, j var2) { this.b = var1; - this.a = var2;// 1 - } + this.a = var2; + }// 1 public void a(c var1, k var2, boolean var3) { File var4 = this.a.b().a(var1);// 2 b.a(this.b).add(var4);// 3 - } + }// 4 public void a(a.a.a.a.c.b var1) { - } + }// 0 } class 'a/a/a/a/e/f/i' { method ' (La/a/a/a/e/f/b;La/a/a/a/c/j;)V' { 2 14 7 15 + e 16 } method 'a (La/a/a/a/c/c;La/a/a/a/a/k;Z)V' { @@ -39,10 +40,17 @@ class 'a/a/a/a/e/f/i' { 12 20 15 20 1a 20 + 20 21 + } + + method 'a (La/a/a/a/c/b;)V' { + 0 24 } } Lines mapping: -1 <-> 16 +0 <-> 25 +1 <-> 17 2 <-> 20 3 <-> 21 +4 <-> 22 diff --git a/testData/results/TestAbstractMethods.dec b/testData/results/TestAbstractMethods.dec index 59b1027..781cbfc 100644 --- a/testData/results/TestAbstractMethods.dec +++ b/testData/results/TestAbstractMethods.dec @@ -11,7 +11,7 @@ public abstract class TestAbstractMethods { public void test2(String var1) { System.out.println(var1);// 17 - } + }// 18 } class 'pkg/TestAbstractMethods' { @@ -22,9 +22,11 @@ class 'pkg/TestAbstractMethods' { method 'test2 (Ljava/lang/String;)V' { 0 12 4 12 + 7 13 } } Lines mapping: 11 <-> 7 17 <-> 13 +18 <-> 14 diff --git a/testData/results/TestAmbiguousCall.dec b/testData/results/TestAmbiguousCall.dec index caeb41d..a48730d 100644 --- a/testData/results/TestAmbiguousCall.dec +++ b/testData/results/TestAmbiguousCall.dec @@ -2,10 +2,10 @@ package pkg; class TestAmbiguousCall { void m1(RuntimeException var1, String var2) { - } + }// 4 void m1(IllegalArgumentException var1, String var2) { - } + }// 5 void test() { IllegalArgumentException var1 = new IllegalArgumentException();// 8 @@ -14,10 +14,18 @@ class TestAmbiguousCall { IllegalArgumentException var2 = new IllegalArgumentException();// 12 this.m1((RuntimeException)var2, "RE");// 13 this.m1((IllegalArgumentException)var2, "IAE");// 14 - } + }// 15 } class 'pkg/TestAmbiguousCall' { + method 'm1 (Ljava/lang/RuntimeException;Ljava/lang/String;)V' { + 0 4 + } + + method 'm1 (Ljava/lang/IllegalArgumentException;Ljava/lang/String;)V' { + 0 7 + } + method 'test ()V' { 7 10 a 11 @@ -30,13 +38,17 @@ class 'pkg/TestAmbiguousCall' { 27 15 2a 15 2c 15 + 2f 16 } } Lines mapping: +4 <-> 5 +5 <-> 8 8 <-> 11 9 <-> 12 10 <-> 13 12 <-> 14 13 <-> 15 14 <-> 16 +15 <-> 17 diff --git a/testData/results/TestAmbiguousCallWithDebugInfo.dec b/testData/results/TestAmbiguousCallWithDebugInfo.dec index 6380d6d..40f1eaf 100644 --- a/testData/results/TestAmbiguousCallWithDebugInfo.dec +++ b/testData/results/TestAmbiguousCallWithDebugInfo.dec @@ -2,10 +2,10 @@ package pkg; class TestAmbiguousCall { void m1(RuntimeException e, String s) { - } + }// 4 void m1(IllegalArgumentException e, String s) { - } + }// 5 void test() { IllegalArgumentException iae = new IllegalArgumentException();// 8 @@ -14,10 +14,18 @@ class TestAmbiguousCall { IllegalArgumentException re = new IllegalArgumentException();// 12 this.m1((RuntimeException)re, "RE");// 13 this.m1((IllegalArgumentException)re, "IAE");// 14 - } + }// 15 } class 'pkg/TestAmbiguousCall' { + method 'm1 (Ljava/lang/RuntimeException;Ljava/lang/String;)V' { + 0 4 + } + + method 'm1 (Ljava/lang/IllegalArgumentException;Ljava/lang/String;)V' { + 0 7 + } + method 'test ()V' { 7 10 a 11 @@ -30,13 +38,17 @@ class 'pkg/TestAmbiguousCall' { 27 15 2a 15 2c 15 + 2f 16 } } Lines mapping: +4 <-> 5 +5 <-> 8 8 <-> 11 9 <-> 12 10 <-> 13 12 <-> 14 13 <-> 15 14 <-> 16 +15 <-> 17 diff --git a/testData/results/TestAnonymousClass.dec b/testData/results/TestAnonymousClass.dec index d0ae4ec..75d1df2 100644 --- a/testData/results/TestAnonymousClass.dec +++ b/testData/results/TestAnonymousClass.dec @@ -5,26 +5,26 @@ public abstract class TestAnonymousClass { public void run() { boolean var1 = true;// 28 boolean var2 = true;// 29 - } + }// 30 }; public static final Runnable R = new Runnable() { public void run() { boolean var1 = true;// 45 boolean var2 = true;// 46 - } + }// 47 }; public static final Runnable R1 = new Runnable() { public void run() { boolean var1 = true;// 53 boolean var2 = true;// 54 - } + }// 55 }; private final TestAnonymousClass.InnerRecursive y = new TestAnonymousClass.InnerRecursive(new TestAnonymousClass.InnerRecursive((TestAnonymousClass.InnerRecursive)null) { void foo() { boolean var1 = true;// 75 boolean var2 = true;// 76 boolean var3 = true;// 77 - } + }// 78 }) { int v = 5; int t = 5; @@ -36,7 +36,7 @@ public abstract class TestAnonymousClass { boolean var1 = true;// 90 boolean var2 = true;// 91 boolean var3 = true;// 92 - } + }// 93 }) { int v = 5; int t = 5; @@ -50,32 +50,32 @@ public abstract class TestAnonymousClass { public void foo() throws Exception { boolean var1 = true;// 13 boolean var2 = true;// 14 - } + }// 15 };// 11 var2.foo();// 17 } else { System.out.println(5);// 21 } - } + }// 23 void boo() { boolean var1 = true;// 35 - } + }// 36 void zoo() { boolean var1 = true;// 39 - } + }// 40 static class InnerRecursive { TestAnonymousClass.InnerRecursive r; public InnerRecursive(TestAnonymousClass.InnerRecursive var1) { this.r = var1;// 105 - } + }// 106 void foo() { - } + }// 110 } private static class Inner { @@ -83,7 +83,7 @@ public abstract class TestAnonymousClass { public void run() { boolean var1 = true;// 66 boolean var2 = true;// 67 - } + }// 68 }; } @@ -98,6 +98,7 @@ class 'pkg/TestAnonymousClass$2' { 1 5 2 6 3 6 + 4 7 } } @@ -107,6 +108,7 @@ class 'pkg/TestAnonymousClass$3' { 1 11 2 12 3 12 + 4 13 } } @@ -116,6 +118,7 @@ class 'pkg/TestAnonymousClass$4' { 1 17 2 18 3 18 + 4 19 } } @@ -127,6 +130,7 @@ class 'pkg/TestAnonymousClass$5' { 3 24 4 25 5 25 + 6 26 } } @@ -138,6 +142,7 @@ class 'pkg/TestAnonymousClass$7' { 3 36 4 37 5 37 + 6 38 } } @@ -147,6 +152,7 @@ class 'pkg/TestAnonymousClass$1' { 1 50 2 51 3 51 + 4 52 } } @@ -158,22 +164,30 @@ class 'pkg/TestAnonymousClass' { 16 56 19 56 1a 56 + 1d 59 } method 'boo ()V' { 0 62 1 62 + 2 63 } method 'zoo ()V' { 0 66 1 66 + 2 67 } } class 'pkg/TestAnonymousClass$InnerRecursive' { method ' (Lpkg/TestAnonymousClass$InnerRecursive;)V' { 6 73 + 9 74 + } + + method 'foo ()V' { + 0 77 } } @@ -183,6 +197,7 @@ class 'pkg/TestAnonymousClass$Inner$1' { 1 83 2 84 3 84 + 4 85 } } @@ -191,22 +206,37 @@ Lines mapping: 11 <-> 54 13 <-> 51 14 <-> 52 +15 <-> 53 17 <-> 55 21 <-> 57 +23 <-> 60 28 <-> 6 29 <-> 7 +30 <-> 8 35 <-> 63 +36 <-> 64 39 <-> 67 +40 <-> 68 45 <-> 12 46 <-> 13 +47 <-> 14 53 <-> 18 54 <-> 19 +55 <-> 20 66 <-> 84 67 <-> 85 +68 <-> 86 75 <-> 24 76 <-> 25 77 <-> 26 +78 <-> 27 90 <-> 36 91 <-> 37 92 <-> 38 +93 <-> 39 105 <-> 74 +106 <-> 75 +110 <-> 78 +Not mapped: +18 +104 diff --git a/testData/results/TestClassCast.dec b/testData/results/TestClassCast.dec index 7593d6d..c45fad8 100644 --- a/testData/results/TestClassCast.dec +++ b/testData/results/TestClassCast.dec @@ -11,7 +11,7 @@ public class TestClassCast { } System.out.println(((List)var2).size());// 26 - } + }// 27 } class 'pkg/TestClassCast' { @@ -24,6 +24,7 @@ class 'pkg/TestClassCast' { 18 12 1c 12 21 12 + 24 13 } } @@ -32,3 +33,4 @@ Lines mapping: 23 <-> 9 24 <-> 10 26 <-> 13 +27 <-> 14 diff --git a/testData/results/TestClassFields.dec b/testData/results/TestClassFields.dec index 1415306..75ece1e 100644 --- a/testData/results/TestClassFields.dec +++ b/testData/results/TestClassFields.dec @@ -6,7 +6,7 @@ public class TestClassFields { static { sizes = new int[names.length];// 26 - } + }// 27 } class 'pkg/TestClassFields' { @@ -14,8 +14,12 @@ class 'pkg/TestClassFields' { 11 7 14 7 17 7 + 1a 8 } } Lines mapping: 26 <-> 8 +27 <-> 9 +Not mapped: +25 diff --git a/testData/results/TestClassLambda.dec b/testData/results/TestClassLambda.dec index 7dcada9..4b6e65f 100644 --- a/testData/results/TestClassLambda.dec +++ b/testData/results/TestClassLambda.dec @@ -20,8 +20,8 @@ public class TestClassLambda { var1.forEach((var2x) -> {// 32 int var3 = 2 * var2x.intValue();// 33 System.out.println(var3 + var2 + this.field);// 34 - }); - } + });// 35 + }// 36 public void testLambda1() { int var1 = (int)Math.random();// 39 @@ -31,26 +31,26 @@ public class TestClassLambda { Runnable var3 = () -> { System.out.println("hello2" + var1); };// 41 - } + }// 42 public void testLambda2() { reduce((var0, var1) -> {// 45 return Math.max(var0, var1); }); - } + }// 46 public void testLambda3() { reduce(Math::max);// 49 - } + }// 50 public void testLambda4() { reduce(TestClassLambda::localMax);// 53 - } + }// 54 public void testLambda5() { String var1 = "abcd";// 57 function(var1::toString);// 58 - } + }// 59 public void testLambda6() { ArrayList var1 = new ArrayList();// 62 @@ -59,11 +59,11 @@ public class TestClassLambda { var1.removeIf((var2x) -> {// 65 return var2 >= var2x.length() && var2x.length() <= var3; }); - } + }// 66 public static void testLambda7(Annotation[] var0) { Arrays.stream(var0).map(Annotation::annotationType);// 69 - } + }// 70 public static OptionalInt reduce(IntBinaryOperator var0) { return null;// 73 @@ -85,7 +85,7 @@ public class TestClassLambda { };// 87 System.out.println("hello1" + var1);// 88 };// 86 - } + }// 90 } class 'pkg/TestClassLambda' { @@ -99,6 +99,7 @@ class 'pkg/TestClassLambda' { e 21 11 21 12 21 + 15 22 } method 'testLambda ()V' { @@ -122,6 +123,7 @@ class 'pkg/TestClassLambda' { 40 18 41 18 4a 19 + 4f 23 } method 'lambda$testLambda1$1 (I)V' { @@ -129,6 +131,7 @@ class 'pkg/TestClassLambda' { a 28 13 28 16 28 + 19 29 } method 'lambda$testLambda1$2 (I)V' { @@ -136,6 +139,7 @@ class 'pkg/TestClassLambda' { a 31 13 31 16 31 + 19 32 } method 'testLambda1 ()V' { @@ -144,6 +148,7 @@ class 'pkg/TestClassLambda' { 4 26 b 29 12 32 + 13 33 } method 'lambda$testLambda2$3 (II)I' { @@ -153,20 +158,24 @@ class 'pkg/TestClassLambda' { method 'testLambda2 ()V' { 5 36 + 9 39 } method 'testLambda3 ()V' { 5 42 + 9 43 } method 'testLambda4 ()V' { 5 46 + 9 47 } method 'testLambda5 ()V' { 0 50 2 50 e 51 + 12 52 } method 'lambda$testLambda6$4 (IILjava/lang/String;)Z' { @@ -186,11 +195,13 @@ class 'pkg/TestClassLambda' { 18 57 19 57 22 58 + 28 61 } method 'testLambda7 ([Ljava/lang/annotation/Annotation;)V' { 1 64 9 64 + f 65 } method 'reduce (Ljava/util/function/IntBinaryOperator;)Ljava/util/OptionalInt;' { @@ -214,6 +225,7 @@ class 'pkg/TestClassLambda' { a 83 13 83 16 83 + 19 84 } method 'lambda$nestedLambdas$6 (I)V' { @@ -222,12 +234,14 @@ class 'pkg/TestClassLambda' { 11 85 1a 85 1d 85 + 20 86 } method 'nestedLambdas ()V' { 0 80 1 80 8 86 + 9 87 } } @@ -237,19 +251,28 @@ Lines mapping: 32 <-> 20 33 <-> 21 34 <-> 22 +35 <-> 23 +36 <-> 24 39 <-> 27 40 <-> 30 41 <-> 33 +42 <-> 34 45 <-> 37 +46 <-> 40 49 <-> 43 +50 <-> 44 53 <-> 47 +54 <-> 48 57 <-> 51 58 <-> 52 +59 <-> 53 62 <-> 56 63 <-> 57 64 <-> 58 65 <-> 59 +66 <-> 62 69 <-> 65 +70 <-> 66 73 <-> 69 77 <-> 73 81 <-> 77 @@ -257,3 +280,5 @@ Lines mapping: 86 <-> 87 87 <-> 85 88 <-> 86 +89 <-> 87 +90 <-> 88 diff --git a/testData/results/TestClassLoop.dec b/testData/results/TestClassLoop.dec index f3bf0e0..7cebd04 100644 --- a/testData/results/TestClassLoop.dec +++ b/testData/results/TestClassLoop.dec @@ -83,3 +83,8 @@ Lines mapping: 49 <-> 30 52 <-> 33 53 <-> 34 +Not mapped: +34 +39 +54 +58 diff --git a/testData/results/TestClassNestedInitializer.dec b/testData/results/TestClassNestedInitializer.dec index b9fa69c..0576e74 100644 --- a/testData/results/TestClassNestedInitializer.dec +++ b/testData/results/TestClassNestedInitializer.dec @@ -10,13 +10,14 @@ public class TestClassNestedInitializer { } };// 22 System.out.println(var1.secret);// 23 - } + }// 24 } class 'pkg/TestClassNestedInitializer$1' { method ' (Lpkg/TestClassNestedInitializer;)V' { a 8 c 8 + f 9 } } @@ -26,9 +27,11 @@ class 'pkg/TestClassNestedInitializer' { 9 11 d 11 10 11 + 13 12 } } Lines mapping: 22 <-> 11 23 <-> 12 +24 <-> 13 diff --git a/testData/results/TestClassSimpleBytecodeMapping.dec b/testData/results/TestClassSimpleBytecodeMapping.dec index b6b6bba..c450205 100644 --- a/testData/results/TestClassSimpleBytecodeMapping.dec +++ b/testData/results/TestClassSimpleBytecodeMapping.dec @@ -6,7 +6,7 @@ public class TestClassSimpleBytecodeMapping { this.run(new Runnable() {// 14 public void run() { System.out.println("Runnable");// 17 - } + }// 18 }); this.test2("1");// 21 if(Math.random() > 0.0D) {// 23 @@ -27,22 +27,22 @@ public class TestClassSimpleBytecodeMapping { System.out.println("Finally");// 38 } - } + }// 40 void run(Runnable var1) { var1.run();// 49 - } + }// 50 public class InnerClass2 { public void print() { System.out.println("Inner2");// 54 - } + }// 55 } public class InnerClass { public void print() { System.out.println("Inner");// 44 - } + }// 45 } } @@ -51,6 +51,7 @@ class 'pkg/TestClassSimpleBytecodeMapping$1' { 0 7 3 7 5 7 + 8 8 } } @@ -85,10 +86,12 @@ class 'pkg/TestClassSimpleBytecodeMapping' { 23 26 24 26 27 26 + 2e 29 } method 'run (Ljava/lang/Runnable;)V' { 1 32 + 6 33 } } @@ -97,6 +100,7 @@ class 'pkg/TestClassSimpleBytecodeMapping$InnerClass2' { 0 37 3 37 5 37 + 8 38 } } @@ -105,6 +109,7 @@ class 'pkg/TestClassSimpleBytecodeMapping$InnerClass' { 0 43 3 43 5 43 + 8 44 } } @@ -112,6 +117,7 @@ Lines mapping: 12 <-> 5 14 <-> 6 17 <-> 8 +18 <-> 9 21 <-> 11 23 <-> 12 24 <-> 13 @@ -121,6 +127,13 @@ Lines mapping: 34 <-> 23 36 <-> 25 38 <-> 27 +40 <-> 30 44 <-> 44 +45 <-> 45 49 <-> 33 +50 <-> 34 54 <-> 38 +55 <-> 39 +Not mapped: +35 +39 diff --git a/testData/results/TestClassSwitch.dec b/testData/results/TestClassSwitch.dec index 695350f..d8cb724 100644 --- a/testData/results/TestClassSwitch.dec +++ b/testData/results/TestClassSwitch.dec @@ -10,7 +10,7 @@ public class TestClassSwitch { case 13: System.out.println(13);// 24 } - } + }// 25 } class 'pkg/TestClassSwitch' { @@ -19,6 +19,7 @@ class 'pkg/TestClassSwitch' { 1c 10 1f 10 21 10 + 24 12 25 6 28 6 29 6 @@ -29,5 +30,6 @@ class 'pkg/TestClassSwitch' { Lines mapping: 22 <-> 5 24 <-> 11 +25 <-> 13 27 <-> 7 29 <-> 9 diff --git a/testData/results/TestClassTypes.dec b/testData/results/TestClassTypes.dec index f2a3fdb..4e633b9 100644 --- a/testData/results/TestClassTypes.dec +++ b/testData/results/TestClassTypes.dec @@ -17,7 +17,7 @@ public class TestClassTypes { System.out.println();// 36 } - } + }// 38 public boolean testBit(int var1) { return (var1 & 1) == 1;// 41 @@ -36,7 +36,7 @@ public class TestClassTypes { System.out.println("3");// 55 } - } + }// 57 public void testAssignmentType(List var1) { Object var2 = var1;// 61 @@ -45,7 +45,7 @@ public class TestClassTypes { } System.out.println(((List)var2).size());// 67 - } + }// 68 } class 'pkg/TestClassTypes' { @@ -72,6 +72,7 @@ class 'pkg/TestClassTypes' { 23 15 26 16 29 16 + 2c 19 } method 'testBit (I)Z' { @@ -92,6 +93,7 @@ class 'pkg/TestClassTypes' { 42 35 45 35 47 35 + 4a 38 } method 'testAssignmentType (Ljava/util/List;)V' { @@ -103,6 +105,7 @@ class 'pkg/TestClassTypes' { 18 46 1c 46 21 46 + 24 47 } } @@ -115,12 +118,18 @@ Lines mapping: 32 <-> 13 35 <-> 16 36 <-> 17 +38 <-> 20 41 <-> 23 46 <-> 27 48 <-> 29 51 <-> 32 55 <-> 36 +57 <-> 39 61 <-> 42 63 <-> 43 64 <-> 44 67 <-> 47 +68 <-> 48 +Not mapped: +49 +52 diff --git a/testData/results/TestClassVar.dec b/testData/results/TestClassVar.dec index cedd9c0..cf28a10 100644 --- a/testData/results/TestClassVar.dec +++ b/testData/results/TestClassVar.dec @@ -16,7 +16,7 @@ public class TestClassVar { } } - } + }// 37 public Long testFieldSSAU1() { return new Long((long)(this.field_int++));// 40 @@ -36,7 +36,7 @@ public class TestClassVar { } } - } + }// 58 } class 'pkg/TestClassVar' { @@ -50,6 +50,7 @@ class 'pkg/TestClassVar' { 20 11 26 12 29 12 + 34 18 } method 'testFieldSSAU1 ()Ljava/lang/Long;' { @@ -69,6 +70,7 @@ class 'pkg/TestClassVar' { 1c 33 1f 34 22 34 + 28 38 } } @@ -77,6 +79,7 @@ Lines mapping: 29 <-> 10 32 <-> 12 33 <-> 13 +37 <-> 19 40 <-> 22 45 <-> 26 47 <-> 28 @@ -84,3 +87,6 @@ Lines mapping: 51 <-> 30 54 <-> 34 55 <-> 35 +58 <-> 39 +Not mapped: +57 diff --git a/testData/results/TestCodeConstructs.dec b/testData/results/TestCodeConstructs.dec index eeb9c19..fefd421 100644 --- a/testData/results/TestCodeConstructs.dec +++ b/testData/results/TestCodeConstructs.dec @@ -5,7 +5,7 @@ class TestCodeConstructs { void expressions() { (new String()).hashCode();// 20 - } + }// 21 Integer fieldIncrement() { return new Integer(this.count++);// 25 @@ -15,6 +15,7 @@ class TestCodeConstructs { class 'pkg/TestCodeConstructs' { method 'expressions ()V' { 7 6 + b 7 } method 'fieldIncrement ()Ljava/lang/Integer;' { @@ -26,4 +27,5 @@ class 'pkg/TestCodeConstructs' { Lines mapping: 20 <-> 7 +21 <-> 8 25 <-> 11 diff --git a/testData/results/TestConstants.dec b/testData/results/TestConstants.dec index 47f4c1d..28df2c2 100644 --- a/testData/results/TestConstants.dec +++ b/testData/results/TestConstants.dec @@ -29,46 +29,99 @@ public class TestConstants { @TestConstants.A(byte.class) void m1() { - } + }// 54 @TestConstants.A(char.class) void m2() { - } + }// 55 @TestConstants.A(double.class) void m3() { - } + }// 56 @TestConstants.A(float.class) void m4() { - } + }// 57 @TestConstants.A(int.class) void m5() { - } + }// 58 @TestConstants.A(long.class) void m6() { - } + }// 59 @TestConstants.A(short.class) void m7() { - } + }// 60 @TestConstants.A(boolean.class) void m8() { - } + }// 61 @TestConstants.A(void.class) void m9() { - } + }// 62 @TestConstants.A(Date.class) void m10() { - } + }// 63 @interface A { Class value(); } } +class 'pkg/TestConstants' { + method 'm1 ()V' { + 0 31 + } + + method 'm2 ()V' { + 0 35 + } + + method 'm3 ()V' { + 0 39 + } + + method 'm4 ()V' { + 0 43 + } + + method 'm5 ()V' { + 0 47 + } + + method 'm6 ()V' { + 0 51 + } + + method 'm7 ()V' { + 0 55 + } + + method 'm8 ()V' { + 0 59 + } + + method 'm9 ()V' { + 0 63 + } + + method 'm10 ()V' { + 0 67 + } +} + +Lines mapping: +54 <-> 32 +55 <-> 36 +56 <-> 40 +57 <-> 44 +58 <-> 48 +59 <-> 52 +60 <-> 56 +61 <-> 60 +62 <-> 64 +63 <-> 68 diff --git a/testData/results/TestDeprecations.dec b/testData/results/TestDeprecations.dec index e423854..077bdd7 100644 --- a/testData/results/TestDeprecations.dec +++ b/testData/results/TestDeprecations.dec @@ -10,7 +10,7 @@ public abstract class TestDeprecations { /** @deprecated */ public void byComment() { boolean var1 = true;// 27 - } + }// 28 /** @deprecated */ public abstract void byCommentAbstract(); @@ -19,7 +19,7 @@ public abstract class TestDeprecations { @Deprecated public void byAnno() { boolean var1 = true;// 35 - } + }// 36 /** @deprecated */ @Deprecated @@ -32,7 +32,7 @@ public abstract class TestDeprecations { void foo() { boolean var1 = true;// 55 - } + }// 56 } /** @deprecated */ @@ -41,7 +41,7 @@ public abstract class TestDeprecations { void foo() { boolean var1 = true;// 46 - } + }// 47 } } @@ -49,11 +49,13 @@ class 'pkg/TestDeprecations' { method 'byComment ()V' { 0 11 1 11 + 2 12 } method 'byAnno ()V' { 0 20 1 20 + 2 21 } } @@ -61,6 +63,7 @@ class 'pkg/TestDeprecations$ByAnno' { method 'foo ()V' { 0 33 1 33 + 2 34 } } @@ -68,11 +71,16 @@ class 'pkg/TestDeprecations$ByComment' { method 'foo ()V' { 0 42 1 42 + 2 43 } } Lines mapping: 27 <-> 12 +28 <-> 13 35 <-> 21 +36 <-> 22 46 <-> 43 +47 <-> 44 55 <-> 34 +56 <-> 35 diff --git a/testData/results/TestEnum.dec b/testData/results/TestEnum.dec index e08f341..ff3d765 100644 --- a/testData/results/TestEnum.dec +++ b/testData/results/TestEnum.dec @@ -4,39 +4,60 @@ public enum TestEnum { E1, E2 { public void m() { - } + }// 22 }, E3("-"), E4("+") { public void m() { - } + }// 27 }; private String s; public void m() { - } + }// 30 private TestEnum() { - this("?");// 34 - } + this("?"); + }// 34 private TestEnum(@Deprecated String var3) { - this.s = var3;// 35 + this.s = var3; + }// 35 +} + +class 'pkg/TestEnum$1' { + method 'm ()V' { + 0 6 + } +} + +class 'pkg/TestEnum$2' { + method 'm ()V' { + 0 11 } } class 'pkg/TestEnum' { + method 'm ()V' { + 0 17 + } + method ' (Ljava/lang/String;I)V' { 3 20 5 20 + 8 21 } method ' (Ljava/lang/String;ILjava/lang/String;)V' { 8 24 + b 25 } } Lines mapping: -34 <-> 21 -35 <-> 25 +22 <-> 7 +27 <-> 12 +30 <-> 18 +34 <-> 22 +35 <-> 26 diff --git a/testData/results/TestInnerClassConstructor.dec b/testData/results/TestInnerClassConstructor.dec index 3db6203..235d50f 100644 --- a/testData/results/TestInnerClassConstructor.dec +++ b/testData/results/TestInnerClassConstructor.dec @@ -3,22 +3,23 @@ package pkg; class TestInnerClassConstructor { void m() { new TestInnerClassConstructor.Inner("text");// 5 - } + }// 6 void n(String var1) { System.out.println("n(): " + var1);// 9 - } + }// 10 final class Inner { private Inner(String var2) { TestInnerClassConstructor.this.n(var2);// 14 - } + }// 15 } } class 'pkg/TestInnerClassConstructor' { method 'm ()V' { 5 4 + c 5 } method 'n (Ljava/lang/String;)V' { @@ -26,16 +27,23 @@ class 'pkg/TestInnerClassConstructor' { a 8 13 8 16 8 + 19 9 } } class 'pkg/TestInnerClassConstructor$Inner' { method ' (Lpkg/TestInnerClassConstructor;Ljava/lang/String;)V' { b 13 + e 14 } } Lines mapping: 5 <-> 5 +6 <-> 6 9 <-> 9 +10 <-> 10 14 <-> 14 +15 <-> 15 +Not mapped: +13 diff --git a/testData/results/TestInnerLocal.dec b/testData/results/TestInnerLocal.dec index f9129fe..6ca3a7e 100644 --- a/testData/results/TestInnerLocal.dec +++ b/testData/results/TestInnerLocal.dec @@ -5,13 +5,13 @@ public class TestInnerLocal { public Inner(String var1) { this.x = var1;// 22 - } + }// 23 } new Inner("test");// 25 new TestInnerLocal.Inner1Static("test");// 26 new TestInnerLocal.Inner1Static.Inner2Static("test");// 27 - } + }// 28 public void testMethod() { class Inner { @@ -19,28 +19,28 @@ public class TestInnerLocal { public Inner(String var2) { this.x = var2;// 34 - } + }// 35 } new Inner("test");// 37 new TestInnerLocal.Inner1Static("test");// 38 new TestInnerLocal.Inner1("test");// 39 new TestInnerLocal.Inner1Static.Inner2Static("test");// 40 - } + }// 41 static class Inner1Static { final String x; public Inner1Static(String var1) { this.x = var1;// 53 - } + }// 54 public static class Inner2Static { final String x; public Inner2Static(String var1) { this.x = var1;// 59 - } + }// 60 } } @@ -49,13 +49,14 @@ public class TestInnerLocal { public Inner1(String var2) { this.x = var2;// 46 - } + }// 47 } } class 'TestInnerLocal$1Inner' { method ' (Ljava/lang/String;)V' { 6 6 + 9 7 } } @@ -64,6 +65,7 @@ class 'TestInnerLocal' { 4 10 e 11 18 12 + 1e 13 } method 'testMethod ()V' { @@ -71,43 +73,61 @@ class 'TestInnerLocal' { f 25 1a 26 24 27 + 2a 28 } } class 'TestInnerLocal$2Inner' { method ' (LTestInnerLocal;Ljava/lang/String;)V' { b 20 + e 21 } } class 'TestInnerLocal$Inner1Static' { method ' (Ljava/lang/String;)V' { 6 34 + 9 35 } } class 'TestInnerLocal$Inner1Static$Inner2Static' { method ' (Ljava/lang/String;)V' { 6 41 + 9 42 } } class 'TestInnerLocal$Inner1' { method ' (LTestInnerLocal;Ljava/lang/String;)V' { b 50 + e 51 } } Lines mapping: 22 <-> 7 +23 <-> 8 25 <-> 11 26 <-> 12 27 <-> 13 +28 <-> 14 34 <-> 21 +35 <-> 22 37 <-> 25 38 <-> 26 39 <-> 27 40 <-> 28 +41 <-> 29 46 <-> 51 +47 <-> 52 53 <-> 35 +54 <-> 36 59 <-> 42 +60 <-> 43 +Not mapped: +21 +33 +45 +52 +58 diff --git a/testData/results/TestInnerLocalPkg.dec b/testData/results/TestInnerLocalPkg.dec index 5590d8a..7cafa41 100644 --- a/testData/results/TestInnerLocalPkg.dec +++ b/testData/results/TestInnerLocalPkg.dec @@ -7,13 +7,13 @@ public class TestInnerLocalPkg { public Inner(String var1) { this.x = var1;// 24 - } + }// 25 } new Inner("test");// 27 new TestInnerLocalPkg.Inner1Static("test");// 28 new TestInnerLocalPkg.Inner1Static.Inner2Static("test");// 29 - } + }// 30 public void testMethod() { class Inner { @@ -21,28 +21,28 @@ public class TestInnerLocalPkg { public Inner(String var2) { this.x = var2;// 36 - } + }// 37 } new Inner("test");// 39 new TestInnerLocalPkg.Inner1Static("test");// 40 new TestInnerLocalPkg.Inner1("test");// 41 new TestInnerLocalPkg.Inner1Static.Inner2Static("test");// 42 - } + }// 43 static class Inner1Static { final String x; public Inner1Static(String var1) { this.x = var1;// 55 - } + }// 56 public static class Inner2Static { final String x; public Inner2Static(String var1) { this.x = var1;// 61 - } + }// 62 } } @@ -51,13 +51,14 @@ public class TestInnerLocalPkg { public Inner1(String var2) { this.x = var2;// 48 - } + }// 49 } } class 'pkg/TestInnerLocalPkg$1Inner' { method ' (Ljava/lang/String;)V' { 6 8 + 9 9 } } @@ -66,6 +67,7 @@ class 'pkg/TestInnerLocalPkg' { 4 12 e 13 18 14 + 1e 15 } method 'testMethod ()V' { @@ -73,43 +75,61 @@ class 'pkg/TestInnerLocalPkg' { f 27 1a 28 24 29 + 2a 30 } } class 'pkg/TestInnerLocalPkg$2Inner' { method ' (Lpkg/TestInnerLocalPkg;Ljava/lang/String;)V' { b 22 + e 23 } } class 'pkg/TestInnerLocalPkg$Inner1Static' { method ' (Ljava/lang/String;)V' { 6 36 + 9 37 } } class 'pkg/TestInnerLocalPkg$Inner1Static$Inner2Static' { method ' (Ljava/lang/String;)V' { 6 43 + 9 44 } } class 'pkg/TestInnerLocalPkg$Inner1' { method ' (Lpkg/TestInnerLocalPkg;Ljava/lang/String;)V' { b 52 + e 53 } } Lines mapping: 24 <-> 9 +25 <-> 10 27 <-> 13 28 <-> 14 29 <-> 15 +30 <-> 16 36 <-> 23 +37 <-> 24 39 <-> 27 40 <-> 28 41 <-> 29 42 <-> 30 +43 <-> 31 48 <-> 53 +49 <-> 54 55 <-> 37 +56 <-> 38 61 <-> 44 +62 <-> 45 +Not mapped: +23 +35 +47 +54 +60 diff --git a/testData/results/TestInnerSignature.dec b/testData/results/TestInnerSignature.dec index e40a832..3087a40 100644 --- a/testData/results/TestInnerSignature.dec +++ b/testData/results/TestInnerSignature.dec @@ -7,7 +7,7 @@ public class TestInnerSignature { this.a = var1;// 23 this.b = var2;// 24 this.c = var3;// 25 - } + }// 26 public static class InnerStatic { A a; @@ -18,7 +18,7 @@ public class TestInnerSignature { this.a = var1;// 46 this.b = var2;// 47 this.c = var3;// 48 - } + }// 49 } public class Inner { @@ -30,7 +30,7 @@ public class TestInnerSignature { this.a = var2;// 34 this.b = var3;// 35 this.c = var4;// 36 - } + }// 37 } } @@ -39,6 +39,7 @@ class 'TestInnerSignature' { 6 6 b 7 10 8 + 13 9 } } @@ -47,6 +48,7 @@ class 'TestInnerSignature$InnerStatic' { 6 17 b 18 10 19 + 13 20 } } @@ -55,6 +57,7 @@ class 'TestInnerSignature$Inner' { b 29 10 30 16 31 + 19 32 } } @@ -62,9 +65,16 @@ Lines mapping: 23 <-> 7 24 <-> 8 25 <-> 9 +26 <-> 10 34 <-> 30 35 <-> 31 36 <-> 32 +37 <-> 33 46 <-> 18 47 <-> 19 48 <-> 20 +49 <-> 21 +Not mapped: +22 +33 +45 diff --git a/testData/results/TestLocalClass.dec b/testData/results/TestLocalClass.dec index 8e51167..27c2958 100644 --- a/testData/results/TestLocalClass.dec +++ b/testData/results/TestLocalClass.dec @@ -7,20 +7,20 @@ public abstract class TestLocalClass { void foo() { boolean var1 = true;// 11 boolean var2 = true;// 12 - } + }// 13 } Local var2 = new Local();// 15 var2.foo();// 16 - } + }// 17 void boo() { boolean var1 = true;// 20 - } + }// 21 void zoo() { boolean var1 = true;// 24 - } + }// 25 } class 'pkg/TestLocalClass$1Local' { @@ -29,6 +29,7 @@ class 'pkg/TestLocalClass$1Local' { 1 7 2 8 3 8 + 4 9 } } @@ -38,16 +39,19 @@ class 'pkg/TestLocalClass' { 1 4 a 12 c 13 + f 14 } method 'boo ()V' { 0 17 1 17 + 2 18 } method 'zoo ()V' { 0 21 1 21 + 2 22 } } @@ -55,7 +59,11 @@ Lines mapping: 8 <-> 5 11 <-> 8 12 <-> 9 +13 <-> 10 15 <-> 13 16 <-> 14 +17 <-> 15 20 <-> 18 +21 <-> 19 24 <-> 22 +25 <-> 23 diff --git a/testData/results/TestMethodParameters.dec b/testData/results/TestMethodParameters.dec index a458192..21f0f12 100644 --- a/testData/results/TestMethodParameters.dec +++ b/testData/results/TestMethodParameters.dec @@ -2,42 +2,106 @@ package pkg; public class TestMethodParameters { TestMethodParameters(@Deprecated int var1) { - } + }// 19 void m1(@Deprecated int var1) { - } + }// 20 static void m2(@Deprecated int var0) { - } + }// 21 void local() { class Local { Local(@Deprecated int var2) { - } + }// 36 void m(@Deprecated int var1) { - } + }// 37 } - } + }// 39 static class C2 { C2(@Deprecated int var1) { - } + }// 29 void m1(@Deprecated int var1) { - } + }// 30 static void m2(@Deprecated int var0) { - } + }// 31 } class C1 { C1(@Deprecated int var2) { - } + }// 24 void m(@Deprecated int var1) { - } + }// 25 + } +} + +class 'pkg/TestMethodParameters' { + method ' (I)V' { + 4 4 + } + + method 'm1 (I)V' { + 0 7 + } + + method 'm2 (I)V' { + 0 10 + } + + method 'local ()V' { + 0 21 + } +} + +class 'pkg/TestMethodParameters$1Local' { + method ' (Lpkg/TestMethodParameters;I)V' { + 9 15 + } + + method 'm (I)V' { + 0 18 + } +} + +class 'pkg/TestMethodParameters$C2' { + method ' (I)V' { + 4 25 + } + + method 'm1 (I)V' { + 0 28 + } + + method 'm2 (I)V' { + 0 31 + } +} + +class 'pkg/TestMethodParameters$C1' { + method ' (Lpkg/TestMethodParameters;I)V' { + 9 36 + } + + method 'm (I)V' { + 0 39 } } +Lines mapping: +19 <-> 5 +20 <-> 8 +21 <-> 11 +24 <-> 37 +25 <-> 40 +29 <-> 26 +30 <-> 29 +31 <-> 32 +36 <-> 16 +37 <-> 19 +39 <-> 22 diff --git a/testData/results/TestSynchronizedMapping.dec b/testData/results/TestSynchronizedMapping.dec index 6ba9f33..82b553b 100644 --- a/testData/results/TestSynchronizedMapping.dec +++ b/testData/results/TestSynchronizedMapping.dec @@ -9,7 +9,7 @@ public class TestSynchronizedMapping { public void test2(String var1) { System.out.println(var1);// 14 - } + }// 15 } class 'pkg/TestSynchronizedMapping' { @@ -22,6 +22,7 @@ class 'pkg/TestSynchronizedMapping' { method 'test2 (Ljava/lang/String;)V' { 0 10 4 10 + 7 11 } } @@ -29,3 +30,6 @@ Lines mapping: 8 <-> 5 9 <-> 6 14 <-> 11 +15 <-> 12 +Not mapped: +10 diff --git a/testData/results/TestThrowException.dec b/testData/results/TestThrowException.dec index 7bc460e..eae0e70 100644 --- a/testData/results/TestThrowException.dec +++ b/testData/results/TestThrowException.dec @@ -10,16 +10,17 @@ public class TestThrowException { this.r = new Runnable() {// 12 public void run() { boolean var1 = true;// 15 - } + }// 16 }; } - } + }// 18 } class 'pkg/TestThrowException$1' { method 'run ()V' { 0 11 1 11 + 2 12 } } @@ -29,6 +30,7 @@ class 'pkg/TestThrowException' { c 7 11 7 1b 9 + 1e 15 } } @@ -37,3 +39,7 @@ Lines mapping: 10 <-> 8 12 <-> 10 15 <-> 12 +16 <-> 13 +18 <-> 16 +Not mapped: +8 diff --git a/testData/results/TestTryCatchFinally.dec b/testData/results/TestTryCatchFinally.dec index 2dc71a5..2e917ff 100644 --- a/testData/results/TestTryCatchFinally.dec +++ b/testData/results/TestTryCatchFinally.dec @@ -14,7 +14,7 @@ public class TestTryCatchFinally { System.out.println("finally");// 34 } - } + }// 36 int foo(int var1) throws Exception { if(var1 < 1) {// 39 @@ -51,6 +51,7 @@ class 'pkg/TestTryCatchFinally' { 2b 13 2d 13 30 13 + 38 16 } method 'foo (I)I' { @@ -80,6 +81,7 @@ Lines mapping: 24 <-> 6 27 <-> 9 34 <-> 14 +36 <-> 17 39 <-> 20 40 <-> 21 41 <-> 22 @@ -88,3 +90,11 @@ Lines mapping: 51 <-> 31 53 <-> 34 55 <-> 36 +Not mapped: +25 +28 +32 +35 +52 +56 +57