From a478d8b5a50148d74512382fe464e67d8c5f39f2 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:54:28 -0700 Subject: [PATCH 01/25] Fix formatter emitting blank lines for long method invocations with no arguments (#362) * Fix formatter emitting blank lines for long method invocations with no arguments fixes #359 * Simplify test --- .../decompiler/exps/InvocationExprent.java | 19 ++++++++++++------- .../java/decompiler/SingleClassesTest.java | 1 + testData/results/pkg/TestBlankLinesSpaces.dec | 19 +++++++++++++++++++ .../src/java8/pkg/TestBlankLinesSpaces.java | 9 +++++++++ 4 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 testData/results/pkg/TestBlankLinesSpaces.dec create mode 100644 testData/src/java8/pkg/TestBlankLinesSpaces.java diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java index 9edebaae76..c80f066721 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java @@ -949,8 +949,6 @@ private static void appendBootstrapArgument(TextBuffer buf, PooledConstant arg) } public TextBuffer appendParamList(int indent) { - TextBuffer buf = new TextBuffer(); - buf.pushNewlineGroup(indent, 1); List mask = null; boolean isEnum = false; if (functype == Type.INIT) { @@ -1105,9 +1103,14 @@ else if (inv.isUnboxingCall() && !inv.shouldForceUnboxing()) { } + TextBuffer buf = new TextBuffer(); + boolean firstParameter = true; - buf.appendPossibleNewline(); - buf.pushNewlineGroup(indent, 0); + if (!lstParameters.isEmpty()) { + buf.pushNewlineGroup(indent, 1); + buf.appendPossibleNewline(); + buf.pushNewlineGroup(indent, 0); + } for (int i = start; i < lstParameters.size(); i++) { if (mask == null || mask.get(i) == null) { @@ -1161,9 +1164,11 @@ else if (desc != null && desc.getSignature() != null && genericArgs.size() != 0) } } - buf.popNewlineGroup(); - buf.appendPossibleNewline("", true); - buf.popNewlineGroup(); + if (!lstParameters.isEmpty()) { + buf.popNewlineGroup(); + buf.appendPossibleNewline("", true); + buf.popNewlineGroup(); + } return buf; } diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index fa855e3847..d01beec1bd 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -325,6 +325,7 @@ private void registerDefault() { register(JAVA_8, "TestLongMethodDeclaration"); register(JAVA_8, "TestLongMethodInvocation"); register(JAVA_8, "TestBinaryOperationWrapping"); + register(JAVA_8, "TestBlankLinesSpaces"); register(JAVA_8, "TestLoopBreak"); register(JAVA_8, "TestLoopBreak2"); register(JAVA_8, "TestSimpleWhile"); diff --git a/testData/results/pkg/TestBlankLinesSpaces.dec b/testData/results/pkg/TestBlankLinesSpaces.dec new file mode 100644 index 0000000000..de70870546 --- /dev/null +++ b/testData/results/pkg/TestBlankLinesSpaces.dec @@ -0,0 +1,19 @@ +package pkg; + +public class TestBlankLinesSpaces { + private static final String STRING = longMethodName00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(); + + private static String longMethodName00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000() { + return null;// 7 + } +} + +class 'pkg/TestBlankLinesSpaces' { + method 'longMethodName00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ()Ljava/lang/String;' { + 0 6 + 1 6 + } +} + +Lines mapping: +7 <-> 7 diff --git a/testData/src/java8/pkg/TestBlankLinesSpaces.java b/testData/src/java8/pkg/TestBlankLinesSpaces.java new file mode 100644 index 0000000000..0ff0f98090 --- /dev/null +++ b/testData/src/java8/pkg/TestBlankLinesSpaces.java @@ -0,0 +1,9 @@ +package pkg; + +public class TestBlankLinesSpaces { + private static final String STRING = longMethodName00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(); + + private static String longMethodName00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000() { + return null; + } +} From 4379782fc4c5fb1e962a0802779a88433f38dd27 Mon Sep 17 00:00:00 2001 From: coehlrich Date: Tue, 9 Apr 2024 12:50:06 +1200 Subject: [PATCH 02/25] Fix variable namer parent not being set for local classes (#361) * Fix local class methods not getting the parent context * Add test --- .../VariableRenamingTest.java | 1 + .../results/pkg/TestJADLocalClasses.dec | 38 +++++++++++++++++++ .../src/java8/pkg/TestJADLocalClasses.java | 12 ++++++ .../decompiler/vars/VarDefinitionHelper.java | 30 ++++++++------- 4 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 plugins/variable-renaming/testData/results/pkg/TestJADLocalClasses.dec create mode 100644 plugins/variable-renaming/testData/src/java8/pkg/TestJADLocalClasses.java diff --git a/plugins/variable-renaming/src/test/java/org/vineflower/variablerenaming/VariableRenamingTest.java b/plugins/variable-renaming/src/test/java/org/vineflower/variablerenaming/VariableRenamingTest.java index ab969a6907..9e8118912d 100644 --- a/plugins/variable-renaming/src/test/java/org/vineflower/variablerenaming/VariableRenamingTest.java +++ b/plugins/variable-renaming/src/test/java/org/vineflower/variablerenaming/VariableRenamingTest.java @@ -13,6 +13,7 @@ protected void registerAll() { register(JAVA_8, "TestJADNaming"); // TODO: loop part fails registerRaw(CUSTOM, "TestJadLvtCollision"); // created by placing a class in java8 sources and remapping its param using tinyremapper + register(JAVA_8, "TestJADLocalClasses"); }, IFernflowerPreferences.BYTECODE_SOURCE_MAPPING, "1", IFernflowerPreferences.DUMP_ORIGINAL_LINES, "1", IFernflowerPreferences.DUMP_EXCEPTION_ON_ERROR, "0", diff --git a/plugins/variable-renaming/testData/results/pkg/TestJADLocalClasses.dec b/plugins/variable-renaming/testData/results/pkg/TestJADLocalClasses.dec new file mode 100644 index 0000000000..117c32ede0 --- /dev/null +++ b/plugins/variable-renaming/testData/results/pkg/TestJADLocalClasses.dec @@ -0,0 +1,38 @@ +package pkg; + +public class TestJADLocalClasses { + public void function() { + int i = 0;// 5 + + class Test { + Test() { + int j = 0;// 8 + }// 9 + } + + }// 11 +} + +class 'pkg/TestJADLocalClasses' { + method 'function ()V' { + 0 4 + 1 4 + 2 12 + } +} + +class 'pkg/TestJADLocalClasses$1Test' { + method ' (Lpkg/TestJADLocalClasses;)V' { + 9 8 + a 8 + b 9 + } +} + +Lines mapping: +5 <-> 5 +8 <-> 9 +9 <-> 10 +11 <-> 13 +Not mapped: +7 diff --git a/plugins/variable-renaming/testData/src/java8/pkg/TestJADLocalClasses.java b/plugins/variable-renaming/testData/src/java8/pkg/TestJADLocalClasses.java new file mode 100644 index 0000000000..baa49e221b --- /dev/null +++ b/plugins/variable-renaming/testData/src/java8/pkg/TestJADLocalClasses.java @@ -0,0 +1,12 @@ +package pkg; + +public class TestJADLocalClasses { + public void function() { + int a = 0; + class Test { + Test() { + int b = 0; + } + } + } +} diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java index e751bf0af5..97fc30c16f 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java @@ -25,6 +25,7 @@ import org.jetbrains.java.decompiler.struct.gen.VarType; import org.jetbrains.java.decompiler.struct.gen.generics.GenericType; import org.jetbrains.java.decompiler.util.ArrayHelper; +import org.jetbrains.java.decompiler.util.InterpreterUtil; import org.jetbrains.java.decompiler.util.Pair; import org.jetbrains.java.decompiler.util.StatementIterator; @@ -1028,18 +1029,11 @@ private void propogateLVTs(Statement stat) { Map renames = this.mt.getVariableNamer().rename(typeNames); + Set methods = new HashSet<>(); + // Stuff the parent context into enclosed child methods StatementIterator.iterate(root, (exprent) -> { - List methods = new ArrayList<>(); - if (exprent instanceof VarExprent) { - VarExprent var = (VarExprent)exprent; - if (var.isClassDef()) { - ClassNode child = DecompilerContext.getClassProcessor().getMapRootClasses().get(var.getVarType().value); - if (child != null) - methods.addAll(child.classStruct.getMethods()); - } - } - else if (exprent instanceof NewExprent) { + if (exprent instanceof NewExprent) { NewExprent _new = (NewExprent)exprent; if (_new.isAnonymous()) { //TODO: Check for Lambda here? ClassNode child = DecompilerContext.getClassProcessor().getMapRootClasses().get(_new.getNewType().value); @@ -1056,13 +1050,21 @@ else if (exprent instanceof NewExprent) { } } } - - for (StructMethod meth : methods) { - meth.getVariableNamer().addParentContext(VarDefinitionHelper.this.mt.getVariableNamer()); - } return 0; }); + // Local classes aren't added into the method body yet + String thisKey = InterpreterUtil.makeUniqueKey(mt.getName(), mt.getDescriptor()); + for (ClassNode nested : DecompilerContext.getClassProcessor().getMapRootClasses().get(mt.getClassQualifiedName()).nested) { + if (nested.type == ClassNode.Type.LOCAL && thisKey.equals(nested.enclosingMethod)) { + methods.addAll(nested.classStruct.getMethods()); + } + } + + for (StructMethod meth : methods) { + meth.getVariableNamer().addParentContext(VarDefinitionHelper.this.mt.getVariableNamer()); + } + Map lvts = new HashMap<>(); for (Entry e : types.entrySet()) { From 31554b448a7163b481f5709e0678af6ae525ba9f Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:47:29 -0700 Subject: [PATCH 03/25] Don't append indent to newlines immediately followed by another newline (#363) fixes #359 (for real this time?) --- .../java/decompiler/util/TextBuffer.java | 9 ++- testData/results/pkg/TestBlankLinesSpaces.dec | 79 ++++++++++++++++++- .../src/java8/pkg/TestBlankLinesSpaces.java | 16 ++++ 3 files changed, 97 insertions(+), 7 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/util/TextBuffer.java b/src/org/jetbrains/java/decompiler/util/TextBuffer.java index 7fe20cd28a..5c5e435427 100644 --- a/src/org/jetbrains/java/decompiler/util/TextBuffer.java +++ b/src/org/jetbrains/java/decompiler/util/TextBuffer.java @@ -433,10 +433,13 @@ private void reformatGroup(NewlineGroup group, List offsetMapping, int // add extra indent after newlines if (pos + offset + myLineSeparator.length() < myStringBuilder.length() && myStringBuilder.substring(pos + offset, pos + offset + myLineSeparator.length()).equals(myLineSeparator)) { - for (int i = 0; i < extraIndent; i++) { - myStringBuilder.insert(pos + offset + myLineSeparator.length(), myIndent); + // not for blank lines + if (!myStringBuilder.substring(pos + offset + myLineSeparator.length(), pos + offset + myLineSeparator.length() * 2).equals(myLineSeparator)) { + for (int i = 0; i < extraIndent; i++) { + myStringBuilder.insert(pos + offset + myLineSeparator.length(), myIndent); + } + offset += myIndent.length() * extraIndent; } - offset += myIndent.length() * extraIndent; } // do multiple passes in an inner loop, as there could be arbitrarily many with the same offset diff --git a/testData/results/pkg/TestBlankLinesSpaces.dec b/testData/results/pkg/TestBlankLinesSpaces.dec index de70870546..c716ca4bc9 100644 --- a/testData/results/pkg/TestBlankLinesSpaces.dec +++ b/testData/results/pkg/TestBlankLinesSpaces.dec @@ -1,19 +1,90 @@ package pkg; +import java.util.Random; + public class TestBlankLinesSpaces { private static final String STRING = longMethodName00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(); private static String longMethodName00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000() { - return null;// 7 + return null;// 9 } + + static void takeLambda00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000( + Runnable r + ) { + }// 24 + + static { + takeLambda00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(// 13 + () -> { + for (int i = 0; i < 10; i++) {// 14 + System.out.println(i);// 15 + } + + if (new Random().nextBoolean()) {// 17 + System.out.println(true);// 18 + } + }// 20 + ); + }// 21 } class 'pkg/TestBlankLinesSpaces' { method 'longMethodName00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ()Ljava/lang/String;' { - 0 6 - 1 6 + 0 8 + 1 8 + } + + method 'takeLambda00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 (Ljava/lang/Runnable;)V' { + 0 14 + } + + method ' ()V' { + b 17 + c 17 + d 17 + e 28 + } + + method 'lambda$static$0 ()V' { + 0 19 + 1 19 + 2 19 + 3 19 + 4 19 + 5 19 + 8 20 + 9 20 + a 20 + b 20 + c 20 + d 20 + e 20 + f 19 + 10 19 + 11 19 + 1c 23 + 1d 23 + 1e 23 + 1f 23 + 22 24 + 23 24 + 24 24 + 25 24 + 26 24 + 29 26 } } Lines mapping: -7 <-> 7 +9 <-> 9 +13 <-> 18 +14 <-> 20 +15 <-> 21 +17 <-> 24 +18 <-> 25 +20 <-> 27 +21 <-> 29 +24 <-> 15 +Not mapped: +6 diff --git a/testData/src/java8/pkg/TestBlankLinesSpaces.java b/testData/src/java8/pkg/TestBlankLinesSpaces.java index 0ff0f98090..efba634512 100644 --- a/testData/src/java8/pkg/TestBlankLinesSpaces.java +++ b/testData/src/java8/pkg/TestBlankLinesSpaces.java @@ -1,9 +1,25 @@ package pkg; +import java.util.Random; + public class TestBlankLinesSpaces { private static final String STRING = longMethodName00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(); private static String longMethodName00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000() { return null; } + + static { + takeLambda00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(() -> { + for (int i = 0; i < 10; i++) { + System.out.println(i); + } + if (new Random().nextBoolean()) { + System.out.println(true); + } + }); + } + + static void takeLambda00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(Runnable r) { + } } From bd3956564b9544a5dca195febf626cc6a7e48eb2 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:59:48 -0700 Subject: [PATCH 04/25] Add missing range check to account for EOF (#364) --- src/org/jetbrains/java/decompiler/util/TextBuffer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/jetbrains/java/decompiler/util/TextBuffer.java b/src/org/jetbrains/java/decompiler/util/TextBuffer.java index 5c5e435427..7861d753a4 100644 --- a/src/org/jetbrains/java/decompiler/util/TextBuffer.java +++ b/src/org/jetbrains/java/decompiler/util/TextBuffer.java @@ -434,7 +434,7 @@ private void reformatGroup(NewlineGroup group, List offsetMapping, int // add extra indent after newlines if (pos + offset + myLineSeparator.length() < myStringBuilder.length() && myStringBuilder.substring(pos + offset, pos + offset + myLineSeparator.length()).equals(myLineSeparator)) { // not for blank lines - if (!myStringBuilder.substring(pos + offset + myLineSeparator.length(), pos + offset + myLineSeparator.length() * 2).equals(myLineSeparator)) { + if (!(pos + offset + myLineSeparator.length() * 2 < myStringBuilder.length()) || !myStringBuilder.substring(pos + offset + myLineSeparator.length(), pos + offset + myLineSeparator.length() * 2).equals(myLineSeparator)) { for (int i = 0; i < extraIndent; i++) { myStringBuilder.insert(pos + offset + myLineSeparator.length(), myIndent); } From 8c41ea642c3a780ee5d0959790da1cefa115c4d7 Mon Sep 17 00:00:00 2001 From: shartte Date: Wed, 10 Apr 2024 22:42:23 +0200 Subject: [PATCH 05/25] Only use parameter names from method parameter attributes, if they are non-null (#365) --- src/org/jetbrains/java/decompiler/main/ClassWriter.java | 2 +- testData/results/pkg/TestInnerClassesJ21.dec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index 22e9ca34eb..8fdcc90d16 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -1208,7 +1208,7 @@ else if (methodWrapper.varproc.getVarFinal(new VarVersionPair(index, 0)) == VarT String clashingName = methodWrapper.varproc.getClashingName(new VarVersionPair(index, 0)); if (clashingName != null) { parameterName = clashingName; - } else if (methodParameters != null && i < methodParameters.size()) { + } else if (methodParameters != null && i < methodParameters.size() && methodParameters.get(i).myName != null) { parameterName = methodParameters.get(i).myName; } else { parameterName = methodWrapper.varproc.getVarName(new VarVersionPair(index, 0)); diff --git a/testData/results/pkg/TestInnerClassesJ21.dec b/testData/results/pkg/TestInnerClassesJ21.dec index 98eebf7bde..8ffaffbfa9 100644 --- a/testData/results/pkg/TestInnerClassesJ21.dec +++ b/testData/results/pkg/TestInnerClassesJ21.dec @@ -10,7 +10,7 @@ public class TestInnerClassesJ21 { private final long z; private final String v; - public TestInner(int param2, long param3, String param5) { + public TestInner(int x, long z, String v) { this.x = x;// 11 this.z = z;// 12 this.v = v;// 13 From fdc9933f2ea604820441bffaeaadf9e2475b6995 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Wed, 10 Apr 2024 13:59:58 -0700 Subject: [PATCH 06/25] Don't tear down nested class wrappers after writing the root class (#366) They may be needed later when writing other classes. This fixes an issue where non-static inner class constructor invocations from foreign classes would inconsistently have the synthetic enclosing this instance removed from the parameter list, depending on the order they were processed in (and consequently having strange interactions with multithreaded writing) --- src/org/jetbrains/java/decompiler/main/ClassesProcessor.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java index 287ce0f5cd..a5c5c5818b 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java @@ -563,9 +563,8 @@ private static void destroyWrappers(ClassNode node) { node.classStruct.releaseResources(); node.classStruct.getMethods().forEach(m -> m.clearVariableNamer()); - for (ClassNode nd : node.nested) { - destroyWrappers(nd); - } + // Don't destroy inner node wrappers, they may still be needed to process constructor + // invocations etc. from other classes. } public Map getMapRootClasses() { From 140d738cc19296d535f07334a8059bac9217309f Mon Sep 17 00:00:00 2001 From: Jasmine Karthikeyan <25208576+jaskarth@users.noreply.github.com> Date: Thu, 11 Apr 2024 22:05:26 -0400 Subject: [PATCH 07/25] Fix J21 nested inner class synthetic params --- .../main/rels/NestedClassProcessor.java | 2 +- .../java/decompiler/SingleClassesTest.java | 1 + testData/results/pkg/TestInnerClasses2J21.dec | 43 +++++++++++++++++++ .../src/java21/pkg/TestInnerClasses2J21.java | 15 +++++++ 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 testData/results/pkg/TestInnerClasses2J21.dec create mode 100644 testData/src/java21/pkg/TestInnerClasses2J21.java diff --git a/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java b/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java index 739e78c61c..6670dc6921 100644 --- a/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java @@ -807,7 +807,7 @@ private static String getEnclosingVarField(StructClass cl, MethodWrapper method, StructMethodParametersAttribute attr = method.methodStruct.getAttribute(StructGeneralAttribute.ATTRIBUTE_METHOD_PARAMETERS); List entries = attr.getEntries(); - if (outerIdx < entries.size() && (entries.get(outerIdx).myAccessFlags & CodeConstants.ACC_MANDATED) == CodeConstants.ACC_MANDATED) { + if (outerIdx < entries.size() && (entries.get(outerIdx).myAccessFlags & (CodeConstants.ACC_MANDATED | CodeConstants.ACC_SYNTHETIC)) != 0) { String name = method.varproc.getVarName(var); VarType type = method.varproc.getVarType(var); diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index d01beec1bd..7eb4e40b9b 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -697,6 +697,7 @@ private void registerDefault() { register(JAVA_8, "TestDanglingBoxingCall"); register(JAVA_21, "TestSwitchOnEnumJ21", "ext/TestEnum2"); register(JAVA_21, "TestInnerClassesJ21"); + register(JAVA_21, "TestInnerClasses2J21"); register(JAVA_8, "TestInnerClassesJ8"); register(JAVA_8, "TestSwitchInTry"); } diff --git a/testData/results/pkg/TestInnerClasses2J21.dec b/testData/results/pkg/TestInnerClasses2J21.dec new file mode 100644 index 0000000000..4cbd42fef5 --- /dev/null +++ b/testData/results/pkg/TestInnerClasses2J21.dec @@ -0,0 +1,43 @@ +package pkg; + +public class TestInnerClasses2J21 { + private void test() { + new TestInnerClasses2J21.Inner().new Inner2(true, true);// 5 + }// 6 + + private class Inner { + private class Inner2 { + private Inner2(boolean nonFinal, final boolean finalB) { + TestInnerClasses2J21.this.test();// 11 + }// 12 + } + } +} + +class 'pkg/TestInnerClasses2J21' { + method 'test ()V' { + c 4 + d 4 + 12 5 + } +} + +class 'pkg/TestInnerClasses2J21$Inner$Inner2' { + method ' (Lpkg/TestInnerClasses2J21$Inner;ZZ)V' { + 5 10 + 6 10 + 7 10 + 8 10 + 9 10 + a 10 + b 11 + } +} + +Lines mapping: +5 <-> 5 +6 <-> 6 +11 <-> 11 +12 <-> 12 +Not mapped: +10 \ No newline at end of file diff --git a/testData/src/java21/pkg/TestInnerClasses2J21.java b/testData/src/java21/pkg/TestInnerClasses2J21.java new file mode 100644 index 0000000000..d856d67cd7 --- /dev/null +++ b/testData/src/java21/pkg/TestInnerClasses2J21.java @@ -0,0 +1,15 @@ +package pkg; + +public class TestInnerClasses2J21 { + private void test() { + new Inner().new Inner2(true, true); + } + + private class Inner { + private class Inner2 { + private Inner2(boolean nonFinal, final boolean finalB) { + TestInnerClasses2J21.this.test(); + } + } + } +} From 08608f981f1ed6a0a2f90cea2cf9b935395e685f Mon Sep 17 00:00:00 2001 From: Iota <47987888+IotaBread@users.noreply.github.com> Date: Thu, 11 Apr 2024 22:29:30 -0400 Subject: [PATCH 08/25] Don't write explicit casts where redundant (#341) * Don't write explicit casts where redundant * Fix numeric parameter disambiguation * Write casts when not doing so would change behavior * Fix failing test --------- Co-authored-by: Jasmine Karthikeyan <25208576+jaskarth@users.noreply.github.com> --- .../results/pkg/TestTailrecFunctions.dec | 8 +- .../decompiler/SecondaryFunctionsHelper.java | 61 +++ .../decompiler/exps/FunctionExprent.java | 12 +- .../decompiler/exps/InvocationExprent.java | 8 +- .../decompiler/struct/gen/TypeFamily.java | 22 +- .../java/decompiler/SingleClassesTest.java | 7 +- .../pkg/TestAssignmentSwitchExpression3.dec | 4 +- testData/results/pkg/TestClassVar.dec | 2 +- testData/results/pkg/TestDebugSymbols.dec | 2 +- .../results/pkg/TestDefiniteAssignment.dec | 438 +++++++++--------- .../results/pkg/TestDoublePopAfterJump.dec | 2 +- testData/results/pkg/TestLocalsNames.dec | 2 +- testData/results/pkg/TestMethodHandles.dec | 10 +- .../pkg/TestMixedCompoundAssignment.dec | 60 +-- testData/results/pkg/TestMultiCast.dec | 2 +- .../results/pkg/TestMultipleStaticBlocks.dec | 4 +- testData/results/pkg/TestNumberCasts.dec | 367 +++++++++++++++ .../results/pkg/TestNumberDisambiguation.dec | 384 +++++++++++++++ testData/results/pkg/TestObjectBitwise.dec | 20 +- testData/results/pkg/TestRecordPattern3.dec | 2 +- testData/results/pkg/TestStackCastParam.dec | 4 +- testData/results/pkg/TestWhileTernary10.dec | 8 +- testData/src/java8/pkg/TestNumberCasts.java | 71 +++ .../java8/pkg/TestNumberDisambiguation.java | 93 ++++ 24 files changed, 1295 insertions(+), 298 deletions(-) create mode 100644 testData/results/pkg/TestNumberCasts.dec create mode 100644 testData/results/pkg/TestNumberDisambiguation.dec create mode 100644 testData/src/java8/pkg/TestNumberCasts.java create mode 100644 testData/src/java8/pkg/TestNumberDisambiguation.java diff --git a/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec b/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec index 39e7eeff61..4335d2ebed 100644 --- a/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec +++ b/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec @@ -75,9 +75,9 @@ class TestTailrecFunctions { var var12: Long = acc; while (var10 != 0L) {// 44 - if (var10 % (long)2 == 0L) {// 45 + if (var10 % 2 == 0L) {// 45 var var21: Long = var8 * var8; - var var23: Long = var10 / (long)2; + var var23: Long = var10 / 2; var7 = var7; var8 = var21; var10 = var23; @@ -117,13 +117,13 @@ class TestTailrecFunctions { break; } - if (var8 % (long)2 != 0L) {// 51 + if (var8 % 2 != 0L) {// 51 var10000 = var6 * var5.fastPow(var6, var8 - 1L);// 52 break; } var var15: Long = var6 * var6; - var var17: Long = var8 / (long)2; + var var17: Long = var8 / 2; var5 = var5; var6 = var15; var8 = var17; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/SecondaryFunctionsHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/SecondaryFunctionsHelper.java index 142cee1ea6..b9056afa06 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/SecondaryFunctionsHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/SecondaryFunctionsHelper.java @@ -12,6 +12,7 @@ import org.jetbrains.java.decompiler.modules.decompiler.vars.VarProcessor; import org.jetbrains.java.decompiler.modules.decompiler.vars.VarVersionPair; import org.jetbrains.java.decompiler.struct.gen.CodeType; +import org.jetbrains.java.decompiler.struct.gen.TypeFamily; import org.jetbrains.java.decompiler.struct.gen.VarType; import java.util.*; @@ -402,6 +403,57 @@ private static Exprent identifySecondaryFunctions(Exprent exprent, boolean state return new FunctionExprent(FunctionType.TERNARY, Arrays.asList( head, new ConstExprent(VarType.VARTYPE_INT, 0, null), iff), fexpr.bytecode); + case I2B: + case I2C: + case I2S: + if (lstOperands.get(0) instanceof FunctionExprent) { + FunctionExprent innerFunction = (FunctionExprent) lstOperands.get(0); + VarType castType = innerFunction.getFuncType().castType; + if (castType == VarType.VARTYPE_INT) { + // longs, floats and doubles are converted to ints before being converted to bytes, shorts or chars + innerFunction.setNeedsCast(false); + return ret; + } + } + // fallthrough + case I2L: + case I2F: + case I2D: + case L2F: + case L2D: + case F2D: + VarType exprType = lstOperands.get(0).getExprType(); + VarType castType = fexpr.getSimpleCastType(); + + // Simplify widening cast + if (castType.typeFamily == TypeFamily.INTEGER) { + if (castType.isStrictSuperset(exprType)) { + fexpr.setNeedsCast(false); + return ret; + } + } else if (castType.typeFamily.isGreater(exprType.typeFamily)) { + fexpr.setNeedsCast(false); + return ret; + } + break; + case DIV: + Exprent left = lstOperands.get(0); + boolean leftImplicitCast = left instanceof FunctionExprent && ((FunctionExprent) left).getSimpleCastType() != null && !((FunctionExprent) left).doesCast(); + Exprent right = lstOperands.get(1); + boolean rightImplicitCast = right instanceof FunctionExprent && ((FunctionExprent) right).getSimpleCastType() != null && !((FunctionExprent) right).doesCast(); + + if (leftImplicitCast && rightImplicitCast && right.getExprType() == left.getExprType()) { + // Only a single cast is needed explicitly + ((FunctionExprent) left).setNeedsCast(true); + } + break; + case SHL: + case SHR: + case USHR: + Exprent op = lstOperands.get(0); + if (op instanceof FunctionExprent && ((FunctionExprent) op).getSimpleCastType() != null && !((FunctionExprent) op).doesCast()) { + ((FunctionExprent) op).setNeedsCast(true); + } } break; case ASSIGNMENT: // check for conditional assignment @@ -464,6 +516,15 @@ private static Exprent identifySecondaryFunctions(Exprent exprent, boolean state } break; case INVOCATION: + InvocationExprent invocationExpr = (InvocationExprent) exprent; + if (invocationExpr.isBoxingCall()) { + Exprent param = invocationExpr.getLstParameters().get(0); + // Keep casts of boxed exprents + if (param instanceof FunctionExprent && ((FunctionExprent) param).getSimpleCastType() != null && !((FunctionExprent) param).doesCast()) { + ((FunctionExprent) param).setNeedsCast(true); + } + } + if (!statement_level) { // simplify if exprent is a real expression. The opposite case is pretty absurd, can still happen however (and happened at least once). Exprent retexpr = ConcatenationHelper.contractStringConcat(exprent); if (!exprent.equals(retexpr)) { diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java index 43135b8997..788a98da35 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java @@ -3,7 +3,6 @@ */ package org.jetbrains.java.decompiler.modules.decompiler.exps; -import org.jetbrains.java.decompiler.code.CodeConstants; import org.jetbrains.java.decompiler.main.DecompilerContext; import org.jetbrains.java.decompiler.main.plugins.PluginImplementationException; import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor; @@ -663,9 +662,12 @@ else if (left instanceof ConstExprent) { inv.forceUnboxing(true); } } - return buf.append(wrapOperandString(lstOperands.get(0), true, indent)) - .prepend("(" + ExprProcessor.getTypeName(funcType.castType) + ")") - .addTypeNameToken(funcType.castType, 1); + + if (!needsCast) { + return buf.append(lstOperands.get(0).toJava(indent)); + } + + return buf.append(ExprProcessor.getTypeName(funcType.castType)).encloseWithParens().append(wrapOperandString(lstOperands.get(0), true, indent)); } // return ""; @@ -695,7 +697,7 @@ public void unwrapBox() { @Override public int getPrecedence() { - if (funcType == FunctionType.CAST && !doesCast()) { + if ((funcType == FunctionType.CAST || funcType.castType != null) && !doesCast()) { return lstOperands.get(0).getPrecedence(); } diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java index c80f066721..541d6a4744 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java @@ -1338,7 +1338,9 @@ private List getMatchedDescriptors() { private boolean matches(VarType[] left, VarType[] right) { if (left.length == right.length) { for (int i = 0; i < left.length; i++) { - if (left[i].typeFamily != right[i].typeFamily) { + TypeFamily leftFamily = left[i].typeFamily; + TypeFamily rightFamily = right[i].typeFamily; + if (leftFamily != rightFamily && !(leftFamily.isNumeric() && rightFamily.isNumeric())) { return false; } @@ -1406,6 +1408,10 @@ private BitSet getAmbiguousParameters(List matches) { boolean exact = true; for (int i = 0; i < md.params.length; i++) { Exprent exp = lstParameters.get(i); + if (exp instanceof FunctionExprent && ((FunctionExprent) exp).getSimpleCastType() != null) { + ((FunctionExprent) exp).setNeedsCast(true); + } + // Check if the current parameters and method descriptor are of the same type, or if the descriptor's type is a superset of the parameter's type. // This check ensures that parameters that can be safely passed don't have an unneeded cast on them, such as System.out.println((int)5);. // TODO: The root cause of the above issue seems to be threading related- When debugging line by line it doesn't cast, but when running normally it does. More digging needs to be done to figure out why this happens. diff --git a/src/org/jetbrains/java/decompiler/struct/gen/TypeFamily.java b/src/org/jetbrains/java/decompiler/struct/gen/TypeFamily.java index 2006596f51..e7929c32cc 100644 --- a/src/org/jetbrains/java/decompiler/struct/gen/TypeFamily.java +++ b/src/org/jetbrains/java/decompiler/struct/gen/TypeFamily.java @@ -5,12 +5,26 @@ public enum TypeFamily { UNKNOWN, BOOLEAN, - INTEGER, - FLOAT, - LONG, - DOUBLE, + INTEGER(true), + FLOAT(true), + LONG(true), + DOUBLE(true), OBJECT; + private final boolean numeric; + + TypeFamily() { + this(false); + } + + TypeFamily(boolean numeric) { + this.numeric = numeric; + } + + public boolean isNumeric() { + return numeric; + } + // TODO: document what these mean, and try to remove! Doesn't make sense to have these public boolean isGreater(@NotNull TypeFamily other) { diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index 7eb4e40b9b..abfaac27ff 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -253,7 +253,6 @@ private void registerDefault() { register(JAVA_16, "TestRecordAnno"); register(JAVA_16, "TestRecordBig"); register(JAVA_16, "TestRecordGenericSuperclass"); - // TODO: The (double) in front of the (int) should be removed register(JAVA_8, "TestMultiCast"); // TODO: some tests don't have proper if else chains register(JAVA_8, "TestComplexIfElseChain"); @@ -621,7 +620,7 @@ private void registerDefault() { // TODO: order of additions is wrong. Addition over floats isn't associative. // Derived from IDEA-291735 register(JAVA_8, "TestFloatOrderOfOperations"); - // TODO: many unnecessary casts, and not simplifying to `+=` + // TODO: not simplifying to `+=` register(JAVA_8, "TestMixedCompoundAssignment"); register(JAVA_8, "TestForeachVardef"); register(JAVA_8, "TestGenericStaticCall"); @@ -635,7 +634,6 @@ private void registerDefault() { register(JAVA_8, "TestTryCatchNested"); register(JAVA_8, "TestSwitchTernary"); register(JAVA_8, "TestBooleanExpressions"); - // TODO: cast not created, incorrect register(JAVA_8, "TestObjectBitwise"); register(JAVA_17, "TestSealedFinal", "SealedInterface"); register(JAVA_17, "TestSealedRecord", "SealedInterface"); @@ -694,6 +692,9 @@ private void registerDefault() { register(JAVA_21_PREVIEW, "TestCustomProcessor"); register(JAVA_16, "TestMissingLambdaBody"); register(JAVA_21_PREVIEW, "TestUnnamedVar1"); + register(JAVA_8, "TestNumberCasts"); + // TODO: Disambiguate only the required parameters + register(JAVA_8, "TestNumberDisambiguation"); register(JAVA_8, "TestDanglingBoxingCall"); register(JAVA_21, "TestSwitchOnEnumJ21", "ext/TestEnum2"); register(JAVA_21, "TestInnerClassesJ21"); diff --git a/testData/results/pkg/TestAssignmentSwitchExpression3.dec b/testData/results/pkg/TestAssignmentSwitchExpression3.dec index 489a68cb39..72f0c7bd5f 100644 --- a/testData/results/pkg/TestAssignmentSwitchExpression3.dec +++ b/testData/results/pkg/TestAssignmentSwitchExpression3.dec @@ -7,11 +7,11 @@ public class TestAssignmentSwitchExpression3 { Random random = switch (x) {// 7 case -5, -4, -3, -2, -1 -> { int seed = x >> 2;// 14 - yield new Random((long)seed);// 15 + yield new Random(seed);// 15 } default -> throw new IllegalStateException("Unexpected value: " + x);// 17 case 1, 2, 3, 4, 5 -> { - long seed = System.currentTimeMillis() - (long)(x * 1000);// 9 + long seed = System.currentTimeMillis() - x * 1000;// 9 yield new Random(seed);// 10 } case 6, 7, 8, 9, 10 -> new Random(); diff --git a/testData/results/pkg/TestClassVar.dec b/testData/results/pkg/TestClassVar.dec index 7756a767d7..475c7228c4 100644 --- a/testData/results/pkg/TestClassVar.dec +++ b/testData/results/pkg/TestClassVar.dec @@ -17,7 +17,7 @@ public class TestClassVar { }// 37 public Long testFieldSSAU1() { - return new Long((long)(this.field_int++));// 40 + return new Long(this.field_int++);// 40 } public void testComplexPropagation() { diff --git a/testData/results/pkg/TestDebugSymbols.dec b/testData/results/pkg/TestDebugSymbols.dec index 1300ffd36f..dcbc8997eb 100644 --- a/testData/results/pkg/TestDebugSymbols.dec +++ b/testData/results/pkg/TestDebugSymbols.dec @@ -5,7 +5,7 @@ class TestDebugSymbols { String text = "text";// 21 long prolonged = 42L;// 22 float decimated = (float)prolonged / 10.0F;// 23 - double doubled = (double)(2.0F * decimated);// 24 + double doubled = 2.0F * decimated;// 24 return (text + ":" + prolonged + ":" + decimated + ":" + doubled).length();// 25 } } diff --git a/testData/results/pkg/TestDefiniteAssignment.dec b/testData/results/pkg/TestDefiniteAssignment.dec index 614f039688..02fc48d261 100644 --- a/testData/results/pkg/TestDefiniteAssignment.dec +++ b/testData/results/pkg/TestDefiniteAssignment.dec @@ -56,9 +56,7 @@ public class TestDefiniteAssignment { double cFake = 0.01;// 48 System.out.println(cFake);// 49 - if ((double)n < 1.0 - (double)n && (cFake = (double)(n + 5)) > cFake * cFake - cFake / 2.0// 53 - ? !((double)n > cFake) - : !((double)n < 5.0 - (cFake = (double)n))) { + if (n < 1.0 - n && (cFake = n + 5) > cFake * cFake - cFake / 2.0 ? !(n > cFake) : !(n < 5.0 - (cFake = n))) {// 53 cFake += 5.0;// 57 } else { System.out.println(cFake);// 54 @@ -67,7 +65,7 @@ public class TestDefiniteAssignment { System.out.println(cFake);// 59 double d; - if ((d = (double)n) > 0.0) {// 63 + if ((d = n) > 0.0) {// 63 System.out.println(d);// 64 } }// 67 @@ -299,207 +297,207 @@ class 'pkg/TestDefiniteAssignment' { 67 58 68 58 69 58 - 6c 60 - 6d 60 - 6e 60 - 6f 60 - 70 60 - 71 60 - 72 60 - 74 60 - 75 60 - 76 60 - 77 60 - 78 60 - 7e 59 - 7f 59 - 80 59 - 81 59 - 82 59 - 83 59 - 86 63 - 87 63 - 88 63 - 89 63 - 8a 63 - 8b 63 - 8c 63 - 8d 63 - 90 64 - 91 64 - 92 64 - 94 64 - 95 64 - 9b 61 - 9c 61 - 9d 61 - 9f 61 - a0 61 - a1 67 - a2 67 - a3 67 - a4 67 - a5 67 - a6 67 - a7 67 - a8 67 - a9 69 - aa 69 - ac 69 - ad 69 - ae 69 - af 69 - b0 69 - bb 69 - be 70 - bf 70 - c0 70 - c1 70 - c2 70 - c3 70 - c6 72 + 6c 58 + 6d 58 + 6e 58 + 6f 58 + 70 58 + 71 58 + 72 58 + 74 58 + 75 58 + 76 58 + 77 58 + 78 58 + 7e 58 + 7f 58 + 80 58 + 81 58 + 82 58 + 83 58 + 86 61 + 87 61 + 88 61 + 89 61 + 8a 61 + 8b 61 + 8c 61 + 8d 61 + 90 62 + 91 62 + 92 62 + 94 62 + 95 62 + 9b 59 + 9c 59 + 9d 59 + 9f 59 + a0 59 + a1 65 + a2 65 + a3 65 + a4 65 + a5 65 + a6 65 + a7 65 + a8 65 + a9 67 + aa 67 + ac 67 + ad 67 + ae 67 + af 67 + b0 67 + bb 67 + be 68 + bf 68 + c0 68 + c1 68 + c2 68 + c3 68 + c6 70 } method 'testBooleanNormalness (I)V' { - 0 75 - 1 75 - 2 75 - 3 75 - 4 77 - 5 77 - 6 77 - 9 77 - a 77 - b 77 - d 77 - e 77 - 12 77 - 15 77 - 16 77 - 19 78 - 1a 78 - 1b 78 - 1c 78 - 1d 78 - 1e 78 - 21 81 - 22 81 - 23 81 - 24 82 - 25 82 - 26 82 - 27 82 - 28 82 - 29 82 - 2a 82 - 2b 83 + 0 73 + 1 73 + 2 73 + 3 73 + 4 75 + 5 75 + 6 75 + 9 75 + a 75 + b 75 + d 75 + e 75 + 12 75 + 15 75 + 16 75 + 19 76 + 1a 76 + 1b 76 + 1c 76 + 1d 76 + 1e 76 + 21 79 + 22 79 + 23 79 + 24 80 + 25 80 + 26 80 + 27 80 + 28 80 + 29 80 + 2a 80 + 2b 81 } method 'testBooleanNormalnessInline (I)V' { - 0 86 - 1 86 - 2 86 - 3 86 - 4 88 - 5 88 - 6 88 - 9 88 - a 88 - b 88 - d 88 - e 88 - 12 88 - 15 88 - 16 88 - 1e 88 - 1f 88 - 20 88 - 22 89 - 23 89 - 24 89 - 25 90 - 26 90 - 27 90 - 28 90 - 29 90 - 2a 90 - 2b 90 - 2c 91 + 0 84 + 1 84 + 2 84 + 3 84 + 4 86 + 5 86 + 6 86 + 9 86 + a 86 + b 86 + d 86 + e 86 + 12 86 + 15 86 + 16 86 + 1e 86 + 1f 86 + 20 86 + 22 87 + 23 87 + 24 87 + 25 88 + 26 88 + 27 88 + 28 88 + 29 88 + 2a 88 + 2b 88 + 2c 89 } method 'nestedTernaries (III)V' { - 0 96 - 1 96 - 4 97 - 5 97 - 6 97 - 9 101 - b 101 - c 101 - d 102 - 13 106 - 15 106 - 16 106 - 17 107 - 1a 107 - 1b 107 - 1c 107 - 1f 112 - 20 112 - 21 112 - 22 112 - 23 112 - 24 112 - 27 120 - 28 120 - 2b 121 - 2c 121 - 2d 121 - 30 125 - 32 125 - 33 125 - 34 126 - 3a 130 - 3c 130 - 3d 130 - 3e 131 - 41 131 - 42 131 - 43 131 - 46 136 - 47 136 - 48 136 - 49 136 - 4a 136 - 4d 136 - 4e 136 - 4f 136 - 51 136 - 52 136 - 53 136 - 54 136 - 5a 142 - 5c 142 - 5d 142 - 5e 143 - 60 143 - 61 143 - 62 144 - 65 149 - 66 149 - 67 149 - 68 149 - 69 149 - 6a 149 - 6d 152 - 6e 152 - 6f 152 - 70 152 - 71 152 - 72 152 - 73 152 - 74 152 - 75 153 + 0 94 + 1 94 + 4 95 + 5 95 + 6 95 + 9 99 + b 99 + c 99 + d 100 + 13 104 + 15 104 + 16 104 + 17 105 + 1a 105 + 1b 105 + 1c 105 + 1f 110 + 20 110 + 21 110 + 22 110 + 23 110 + 24 110 + 27 118 + 28 118 + 2b 119 + 2c 119 + 2d 119 + 30 123 + 32 123 + 33 123 + 34 124 + 3a 128 + 3c 128 + 3d 128 + 3e 129 + 41 129 + 42 129 + 43 129 + 46 134 + 47 134 + 48 134 + 49 134 + 4a 134 + 4d 134 + 4e 134 + 4f 134 + 51 134 + 52 134 + 53 134 + 54 134 + 5a 140 + 5c 140 + 5d 140 + 5e 141 + 60 141 + 61 141 + 62 142 + 65 147 + 66 147 + 67 147 + 68 147 + 69 147 + 6a 147 + 6d 150 + 6e 150 + 6f 150 + 70 150 + 71 150 + 72 150 + 73 150 + 74 150 + 75 151 } } @@ -526,27 +524,27 @@ Lines mapping: 48 <-> 57 49 <-> 58 53 <-> 59 -54 <-> 64 -55 <-> 65 -57 <-> 62 -59 <-> 68 -63 <-> 70 -64 <-> 71 -67 <-> 73 -71 <-> 76 -72 <-> 78 -73 <-> 79 -75 <-> 82 -76 <-> 83 -77 <-> 84 -81 <-> 87 -82 <-> 89 -83 <-> 90 -84 <-> 91 -85 <-> 92 -89 <-> 97 -90 <-> 113 -94 <-> 121 -97 <-> 150 -99 <-> 153 -100 <-> 154 +54 <-> 62 +55 <-> 63 +57 <-> 60 +59 <-> 66 +63 <-> 68 +64 <-> 69 +67 <-> 71 +71 <-> 74 +72 <-> 76 +73 <-> 77 +75 <-> 80 +76 <-> 81 +77 <-> 82 +81 <-> 85 +82 <-> 87 +83 <-> 88 +84 <-> 89 +85 <-> 90 +89 <-> 95 +90 <-> 111 +94 <-> 119 +97 <-> 148 +99 <-> 151 +100 <-> 152 diff --git a/testData/results/pkg/TestDoublePopAfterJump.dec b/testData/results/pkg/TestDoublePopAfterJump.dec index ee88d99f74..f08d915cdc 100644 --- a/testData/results/pkg/TestDoublePopAfterJump.dec +++ b/testData/results/pkg/TestDoublePopAfterJump.dec @@ -14,7 +14,7 @@ public final class TestDoublePopAfterJump { var10001 = var10004; } - return (double)var10001 / (double)var10000;// 44 45 46 + return (double)var10001 / var10000;// 44 45 46 } public static final void fizzBuzz() { diff --git a/testData/results/pkg/TestLocalsNames.dec b/testData/results/pkg/TestLocalsNames.dec index d54d30db1f..1a30a11df3 100644 --- a/testData/results/pkg/TestLocalsNames.dec +++ b/testData/results/pkg/TestLocalsNames.dec @@ -15,7 +15,7 @@ public class TestLocalsNames { } long elapsed = System.currentTimeMillis() - start;// 31 - System.out.println("took " + elapsed + "ms (" + elapsed / (long)files.length + "ms per dir)");// 32 + System.out.println("took " + elapsed + "ms (" + elapsed / files.length + "ms per dir)");// 32 } }// 34 } diff --git a/testData/results/pkg/TestMethodHandles.dec b/testData/results/pkg/TestMethodHandles.dec index 0484c05591..1706ff1f9f 100644 --- a/testData/results/pkg/TestMethodHandles.dec +++ b/testData/results/pkg/TestMethodHandles.dec @@ -12,33 +12,33 @@ public class TestMethodHandles { public void test1() throws Throwable { MethodHandle abs = LOOKUP.findStatic(Math.class, "abs", MethodType.methodType(long.class, long.class));// 10 int a = -5;// 11 - long b = (long)abs.invokeExact((long)a);// 12 + long b = (long)abs.invokeExact(a);// 12 System.out.println(b);// 13 }// 14 public int test2() throws Throwable { MethodHandle abs = LOOKUP.findStatic(Math.class, "abs", MethodType.methodType(long.class, long.class));// 17 int a = -5;// 18 - return (int)(long)abs.invokeExact((long)a);// 19 + return (int)(long)abs.invokeExact(a);// 19 } public void test3() throws Throwable { MethodHandle abs = LOOKUP.findStatic(Math.class, "abs", MethodType.methodType(long.class, long.class));// 23 int a = -5;// 24 - long b = (long)abs.invoke((long)a);// 25 + long b = (long)abs.invoke(a);// 25 System.out.println(b);// 26 }// 27 public int test4() throws Throwable { MethodHandle abs = LOOKUP.findStatic(Math.class, "abs", MethodType.methodType(long.class, long.class));// 30 int a = -5;// 31 - return (int)(long)abs.invoke((long)a);// 32 + return (int)(long)abs.invoke(a);// 32 } public void test5() throws Throwable { MethodHandle println = LOOKUP.findVirtual(PrintStream.class, "println", MethodType.methodType(void.class, long.class));// 36 int a = -5;// 37 - println.invokeExact(System.out, (long)a);// 38 + println.invokeExact(System.out, a);// 38 }// 39 } diff --git a/testData/results/pkg/TestMixedCompoundAssignment.dec b/testData/results/pkg/TestMixedCompoundAssignment.dec index 14008b4b08..dc21681687 100644 --- a/testData/results/pkg/TestMixedCompoundAssignment.dec +++ b/testData/results/pkg/TestMixedCompoundAssignment.dec @@ -2,53 +2,53 @@ package pkg; public class TestMixedCompoundAssignment { public int testSimpleIntFloat(int i, float j) { - i = (int)((float)i + j);// 5 - i = (int)((float)i - j);// 6 - i = (int)((float)i * j);// 7 - return (int)((float)i / j);// 8 10 + i = (int)(i + j);// 5 + i = (int)(i - j);// 6 + i = (int)(i * j);// 7 + return (int)(i / j);// 8 10 } public int testSimpleIntLong(int i, long j) { - i = (int)((long)i + j);// 14 - i = (int)((long)i - j);// 15 - i = (int)((long)i * j);// 16 - i = (int)((long)i / j);// 17 - i = (int)((long)i & j);// 18 - i = (int)((long)i | j);// 19 - i = (int)((long)i ^ j);// 20 + i = (int)(i + j);// 14 + i = (int)(i - j);// 15 + i = (int)(i * j);// 16 + i = (int)(i / j);// 17 + i = (int)(i & j);// 18 + i = (int)(i | j);// 19 + i = (int)(i ^ j);// 20 i >>= (int)j;// 21 i <<= (int)j;// 22 return i >>> (int)j;// 23 25 } public double testSimpleDoubleLong(double i, long j) { - i += (double)j;// 29 - i -= (double)j;// 30 - i *= (double)j;// 31 - return i / (double)j;// 32 34 + i += j;// 29 + i -= j;// 30 + i *= j;// 31 + return i / j;// 32 34 } public int testNestedIntLongDouble(int i, long j, double k) { long var9; - i = (int)((long)i + (var9 = (long)((double)j + k)));// 38 - i = (int)((long)i - (j = (long)((double)var9 - k)));// 39 + i = (int)(i + (var9 = (long)(j + k)));// 38 + i = (int)(i - (j = (long)(var9 - k)));// 39 long var11; - i = (int)((long)i * (var11 = (long)((double)j * k)));// 40 - return (int)((long)i / (long)((double)var11 / k));// 41 44 + i = (int)(i * (var11 = (long)(j * k)));// 40 + return (int)(i / (long)(var11 / k));// 41 44 } public long testNestedLongIntLong(long i, int j, long k) { int var15; - i += (long)(var15 = (int)((long)j + k));// 48 - i -= (long)(j = (int)((long)var15 - k));// 49 + i += var15 = (int)(j + k);// 48 + i -= j = (int)(var15 - k);// 49 int var17; - i *= (long)(var17 = (int)((long)j * k));// 50 - i /= (long)(j = (int)((long)var17 / k));// 51 + i *= var17 = (int)(j * k);// 50 + i /= j = (int)(var17 / k);// 51 int var19; - i &= (long)(var19 = (int)((long)j & k));// 52 - i |= (long)(j = (int)((long)var19 | k));// 53 + i &= var19 = (int)(j & k);// 52 + i |= j = (int)(var19 | k);// 53 int var21; - i ^= (long)(var21 = (int)((long)j ^ k));// 54 + i ^= var21 = (int)(j ^ k);// 54 i >>= j = var21 >> (int)k;// 55 int var23; i <<= var23 = j << (int)k;// 56 @@ -57,25 +57,25 @@ public class TestMixedCompoundAssignment { public void testArrayIntDouble(int[] holder, int i, double inc) { for (int j = 0; j < i; j++) {// 64 - holder[j] = (int)((double)holder[j] + inc);// 65 + holder[j] = (int)(holder[j] + inc);// 65 } }// 67 public void testArrayIntLong(int[] holder, int i, long inc) { for (int j = 0; j < i; j++) {// 70 - holder[j] = (int)((long)holder[j] + inc);// 71 + holder[j] = (int)(holder[j] + inc);// 71 } }// 73 public void testArrayDoubleInt(double[] holder, int i, int inc) { for (int j = 0; j < i; j++) {// 76 - holder[j] += (double)inc;// 77 + holder[j] += inc;// 77 } }// 79 public void testNestedArrayByteFloatLongDouble(byte[] outer, float[] holder, long[] inner, int i, double inc) { for (int j = 0; j < i; j++) {// 82 - outer[i + ~j] = (byte)((int)((float)outer[i + ~j] + (holder[j] -= (float)(inner[j * 3 % i] = (long)((double)inner[j * 3 % i] + inc)))));// 83 + outer[i + ~j] = (byte)(outer[i + ~j] + (holder[j] -= (float)(inner[j * 3 % i] = (long)(inner[j * 3 % i] + inc))));// 83 } }// 85 } diff --git a/testData/results/pkg/TestMultiCast.dec b/testData/results/pkg/TestMultiCast.dec index 42a0868055..37c4f4980f 100644 --- a/testData/results/pkg/TestMultiCast.dec +++ b/testData/results/pkg/TestMultiCast.dec @@ -2,7 +2,7 @@ package pkg; public class TestMultiCast { public void test(double arg1, double arg2) { - useNumbers((double)((int)arg1), (double)((int)arg2));// 5 + useNumbers((int)arg1, (int)arg2);// 5 }// 6 private static void useNumbers(double arg1, double arg2) { diff --git a/testData/results/pkg/TestMultipleStaticBlocks.dec b/testData/results/pkg/TestMultipleStaticBlocks.dec index 02242d41c0..c8fa547c75 100644 --- a/testData/results/pkg/TestMultipleStaticBlocks.dec +++ b/testData/results/pkg/TestMultipleStaticBlocks.dec @@ -4,12 +4,12 @@ public class TestMultipleStaticBlocks { private static int i; static { - byte value = (byte)((int)(Math.random() * 8.0));// 7 + byte value = (byte)(Math.random() * 8.0);// 7 if (value > 4) {// 8 i = 1;// 9 } - value = (byte)((short)((int)(Math.random() * 8.0)));// 14 + value = (byte)((short)(Math.random() * 8.0));// 14 if (value > 4) {// 15 i = 2;// 16 } diff --git a/testData/results/pkg/TestNumberCasts.dec b/testData/results/pkg/TestNumberCasts.dec new file mode 100644 index 0000000000..ed9dd15a90 --- /dev/null +++ b/testData/results/pkg/TestNumberCasts.dec @@ -0,0 +1,367 @@ +package pkg; + +public class TestNumberCasts { + private static void b(byte b) { + }// 5 + + private static void s(short s) { + }// 8 + + private static void i(int i) { + }// 11 + + private static void l(long l) { + }// 14 + + private static void f(float f) { + }// 17 + + private static void d(double d) { + }// 20 + + public void test() { + byte b = 127;// 23 + b(b);// 24 + s(b);// 25 + i(b);// 26 + l(b);// 27 + f(b);// 28 + d(b);// 29 + short s = 32767;// 31 + b((byte)s);// 32 + s(s);// 33 + i(s);// 34 + l(s);// 35 + f(s);// 36 + d(s);// 37 + int i = 2147483647;// 39 + b((byte)i);// 40 + s((short)i);// 41 + i(i);// 42 + l(i);// 43 + f(i);// 44 + d(i);// 45 + long l = 9223372036854775807L;// 47 + b((byte)l);// 48 + s((short)l);// 49 + i((int)l);// 50 + l(l);// 51 + f((float)l);// 52 + d(l);// 53 + float f = 3.4028235E38F;// 55 + b((byte)f);// 56 + s((short)f);// 57 + i((int)f);// 58 + l((long)f);// 59 + f(f);// 60 + d(f);// 61 + double d = 1.7976931348623157E308;// 63 + b((byte)d);// 64 + s((short)d);// 65 + i((int)d);// 66 + l((long)d);// 67 + f((float)d);// 68 + d(d);// 69 + }// 70 +} + +class 'pkg/TestNumberCasts' { + method 'b (B)V' { + 0 4 + } + + method 's (S)V' { + 0 7 + } + + method 'i (I)V' { + 0 10 + } + + method 'l (J)V' { + 0 13 + } + + method 'f (F)V' { + 0 16 + } + + method 'd (D)V' { + 0 19 + } + + method 'test ()V' { + 0 22 + 1 22 + 2 22 + 3 23 + 4 23 + 5 23 + 6 23 + 7 24 + 8 24 + 9 24 + a 24 + b 24 + c 25 + d 25 + e 25 + f 25 + 10 26 + 11 26 + 12 26 + 13 26 + 14 26 + 15 27 + 16 27 + 17 27 + 18 27 + 19 27 + 1a 28 + 1b 28 + 1c 28 + 1d 28 + 1e 28 + 1f 29 + 20 29 + 21 29 + 22 29 + 23 30 + 24 30 + 25 30 + 26 30 + 27 30 + 28 31 + 29 31 + 2a 31 + 2b 31 + 2c 32 + 2d 32 + 2e 32 + 2f 32 + 30 33 + 31 33 + 32 33 + 33 33 + 34 33 + 35 34 + 36 34 + 37 34 + 38 34 + 39 34 + 3a 35 + 3b 35 + 3c 35 + 3d 35 + 3e 35 + 3f 36 + 40 36 + 41 36 + 42 37 + 43 37 + 44 37 + 45 37 + 46 37 + 47 38 + 48 38 + 49 38 + 4a 38 + 4b 38 + 4c 39 + 4d 39 + 4e 39 + 4f 39 + 50 40 + 51 40 + 52 40 + 53 40 + 54 40 + 55 41 + 56 41 + 57 41 + 58 41 + 59 41 + 5a 42 + 5b 42 + 5c 42 + 5d 42 + 5e 42 + 5f 43 + 60 43 + 61 43 + 62 43 + 63 43 + 64 44 + 65 44 + 66 44 + 67 44 + 68 44 + 69 44 + 6a 44 + 6b 45 + 6c 45 + 6d 45 + 6e 45 + 6f 45 + 70 45 + 71 45 + 72 46 + 73 46 + 74 46 + 75 46 + 76 46 + 77 46 + 78 47 + 79 47 + 7a 47 + 7b 47 + 7c 47 + 7d 48 + 7e 48 + 7f 48 + 80 48 + 81 48 + 82 48 + 83 49 + 84 49 + 85 49 + 86 49 + 87 49 + 88 49 + 89 50 + 8a 50 + 8b 50 + 8c 50 + 8d 51 + 8e 51 + 8f 51 + 90 51 + 91 51 + 92 51 + 93 51 + 94 52 + 95 52 + 96 52 + 97 52 + 98 52 + 99 52 + 9a 52 + 9b 53 + 9c 53 + 9d 53 + 9e 53 + 9f 53 + a0 53 + a1 54 + a2 54 + a3 54 + a4 54 + a5 54 + a6 54 + a7 55 + a8 55 + a9 55 + aa 55 + ab 55 + ac 56 + ad 56 + ae 56 + af 56 + b0 56 + b1 56 + b2 57 + b3 57 + b4 57 + b5 57 + b6 57 + b7 58 + b8 58 + b9 58 + ba 58 + bb 58 + bc 58 + bd 58 + be 59 + bf 59 + c0 59 + c1 59 + c2 59 + c3 59 + c4 59 + c5 60 + c6 60 + c7 60 + c8 60 + c9 60 + ca 60 + cb 61 + cc 61 + cd 61 + ce 61 + cf 61 + d0 61 + d1 62 + d2 62 + d3 62 + d4 62 + d5 62 + d6 62 + d7 63 + d8 63 + d9 63 + da 63 + db 63 + dc 64 + } +} + +Lines mapping: +5 <-> 5 +8 <-> 8 +11 <-> 11 +14 <-> 14 +17 <-> 17 +20 <-> 20 +23 <-> 23 +24 <-> 24 +25 <-> 25 +26 <-> 26 +27 <-> 27 +28 <-> 28 +29 <-> 29 +31 <-> 30 +32 <-> 31 +33 <-> 32 +34 <-> 33 +35 <-> 34 +36 <-> 35 +37 <-> 36 +39 <-> 37 +40 <-> 38 +41 <-> 39 +42 <-> 40 +43 <-> 41 +44 <-> 42 +45 <-> 43 +47 <-> 44 +48 <-> 45 +49 <-> 46 +50 <-> 47 +51 <-> 48 +52 <-> 49 +53 <-> 50 +55 <-> 51 +56 <-> 52 +57 <-> 53 +58 <-> 54 +59 <-> 55 +60 <-> 56 +61 <-> 57 +63 <-> 58 +64 <-> 59 +65 <-> 60 +66 <-> 61 +67 <-> 62 +68 <-> 63 +69 <-> 64 +70 <-> 65 diff --git a/testData/results/pkg/TestNumberDisambiguation.dec b/testData/results/pkg/TestNumberDisambiguation.dec new file mode 100644 index 0000000000..26613185c1 --- /dev/null +++ b/testData/results/pkg/TestNumberDisambiguation.dec @@ -0,0 +1,384 @@ +package pkg; + +public class TestNumberDisambiguation { + public void foo(byte b) { + }// 5 + + public void foo(short s) { + }// 8 + + public void foo(char c) { + }// 11 + + public void foo(int i) { + }// 14 + + public void foo(long l) { + }// 17 + + public void foo(float f) { + }// 20 + + public void foo(double d) { + }// 23 + + public void bar(byte a, byte b) { + }// 26 + + public void bar(short a, short b) { + }// 29 + + public void bar(char a, char b) { + }// 32 + + public void bar(int a, int b) { + }// 35 + + public void bar(long a, long b) { + }// 38 + + public void bar(float a, float b) { + }// 41 + + public void bar(double a, double b) { + }// 44 + + public void baz(int a, byte b, byte c) { + }// 47 + + public void baz(int a, short b, short c) { + }// 50 + + public void baz(int a, char b, char c) { + }// 53 + + public void baz(int a, int b, int c) { + }// 56 + + public void baz(int a, long b, long c) { + }// 59 + + public void baz(int a, float b, float c) { + }// 62 + + public void baz(int a, double b, double c) { + }// 65 + + public void test() { + int i = 24;// 68 + this.foo((byte)i);// 69 + this.foo((short)i);// 70 + this.foo((char)i);// 71 + this.foo(i);// 72 + this.foo((long)i);// 73 + this.foo((float)i);// 74 + this.foo((double)i);// 75 + this.bar((byte)0, (byte)i);// 77 + this.bar((short)0, (short)i);// 78 + this.bar('\u0000', (char)i);// 79 + this.bar(0, i);// 80 + this.bar(0L, (long)i);// 81 + this.bar(0.0F, (float)i);// 82 + this.bar(0.0, (double)i);// 83 + this.baz(0, (byte)127, (byte)i);// 85 + this.baz(0, (short)32767, (short)i);// 86 + this.baz(0, '\uffff', (char)i);// 87 + this.baz(0, 2147483647, i);// 88 + this.baz(0, 9223372036854775807L, (long)i);// 89 + this.baz(0, 3.4028235E38F, (float)i);// 90 + this.baz(0, 1.7976931348623157E308, (double)i);// 91 + }// 92 +} + +class 'pkg/TestNumberDisambiguation' { + method 'foo (B)V' { + 0 4 + } + + method 'foo (S)V' { + 0 7 + } + + method 'foo (C)V' { + 0 10 + } + + method 'foo (I)V' { + 0 13 + } + + method 'foo (J)V' { + 0 16 + } + + method 'foo (F)V' { + 0 19 + } + + method 'foo (D)V' { + 0 22 + } + + method 'bar (BB)V' { + 0 25 + } + + method 'bar (SS)V' { + 0 28 + } + + method 'bar (CC)V' { + 0 31 + } + + method 'bar (II)V' { + 0 34 + } + + method 'bar (JJ)V' { + 0 37 + } + + method 'bar (FF)V' { + 0 40 + } + + method 'bar (DD)V' { + 0 43 + } + + method 'baz (IBB)V' { + 0 46 + } + + method 'baz (ISS)V' { + 0 49 + } + + method 'baz (ICC)V' { + 0 52 + } + + method 'baz (III)V' { + 0 55 + } + + method 'baz (IJJ)V' { + 0 58 + } + + method 'baz (IFF)V' { + 0 61 + } + + method 'baz (IDD)V' { + 0 64 + } + + method 'test ()V' { + 0 67 + 1 67 + 2 67 + 3 68 + 4 68 + 5 68 + 6 68 + 7 68 + 8 68 + 9 69 + a 69 + b 69 + c 69 + d 69 + e 69 + f 70 + 10 70 + 11 70 + 12 70 + 13 70 + 14 70 + 15 71 + 16 71 + 17 71 + 18 71 + 19 71 + 1a 72 + 1b 72 + 1c 72 + 1d 72 + 1e 72 + 1f 72 + 20 73 + 21 73 + 22 73 + 23 73 + 24 73 + 25 73 + 26 74 + 27 74 + 28 74 + 29 74 + 2a 74 + 2b 74 + 2c 75 + 2d 75 + 2e 75 + 2f 75 + 30 75 + 31 75 + 32 75 + 33 76 + 34 76 + 35 76 + 36 76 + 37 76 + 38 76 + 39 76 + 3a 77 + 3b 77 + 3c 77 + 3d 77 + 3e 77 + 3f 77 + 40 77 + 41 78 + 42 78 + 43 78 + 44 78 + 45 78 + 46 78 + 47 79 + 48 79 + 49 79 + 4a 79 + 4b 79 + 4c 79 + 4d 79 + 4e 80 + 4f 80 + 50 80 + 51 80 + 52 80 + 53 80 + 54 80 + 55 81 + 56 81 + 57 81 + 58 81 + 59 81 + 5a 81 + 5b 81 + 5c 82 + 5d 82 + 5e 82 + 5f 82 + 60 82 + 61 82 + 62 82 + 63 82 + 64 82 + 65 83 + 66 83 + 67 83 + 68 83 + 69 83 + 6a 83 + 6b 83 + 6c 83 + 6d 83 + 6e 83 + 6f 84 + 70 84 + 71 84 + 72 84 + 73 84 + 74 84 + 75 84 + 76 84 + 77 84 + 78 85 + 79 85 + 7a 85 + 7b 85 + 7c 85 + 7d 85 + 7e 85 + 7f 85 + 80 86 + 81 86 + 82 86 + 83 86 + 84 86 + 85 86 + 86 86 + 87 86 + 88 86 + 89 86 + 8a 87 + 8b 87 + 8c 87 + 8d 87 + 8e 87 + 8f 87 + 90 87 + 91 87 + 92 87 + 93 88 + 94 88 + 95 88 + 96 88 + 97 88 + 98 88 + 99 88 + 9a 88 + 9b 88 + 9c 88 + 9d 89 + } +} + +Lines mapping: +5 <-> 5 +8 <-> 8 +11 <-> 11 +14 <-> 14 +17 <-> 17 +20 <-> 20 +23 <-> 23 +26 <-> 26 +29 <-> 29 +32 <-> 32 +35 <-> 35 +38 <-> 38 +41 <-> 41 +44 <-> 44 +47 <-> 47 +50 <-> 50 +53 <-> 53 +56 <-> 56 +59 <-> 59 +62 <-> 62 +65 <-> 65 +68 <-> 68 +69 <-> 69 +70 <-> 70 +71 <-> 71 +72 <-> 72 +73 <-> 73 +74 <-> 74 +75 <-> 75 +77 <-> 76 +78 <-> 77 +79 <-> 78 +80 <-> 79 +81 <-> 80 +82 <-> 81 +83 <-> 82 +85 <-> 83 +86 <-> 84 +87 <-> 85 +88 <-> 86 +89 <-> 87 +90 <-> 88 +91 <-> 89 +92 <-> 90 diff --git a/testData/results/pkg/TestObjectBitwise.dec b/testData/results/pkg/TestObjectBitwise.dec index 9792f57f5b..82ce7049c0 100644 --- a/testData/results/pkg/TestObjectBitwise.dec +++ b/testData/results/pkg/TestObjectBitwise.dec @@ -4,27 +4,27 @@ public abstract class TestObjectBitwise { abstract T get(); public boolean test(int i) { - return ((Long)this.obj() & (long)i) == 0L;// 7 + return ((Long)this.obj() & i) == 0L;// 7 } public boolean testn(int i) { - return ((Long)this.num() & (long)i) == 0L;// 11 + return ((Long)this.num() & i) == 0L;// 11 } public boolean testg(int i) { - return ((Long)this.get() & (long)i) == 0L;// 15 + return ((Long)this.get() & i) == 0L;// 15 } public boolean test1(int i) { - return ((Long)this.obj() | (long)i) == 0L;// 50 + return ((Long)this.obj() | i) == 0L;// 50 } public boolean test3(int i) { - return (Long)this.obj() + (long)i == 0L;// 54 + return (Long)this.obj() + i == 0L;// 54 } public boolean test4(int i) { - return (Long)this.obj() % (long)i == 0L;// 58 + return (Long)this.obj() % i == 0L;// 58 } public Object obj() { @@ -43,17 +43,17 @@ public abstract class TestObjectBitwise { } public boolean testg_inner(int i) { - return (this.get() & (long)i) == 0L;// 27 + return (this.get() & i) == 0L;// 27 } public boolean testg_inner2(int i) { long l = this.get();// 31 - return (l & (long)i) == 0L;// 32 + return (l & i) == 0L;// 32 } public boolean testg_inner3(int i) { long l = this.other.get();// 36 - return (l & (long)i) == 0L;// 37 + return (l & i) == 0L;// 37 } public boolean testg_inner4(int i) { @@ -61,7 +61,7 @@ public abstract class TestObjectBitwise { long l2 = (Long)this.other.num();// 42 long l3 = (Long)this.obj();// 43 long l4 = (Long)this.num();// 44 - return (l & (long)i & l2 & l3 & l4) == 0L;// 45 + return (l & i & l2 & l3 & l4) == 0L;// 45 } } } diff --git a/testData/results/pkg/TestRecordPattern3.dec b/testData/results/pkg/TestRecordPattern3.dec index 529e04b395..ba8bbcb6c3 100644 --- a/testData/results/pkg/TestRecordPattern3.dec +++ b/testData/results/pkg/TestRecordPattern3.dec @@ -27,7 +27,7 @@ public class TestRecordPattern3 { double dd = Double.valueOf(var32); boolean var33 = $proxy$bool(bundle); boolean bool = Boolean.valueOf(var33); - System.out.println(a + var21 + var22 + ((double)((long)(i1 + i2 + i3 + i4) + l1 + l2 + (long)c1 + (long)c2 + (long)bb) + dd) + bool);// 11 + System.out.println(a + var21 + var22 + (i1 + i2 + i3 + i4 + l1 + l2 + c1 + c2 + bb + dd) + bool);// 11 } }// 13 diff --git a/testData/results/pkg/TestStackCastParam.dec b/testData/results/pkg/TestStackCastParam.dec index cad0c3f392..2d76de1e67 100644 --- a/testData/results/pkg/TestStackCastParam.dec +++ b/testData/results/pkg/TestStackCastParam.dec @@ -5,8 +5,8 @@ public class TestStackCastParam { public int y; public void test(String s) { - float var10002 = (float)this.x; - get().b.accept(s, var10002, (float)this.y);// 8 + float var10002 = this.x; + get().b.accept(s, var10002, this.y);// 8 }// 9 public static TestStackCastParam.A get() { diff --git a/testData/results/pkg/TestWhileTernary10.dec b/testData/results/pkg/TestWhileTernary10.dec index 5d4ec6f136..b3ef2d2a07 100644 --- a/testData/results/pkg/TestWhileTernary10.dec +++ b/testData/results/pkg/TestWhileTernary10.dec @@ -4,7 +4,7 @@ import java.util.stream.Stream; public class TestWhileTernary10 { public double test(boolean condition, int n, Stream doubles) { - double[] ds = new double[]{(double)n};// 7 + double[] ds = new double[]{n};// 7 for (int i = 0; condition ? i >= n : n >= i; i++) {// 9 for (int j = 0; j < n; j++) {// 10 @@ -20,10 +20,10 @@ public class TestWhileTernary10 { } public double test1(boolean condition, int n, Stream doubles) { - double[] ds = new double[]{(double)n};// 24 + double[] ds = new double[]{n};// 24 for (int i = 0; condition ? i >= n : n >= i; i++) {// 26 - ds[0] += (double)i;// 27 + ds[0] += i;// 27 } doubles.forEach(d -> ds[0] -= d);// 30 @@ -31,7 +31,7 @@ public class TestWhileTernary10 { } public double test2(boolean condition, int n, Stream doubles) { - double[] ds = new double[]{(double)n};// 35 + double[] ds = new double[]{n};// 35 for (int i = 0; condition ? i >= n : n >= i; i++) {// 37 for (int j = 0; j < n; j++) {// 38 diff --git a/testData/src/java8/pkg/TestNumberCasts.java b/testData/src/java8/pkg/TestNumberCasts.java new file mode 100644 index 0000000000..0b111c4504 --- /dev/null +++ b/testData/src/java8/pkg/TestNumberCasts.java @@ -0,0 +1,71 @@ +package pkg; + +public class TestNumberCasts { + private static void b(byte b) { + } + + private static void s(short s) { + } + + private static void i(int i) { + } + + private static void l(long l) { + } + + private static void f(float f) { + } + + private static void d(double d) { + } + + public void test() { + byte b = 127; + b(b); + s(b); + i(b); + l(b); + f(b); + d(b); + + short s = 32767; + b((byte) s); + s(s); + i(s); + l(s); + f(s); + d(s); + + int i = 2147483647; + b((byte) i); + s((short) i); + i(i); + l(i); + f(i); + d(i); + + long l = 9223372036854775807L; + b((byte) l); + s((short) l); + i((int) l); + l(l); + f(l); + d(l); + + float f = 3.4028235E38f; + b((byte) f); + s((short) f); + i((int) f); + l((long) f); + f(f); + d(f); + + double d = 1.7976931348623157E308; + b((byte) d); + s((short) d); + i((int) d); + l((long) d); + f((float) d); + d(d); + } +} diff --git a/testData/src/java8/pkg/TestNumberDisambiguation.java b/testData/src/java8/pkg/TestNumberDisambiguation.java new file mode 100644 index 0000000000..632432551d --- /dev/null +++ b/testData/src/java8/pkg/TestNumberDisambiguation.java @@ -0,0 +1,93 @@ +package pkg; + +public class TestNumberDisambiguation { + public void foo(byte b) { + } + + public void foo(short s) { + } + + public void foo(char c) { + } + + public void foo(int i) { + } + + public void foo(long l) { + } + + public void foo(float f) { + } + + public void foo(double d) { + } + + public void bar(byte a, byte b) { + } + + public void bar(short a, short b) { + } + + public void bar(char a, char b) { + } + + public void bar(int a, int b) { + } + + public void bar(long a, long b) { + } + + public void bar(float a, float b) { + } + + public void bar(double a, double b) { + } + + public void baz(int a, byte b, byte c) { + } + + public void baz(int a, short b, short c) { + } + + public void baz(int a, char b, char c) { + } + + public void baz(int a, int b, int c) { + } + + public void baz(int a, long b, long c) { + } + + public void baz(int a, float b, float c) { + } + + public void baz(int a, double b, double c) { + } + + public void test() { + int i = 24; + foo((byte) i); + foo((short) i); + foo((char) i); + foo(i); + foo((long) i); + foo((float) i); + foo((double) i); + + bar((byte) 0, (byte) i); + bar((short) 0, (short) i); + bar('\u0000', (char) i); + bar(0, i); + bar(0L, i); + bar(0.0F, i); + bar(0.0, i); + + baz(0, (byte) 127, (byte) i); + baz(0, (short) 32767, (short) i); + baz(0, '\uFFFF', (char) i); + baz(0, Integer.MAX_VALUE, i); + baz(0, Long.MAX_VALUE, i); + baz(0, Float.MAX_VALUE, i); + baz(0, Double.MAX_VALUE, i); + } +} From 4c5ebf8ece2053265c05644ae38504f1912b77ed Mon Sep 17 00:00:00 2001 From: Jasmine Karthikeyan <25208576+jaskarth@users.noreply.github.com> Date: Fri, 12 Apr 2024 10:48:52 -0400 Subject: [PATCH 09/25] Move from a fixed thread pool to a fork join pool --- .../java/decompiler/struct/ContextUnit.java | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/struct/ContextUnit.java b/src/org/jetbrains/java/decompiler/struct/ContextUnit.java index 5ddb6029ee..b1fd3b753b 100644 --- a/src/org/jetbrains/java/decompiler/struct/ContextUnit.java +++ b/src/org/jetbrains/java/decompiler/struct/ContextUnit.java @@ -18,10 +18,12 @@ import java.util.LinkedList; import java.util.List; import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Collectors; public class ContextUnit { + private static AtomicInteger THREAD_ID = new AtomicInteger(0); private final IContextSource source; private final boolean own; private final boolean root; @@ -140,9 +142,12 @@ public void save(final Function loader) throws IOException } //Whooo threads! - final List> futures = new LinkedList<>(); - final int threads = Integer.parseInt((String) DecompilerContext.getProperty(IFernflowerPreferences.THREADS)); - final ExecutorService workerExec = Executors.newFixedThreadPool(threads > 0 ? threads : Runtime.getRuntime().availableProcessors()); + List> futures = new ArrayList<>(); + int threads = Integer.parseInt((String) DecompilerContext.getProperty(IFernflowerPreferences.THREADS)); + if (threads <= 0) { + threads = Runtime.getRuntime().availableProcessors(); + } + ForkJoinPool pool = new ForkJoinPool(threads, namingScheme(), null, true); final DecompilerContext rootContext = DecompilerContext.getCurrentContext(); final List toDump = new ArrayList<>(classEntries.size()); @@ -157,7 +162,7 @@ public void save(final Function loader) throws IOException // pre-process for (final ClassContext classCtx : toDump) { - futures.add(workerExec.submit(() -> { + futures.add(pool.submit(() -> { setContext(rootContext); classCtx.ctx = DecompilerContext.getCurrentContext(); try { @@ -182,7 +187,7 @@ public void save(final Function loader) throws IOException continue; } - futures.add(workerExec.submit(() -> { + futures.add(pool.submit(() -> { DecompilerContext.setCurrentContext(classCtx.ctx); classCtx.classContent = decompiledData.getClassContent(classCtx.cl); if (DecompilerContext.getOption(IFernflowerPreferences.BYTECODE_SOURCE_MAPPING)) { @@ -193,7 +198,8 @@ public void save(final Function loader) throws IOException waitForAll(futures); futures.clear(); - workerExec.shutdown(); + pool.shutdown(); + THREAD_ID.set(0); // write to file for (final ClassContext cls : toDump) { @@ -205,6 +211,15 @@ public void save(final Function loader) throws IOException sink.close(); } + private static ForkJoinPool.ForkJoinWorkerThreadFactory namingScheme() { + return pool -> { + ForkJoinWorkerThread thread = new ForkJoinWorkerThread(pool) {}; + thread.setName("Vineflower-DecompilerThread-" + THREAD_ID.getAndIncrement()); + + return thread; + }; + } + public void setContext(DecompilerContext rootContext) { DecompilerContext current = DecompilerContext.getCurrentContext(); if (current == null) { @@ -221,7 +236,9 @@ public void setContext(DecompilerContext rootContext) { } private static void waitForAll(final List> futures) { - for (Future future : futures) { + for (int i = futures.size() - 1; i >= 0; i--) { + Future future = futures.get(i); + try { future.get(); } catch (ExecutionException e) { From ba3328a2c5cf28868e0668014ff882011bd1d4ed Mon Sep 17 00:00:00 2001 From: Muhamad Visat <9150540+mvisat@users.noreply.github.com> Date: Sun, 14 Apr 2024 10:57:08 +0800 Subject: [PATCH 10/25] Add option to exclude classes from decompilation with regex (#370) * add option to exclude classes from decompilation * add @Type annotation * rename into excluded-classes, remove short name --- .../java/decompiler/main/ClassesProcessor.java | 11 +++++++++++ .../main/extern/IFernflowerPreferences.java | 10 ++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java index a5c5c5818b..1fc3c0a1f1 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java @@ -36,6 +36,8 @@ import java.util.*; import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class ClassesProcessor implements CodeConstants { public static final int AVERAGE_CLASS_SIZE = 16 * 1024; @@ -94,8 +96,17 @@ public void loadClasses(IIdentifierRenamer renamer) { boolean bDecompileInner = DecompilerContext.getOption(IFernflowerPreferences.DECOMPILE_INNER); boolean verifyAnonymousClasses = DecompilerContext.getOption(IFernflowerPreferences.VERIFY_ANONYMOUS_CLASSES); + Matcher excludedMatcher = null; + String excludedRegex = DecompilerContext.getProperty(IFernflowerPreferences.EXCLUDED_CLASSES).toString(); + if (!excludedRegex.isEmpty()) { + excludedMatcher = Pattern.compile(excludedRegex).matcher(""); + } + // create class nodes for (StructClass cl : context.getOwnClasses()) { + if (excludedMatcher != null && excludedMatcher.reset(cl.qualifiedName).matches()) { + continue; + } if (!mapRootClasses.containsKey(cl.qualifiedName)) { if (bDecompileInner) { StructInnerClassesAttribute inner = cl.getAttribute(StructGeneralAttribute.ATTRIBUTE_INNER_CLASSES); diff --git a/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java b/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java index b2f4b2acd0..e674a7c31b 100644 --- a/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java +++ b/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java @@ -382,6 +382,11 @@ public interface IFernflowerPreferences { @ShortName("mcs") String MARK_CORRESPONDING_SYNTHETICS = "mark-corresponding-synthetics"; + @Name("Excluded Classes") + @Description("Exclude classes from decompilation if their fully qualified names match the specified regular expression.") + @Type(Type.STRING) + String EXCLUDED_CLASSES = "excluded-classes"; + Map DEFAULTS = getDefaults(); static Map getDefaults() { @@ -452,6 +457,7 @@ static Map getDefaults() { defaults.put(DUMP_TEXT_TOKENS, "0"); defaults.put(REMOVE_IMPORTS, "0"); defaults.put(MARK_CORRESPONDING_SYNTHETICS, "0"); + defaults.put(EXCLUDED_CLASSES, ""); return Collections.unmodifiableMap(defaults); } @@ -475,7 +481,7 @@ static Map getDefaults() { public @interface Description { String value(); } - + @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface DynamicDefaultValue { @@ -504,7 +510,7 @@ static Map getDefaults() { @Target(ElementType.FIELD) public @interface Type { String value(); - + String BOOLEAN = "bool"; String INTEGER = "int"; String STRING = "string"; From b7ed6bd470f35adf2a36467d579bcec16792b815 Mon Sep 17 00:00:00 2001 From: sschr15 Date: Tue, 16 Apr 2024 13:37:30 -0500 Subject: [PATCH 11/25] Kotlin default arguments (#369) * Default arguments in function / constructor declarations * Improve defaults detection and parsing, and add option for unknown defaults * Fix ambiguous wording * Clean up with J12-17 features * Describe in detail what happens to default parameters * Fix cases with 32 or more parameters * Improve wording about default constructors * Clean up imports * Fix problems with long/double parameters --- .../org/vineflower/kotlin/KotlinOptions.java | 13 +- .../kotlin/struct/DefaultArgsMap.java | 153 +++++++ .../kotlin/struct/KConstructor.java | 41 +- .../vineflower/kotlin/struct/KFunction.java | 90 ++-- .../testData/results/pkg/TestDataClass.dec | 389 +++++++++--------- .../testData/results/pkg/TestParams.dec | 4 +- .../results/pkg/TestTailrecFunctions.dec | 6 +- 7 files changed, 467 insertions(+), 229 deletions(-) create mode 100644 plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/DefaultArgsMap.java diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinOptions.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinOptions.java index e1f9154a1b..3f941858f5 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinOptions.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinOptions.java @@ -1,24 +1,27 @@ package org.vineflower.kotlin; import org.jetbrains.java.decompiler.api.plugin.PluginOptions; -import org.jetbrains.java.decompiler.main.DecompilerContext; import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences.*; -import java.util.Map; - public interface KotlinOptions { @Name("Show public visibility") @Description("If a construct is public, show the public keyword") @Type(Type.BOOLEAN) String SHOW_PUBLIC_VISIBILITY = "kt-show-public"; - @Name("Decompile Kotlin") + @Name("Enable Kotlin plugin") @Description("Decompile Kotlin classes as Kotlin instead of Java") @Type(Type.BOOLEAN) - String DECOMPILE_KOTLIN = "kt-decompile-kotlin"; + String DECOMPILE_KOTLIN = "kt-enable"; + + @Name("Unknown default arg string") + @Description("String to use for unknown default arguments, or empty to not indicate unknown defaults") + @Type(Type.STRING) + String UNKNOWN_DEFAULT_ARG_STRING = "kt-unknown-defaults"; static void addDefaults(PluginOptions.AddDefaults cons) { cons.addDefault(SHOW_PUBLIC_VISIBILITY, "1"); cons.addDefault(DECOMPILE_KOTLIN, "1"); + cons.addDefault(UNKNOWN_DEFAULT_ARG_STRING, "..."); } } diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/DefaultArgsMap.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/DefaultArgsMap.java new file mode 100644 index 0000000000..808220857d --- /dev/null +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/DefaultArgsMap.java @@ -0,0 +1,153 @@ +package org.vineflower.kotlin.struct; + +import org.jetbrains.java.decompiler.code.CodeConstants; +import org.jetbrains.java.decompiler.main.DecompilerContext; +import org.jetbrains.java.decompiler.main.rels.MethodWrapper; +import org.jetbrains.java.decompiler.modules.decompiler.exps.*; +import org.jetbrains.java.decompiler.modules.decompiler.flow.DirectGraph; +import org.jetbrains.java.decompiler.modules.decompiler.flow.DirectNode; +import org.jetbrains.java.decompiler.modules.decompiler.stats.IfStatement; +import org.jetbrains.java.decompiler.modules.decompiler.stats.Statement; +import org.jetbrains.java.decompiler.struct.attr.StructLocalVariableTableAttribute; +import org.jetbrains.java.decompiler.struct.gen.VarType; +import org.jetbrains.java.decompiler.util.TextBuffer; +import org.vineflower.kotlin.KotlinOptions; + +import java.util.HashMap; +import java.util.Map; + +public class DefaultArgsMap { + private final Map map; + + private DefaultArgsMap(Map map) { + this.map = map; + } + public static DefaultArgsMap from(MethodWrapper defaults, MethodWrapper calling, KParameter[] params) { + if (defaults == null) { + return new DefaultArgsMap(Map.of()); + } + + /* + * Kotlin's method to define default arguments is a bit odd. The default values are stored in a separate method + * which is called in place of the actual method when defaults are needed. The method containing the defaults + * contains two extra arguments, a bitmask and a value that is always null. The bitmask specifies which arguments + * should be replaced with defaults, and it corresponds one-to-one with all the parameters of the actual method, + * including non-defaulted ones. Constructors follow the same pattern, but the null extra parameter has a type of + * `DefaultConstructorMarker` instead of `Object`, and the default wrappers are true constructors. + * + * In the case of 32 or more parameters, additional bitmask fields are created as needed. + * + * For a method defined as `fun foo(arg1: Int = 42, arg2: String, arg3: Any? = null)`, + * the method containing its default values would look like this: + * + * String foo$default(int arg1, String arg2, Object arg3, int bitmask, Object alwaysNull) { + * if ((bitmask & 0b001) != 0) { + * arg1 = 42; + * } + * + * if ((bitmask & 0b100) != 0) { + * arg3 = null; + * } + * + * return foo(arg1, arg2, arg3); + * } + * + * To parse this, the method graph is traversed, and for each if statement, the condition of the statement is + * checked to see if it matches the pattern Kotlin uses, and the if-true branch is checked to see if it is a + * simple assignment. If both are true, it assumes that the assignment is a default value check and extracts + * the assigned value. + * + * This can get most defaults, but it may fail with very complex defaults, such as a `run` block or other + * inlined blocks. + */ + + Map map = new HashMap<>(); + + int startOfBitmasks = 0; + + if (defaults.methodStruct.hasModifier(CodeConstants.ACC_STATIC) && !calling.methodStruct.hasModifier(CodeConstants.ACC_STATIC)) { + // "this" is passed as an extra parameter to the default method + startOfBitmasks++; + } + + for (VarType var : calling.desc().params) { + startOfBitmasks += var.stackSize; + } + + DirectGraph graph = defaults.getOrBuildGraph(); + for (DirectNode node : graph.nodes) { + Statement statement = node.statement; + if (statement instanceof IfStatement ifStatement) { + Exprent condition = ifStatement.getHeadexprent().getCondition(); + if ( + !(condition instanceof FunctionExprent function) || + !(function.getLstOperands().get(0) instanceof FunctionExprent bitmask) || + bitmask.getLstOperands().size() != 2 + ) { + continue; + } + + Exprent check = bitmask.getLstOperands().get(0); + Exprent mask = bitmask.getLstOperands().get(1); + + if (!(check instanceof VarExprent var) || !(mask instanceof ConstExprent)) { + continue; + } + + int maskValue = ((ConstExprent) mask).getIntValue(); + int maskIndex = (var.getIndex() - startOfBitmasks) * 32; + for (int i = 0; i < 32; i++) { + if ((maskValue & (1 << i)) != 0) { + maskIndex += i; + break; + } + } + + Exprent expr = ifStatement.getIfstat().getExprents().get(0); + if (expr instanceof AssignmentExprent assignment) { + Exprent right = assignment.getRight().copy(); + updateExprent(right, calling); + KParameter param = params[maskIndex]; + map.put(param, right); + } + } + } + + for (KParameter param : params) { + assert map.containsKey(param) == param.flags.declaresDefault : "Parameter " + param.name + " has default value but no default value was found"; + } + + return new DefaultArgsMap(map); + } + + public TextBuffer toJava(KParameter parameter, int indent) { + TextBuffer buffer = new TextBuffer(); + String argString = DecompilerContext.getProperty(KotlinOptions.UNKNOWN_DEFAULT_ARG_STRING).toString(); + + Exprent expr = map.get(parameter); + if (expr == null) { + if (!argString.isEmpty()) { + buffer.append(" = ").append(argString); + } + + return buffer; + } + + buffer.append(" = ").append(expr.toJava(indent)); + + return buffer; + } + + private static void updateExprent(Exprent expr, MethodWrapper calling) { + if (expr instanceof VarExprent varExpr) { + StructLocalVariableTableAttribute attr = calling.methodStruct.getLocalVariableAttr(); + if (attr != null) { + calling.varproc.findLVT(varExpr, 0); + } + } + + for (Exprent child : expr.getAllExprents()) { + updateExprent(child, calling); + } + } +} diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KConstructor.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KConstructor.java index 6143c53eb9..ceefff3807 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KConstructor.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KConstructor.java @@ -36,6 +36,7 @@ public class KConstructor { public final boolean isPrimary; public final MethodWrapper method; + private final DefaultArgsMap defaultArgs; private final ClassesProcessor.ClassNode node; private KConstructor( @@ -43,11 +44,13 @@ private KConstructor( ProtobufFlags.Constructor flags, MethodWrapper method, boolean isPrimary, + DefaultArgsMap defaultArgs, ClassesProcessor.ClassNode node) { this.parameters = parameters; this.flags = flags; this.method = method; this.isPrimary = isPrimary; + this.defaultArgs = defaultArgs; this.node = node; } @@ -89,7 +92,7 @@ public static Data parse(ClassesProcessor.ClassNode node) { if (method == null) { if (classFlags.kind == ProtoBuf.Class.Kind.ANNOTATION_CLASS) { // Annotation classes are very odd and don't actually have a constructor under the hood - KConstructor kConstructor = new KConstructor(parameters, flags, null, false, node); + KConstructor kConstructor = new KConstructor(parameters, flags, null, false, null, node); return new Data(null, kConstructor); } @@ -99,7 +102,17 @@ public static Data parse(ClassesProcessor.ClassNode node) { boolean isPrimary = !flags.isSecondary; - KConstructor kConstructor = new KConstructor(parameters, flags, method, isPrimary, node); + StringBuilder defaultArgsDesc = new StringBuilder("("); + for (KParameter parameter : parameters) { + defaultArgsDesc.append(parameter.type); + } + + defaultArgsDesc.append("I".repeat(parameters.length / 32 + 1)); + defaultArgsDesc.append("Lkotlin/jvm/internal/DefaultConstructorMarker;)V"); + + DefaultArgsMap defaultArgs = DefaultArgsMap.from(wrapper.getMethodWrapper("", defaultArgsDesc.toString()), method, parameters); + + KConstructor kConstructor = new KConstructor(parameters, flags, method, isPrimary, defaultArgs, node); constructors.put(method.methodStruct, kConstructor); if (isPrimary) { @@ -118,6 +131,8 @@ public boolean stringify(TextBuffer buffer, int indent) { TextBuffer buf = new TextBuffer(); RootStatement root = method.root; + String methodKey = InterpreterUtil.makeUniqueKey(method.methodStruct.getName(), method.methodStruct.getDescriptor()); + if (!isPrimary) { if (flags.hasAnnotations) { KotlinWriter.appendAnnotations(buf, indent, method.methodStruct, TypeAnnotation.METHOD_RETURN_TYPE); @@ -143,6 +158,10 @@ public boolean stringify(TextBuffer buffer, int indent) { first = false; parameter.stringify(indent + 1, buf); + + if (parameter.flags.declaresDefault) { + buf.append(" = ").append(defaultArgs.toJava(parameter, indent + 1), node.classStruct.qualifiedName, methodKey); + } } buf.appendPossibleNewline("", true).popNewlineGroup(); @@ -165,8 +184,7 @@ public boolean stringify(TextBuffer buffer, int indent) { } else { buf.append(": "); - InvocationExprent invocation = (InvocationExprent) firstExpr; - buf.append(invocation.toJava(indent + 1), node.classStruct.qualifiedName, InterpreterUtil.makeUniqueKey(method.methodStruct.getName(), method.methodStruct.getDescriptor())); + buf.append(firstExpr.toJava(indent + 1), node.classStruct.qualifiedName, methodKey); method.getOrBuildGraph().first.exprents.remove(0); } @@ -189,8 +207,7 @@ public boolean stringify(TextBuffer buffer, int indent) { TextBuffer body = root.toJava(indent + 1); body.addBytecodeMapping(root.getDummyExit().bytecode); - StructMethod mt = method.methodStruct; - buf.append(body, node.classStruct.qualifiedName, InterpreterUtil.makeUniqueKey(mt.getName(), mt.getDescriptor())); + buf.append(body, node.classStruct.qualifiedName, methodKey); buf.appendIndent(indent).append("}").appendLineSeparator(); @@ -204,6 +221,8 @@ public boolean writePrimaryConstructor(TextBuffer buffer, int indent) { TextBuffer buf = new TextBuffer(); boolean appended = false; + String methodKey = InterpreterUtil.makeUniqueKey(method.methodStruct.getName(), method.methodStruct.getDescriptor()); + if (flags.hasAnnotations) { buf.append(" "); // -1 for indent indicates inline @@ -235,12 +254,15 @@ public boolean writePrimaryConstructor(TextBuffer buffer, int indent) { first = false; parameter.stringify(indent + 1, buf); + + if (parameter.flags.declaresDefault) { + buf.append(" = ").append(defaultArgs.toJava(parameter, indent + 1), node.classStruct.qualifiedName, methodKey); + } } buf.appendPossibleNewline("", true).popNewlineGroup().append(")"); } - RootStatement root = method.root; if (method.getOrBuildGraph().first.exprents.isEmpty()) { // No ability to declare super constructor call buffer.append(buf); @@ -248,14 +270,13 @@ public boolean writePrimaryConstructor(TextBuffer buffer, int indent) { } Exprent firstExpr = method.getOrBuildGraph().first.exprents.get(0); - if (!(firstExpr instanceof InvocationExprent) || !((InvocationExprent) firstExpr).getName().equals("")) { + if (!(firstExpr instanceof InvocationExprent invocation) || !invocation.getName().equals("")) { // no detected super constructor call buffer.append(buf); return false; // throw new IllegalStateException("First expression of constructor is not InvocationExprent"); } - InvocationExprent invocation = (InvocationExprent) firstExpr; if (invocation.getClassname().equals("java/lang/Object")) { // No need to declare super constructor call buffer.append(buf); @@ -278,7 +299,7 @@ public boolean writePrimaryConstructor(TextBuffer buffer, int indent) { method.getOrBuildGraph().first.exprents.remove(0); - buffer.append(buf, node.classStruct.qualifiedName, InterpreterUtil.makeUniqueKey(method.methodStruct.getName(), method.methodStruct.getDescriptor())); + buffer.append(buf, node.classStruct.qualifiedName, methodKey); return true; } diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KFunction.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KFunction.java index dd481661b9..944868065c 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KFunction.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KFunction.java @@ -2,7 +2,9 @@ import kotlinx.metadata.internal.metadata.ProtoBuf; import kotlinx.metadata.internal.metadata.jvm.JvmProtoBuf; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jetbrains.java.decompiler.code.CodeConstants; import org.jetbrains.java.decompiler.main.ClassesProcessor; import org.jetbrains.java.decompiler.main.DecompilerContext; import org.jetbrains.java.decompiler.main.extern.IFernflowerLogger; @@ -26,7 +28,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Function; import java.util.stream.Collectors; public class KFunction { @@ -47,6 +48,9 @@ public class KFunction { public final boolean knownOverride; + @NotNull + private final DefaultArgsMap defaultArgs; + private final ClassesProcessor.ClassNode node; private KFunction( @@ -59,6 +63,7 @@ private KFunction( @Nullable KType receiverType, @Nullable KContract contract, boolean knownOverride, + @NotNull DefaultArgsMap defaultArgs, ClassesProcessor.ClassNode node) { this.name = name; this.parameters = parameters; @@ -70,6 +75,7 @@ private KFunction( this.receiverType = receiverType; this.contract = contract; this.knownOverride = knownOverride; + this.defaultArgs = defaultArgs; this.node = node; } @@ -83,23 +89,12 @@ public static Map parse(ClassesProcessor.ClassNode node KotlinDecompilationContext.KotlinType type = KotlinDecompilationContext.getCurrentType(); if (type == null) return Map.of(); - switch (type) { - case CLASS: - protoFunctions = KotlinDecompilationContext.getCurrentClass().getFunctionList(); - break; - case FILE: - protoFunctions = KotlinDecompilationContext.getFilePackage().getFunctionList(); - break; - case MULTIFILE_CLASS: - protoFunctions = KotlinDecompilationContext.getMultifilePackage().getFunctionList(); - break; - case SYNTHETIC_CLASS: - // indicating lambdas and such - protoFunctions = Collections.singletonList(KotlinDecompilationContext.getSyntheticClass()); - break; - default: - throw new IllegalStateException("Unexpected value: " + type); - } + protoFunctions = switch (type) { + case CLASS -> KotlinDecompilationContext.getCurrentClass().getFunctionList(); + case FILE -> KotlinDecompilationContext.getFilePackage().getFunctionList(); + case MULTIFILE_CLASS -> KotlinDecompilationContext.getMultifilePackage().getFunctionList(); + case SYNTHETIC_CLASS -> Collections.singletonList(KotlinDecompilationContext.getSyntheticClass()); // Lambdas and similar + }; Map functions = new HashMap<>(protoFunctions.size(), 1f); @@ -145,7 +140,6 @@ public static Map parse(ClassesProcessor.ClassNode node desc.append(parameter.type); } - int endOfParams = desc.length(); desc.append(")").append(returnType); method = wrapper.getMethodWrapper(lookupName, desc.toString()); @@ -163,6 +157,35 @@ public static Map parse(ClassesProcessor.ClassNode node .map(ctxType -> KType.from(ctxType, resolver)) .collect(Collectors.toList()); + boolean isStatic = (method.methodStruct.getAccessFlags() & CodeConstants.ACC_STATIC) != 0; + String defaultArgsName = name + "$default"; + StringBuilder defaultArgsDesc = new StringBuilder("("); + if (!isStatic) { + defaultArgsDesc.append("L").append(struct.qualifiedName).append(";"); + } + if (receiverType != null) { + defaultArgsDesc.append(receiverType); + } + for (KParameter parameter : parameters) { + if (parameter.type.typeParameterName != null) { + typeParameters.stream() + .filter(typeParameter -> typeParameter.name.equals(parameter.type.typeParameterName)) + .findAny() + .map(typeParameter -> typeParameter.upperBounds) + .filter(bounds -> bounds.size() == 1) + .map(bounds -> bounds.get(0)) + .ifPresentOrElse(defaultArgsDesc::append, () -> defaultArgsDesc.append("Ljava/lang/Object;")); + } else { + defaultArgsDesc.append(parameter.type); + } + } + + defaultArgsDesc.append("I".repeat(parameters.length / 32 + 1)); + defaultArgsDesc.append("Ljava/lang/Object;)"); + defaultArgsDesc.append(returnType); + + DefaultArgsMap defaultArgs = DefaultArgsMap.from(wrapper.getMethodWrapper(defaultArgsName, defaultArgsDesc.toString()), method, parameters); + boolean knownOverride = flags.visibility != ProtoBuf.Visibility.PRIVATE && flags.visibility != ProtoBuf.Visibility.PRIVATE_TO_THIS && flags.visibility != ProtoBuf.Visibility.LOCAL @@ -170,7 +193,22 @@ public static Map parse(ClassesProcessor.ClassNode node KContract contract = function.hasContract() ? KContract.from(function.getContract(), List.of(parameters), resolver) : null; - functions.put(method.methodStruct, new KFunction(name, parameters, typeParameters, returnType, flags, contextReceiverTypes, method, receiverType, contract, knownOverride, node)); + KFunction kFunction = new KFunction( + name, + parameters, + typeParameters, + returnType, + flags, + contextReceiverTypes, + method, + receiverType, + contract, + knownOverride, + defaultArgs, + node + ); + + functions.put(method.methodStruct, kFunction); } return functions; @@ -181,6 +219,8 @@ public TextBuffer stringify(int indent) { KotlinWriter.appendAnnotations(buf, indent, method.methodStruct, TypeAnnotation.METHOD_RETURN_TYPE); KotlinWriter.appendJvmAnnotations(buf, indent, method.methodStruct, false, method.classStruct.getPool(), TypeAnnotation.METHOD_RETURN_TYPE); + String methodKey = InterpreterUtil.makeUniqueKey(method.methodStruct.getName(), method.methodStruct.getDescriptor()); + buf.appendIndent(indent); if (!contextReceiverTypes.isEmpty()) { @@ -244,10 +284,7 @@ public TextBuffer stringify(int indent) { List complexTypeParams = typeParameters.stream() .filter(typeParameter -> typeParameter.upperBounds.size() > 1) - .collect(Collectors.toList()); - - Map typeParamsById = typeParameters.stream() - .collect(Collectors.toMap(typeParameter -> typeParameter.id, Function.identity())); + .toList(); if (!typeParameters.isEmpty()) { buf.append('<'); @@ -301,6 +338,9 @@ public TextBuffer stringify(int indent) { first = false; parameter.stringify(indent + 1, buf); + if (parameter.flags.declaresDefault) { + buf.append(defaultArgs.toJava(parameter, indent + 1), node.classStruct.qualifiedName, methodKey); + } } buf.appendPossibleNewline("", true) @@ -353,7 +393,7 @@ public TextBuffer stringify(int indent) { buf.appendLineSeparator(); } - buf.append(body, node.classStruct.qualifiedName, InterpreterUtil.makeUniqueKey(method.methodStruct.getName(), method.methodStruct.getDescriptor())); + buf.append(body, node.classStruct.qualifiedName, methodKey); } catch (Throwable t) { String message = "Method " + method.methodStruct.getName() + " " + method.desc() + " in class " + node.classStruct.qualifiedName + " couldn't be written."; DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN, t); diff --git a/plugins/kotlin/testData/results/pkg/TestDataClass.dec b/plugins/kotlin/testData/results/pkg/TestDataClass.dec index 29e6c123f9..fefb45b08c 100644 --- a/plugins/kotlin/testData/results/pkg/TestDataClass.dec +++ b/plugins/kotlin/testData/results/pkg/TestDataClass.dec @@ -29,7 +29,12 @@ data class TestDataClass(dataClassVal: Regex, variableWithVeryLongName: Int, req return this.nullability; } - public fun copy(dataClassVal: Regex, variableWithVeryLongName: Int, requestLineWrapsIfTheParamListIsTooLong: List, nullability: String?): TestDataClass { + public fun copy( + dataClassVal: Regex = this.dataClassVal, + variableWithVeryLongName: Int = this.variableWithVeryLongName, + requestLineWrapsIfTheParamListIsTooLong: List = this.requestLineWrapsIfTheParamListIsTooLong, + nullability: String? = this.nullability + ): TestDataClass { return new TestDataClass(dataClassVal, variableWithVeryLongName, requestLineWrapsIfTheParamListIsTooLong, nullability); } @@ -155,202 +160,216 @@ class 'pkg/TestDataClass' { } method 'copy (Lkotlin/text/Regex;ILjava/util/List;Ljava/lang/String;)Lpkg/TestDataClass;' { - 10 32 - 11 32 - 12 32 - 13 32 - 14 32 - 18 32 + 7 32 + 8 32 + 9 32 + a 32 + 10 37 + 11 37 + 12 37 + 13 33 + 14 33 + 15 33 + 16 33 + 18 37 + 1f 34 + 20 34 + 21 34 + 22 34 + 2c 35 + 2d 35 + 2e 35 + 2f 35 } method 'copy$default (Lpkg/TestDataClass;Lkotlin/text/Regex;ILjava/util/List;Ljava/lang/String;ILjava/lang/Object;)Lpkg/TestDataClass;' { - 0 38 - 1 38 - 2 38 - 3 38 - 4 38 - 7 39 - 8 39 - 9 39 - a 39 - b 39 - c 42 - d 42 - e 42 - f 42 - 10 42 - 13 43 - 14 43 - 15 43 - 16 43 - 17 43 - 18 46 - 19 46 - 1a 46 - 1b 46 - 1c 46 - 1f 47 - 20 47 - 21 47 - 22 47 - 23 47 - 24 50 - 25 50 - 26 50 - 27 50 - 28 50 - 29 50 - 2c 51 - 2d 51 - 2e 51 - 2f 51 - 30 51 - 31 51 - 32 54 - 33 54 - 34 54 - 35 54 - 36 54 - 37 54 - 38 54 - 39 54 - 3a 54 - 3b 54 + 0 43 + 1 43 + 2 43 + 3 43 + 4 43 + 7 44 + 8 44 + 9 44 + a 44 + b 44 + c 47 + d 47 + e 47 + f 47 + 10 47 + 13 48 + 14 48 + 15 48 + 16 48 + 17 48 + 18 51 + 19 51 + 1a 51 + 1b 51 + 1c 51 + 1f 52 + 20 52 + 21 52 + 22 52 + 23 52 + 24 55 + 25 55 + 26 55 + 27 55 + 28 55 + 29 55 + 2c 56 + 2d 56 + 2e 56 + 2f 56 + 30 56 + 31 56 + 32 59 + 33 59 + 34 59 + 35 59 + 36 59 + 37 59 + 38 59 + 39 59 + 3a 59 + 3b 59 } method 'toString ()Ljava/lang/String;' { - 0 59 - 1 59 - 2 59 - 3 59 - 4 61 - 5 61 - 6 61 - 7 61 - 8 63 - 9 63 - a 63 - b 63 - c 65 - d 65 - e 65 - f 65 - 10 58 - 11 58 - 12 58 - 13 58 - 14 58 - 15 58 + 0 64 + 1 64 + 2 64 + 3 64 + 4 66 + 5 66 + 6 66 + 7 66 + 8 68 + 9 68 + a 68 + b 68 + c 70 + d 70 + e 70 + f 70 + 10 63 + 11 63 + 12 63 + 13 63 + 14 63 + 15 63 } method 'hashCode ()I' { - 0 71 - 1 71 - 2 71 - 3 71 - 4 71 - 5 71 - 6 71 - 8 71 - 9 71 - a 71 - b 71 - c 71 - d 71 - e 71 - f 71 - 10 71 - 11 71 - 12 71 - 13 71 - 15 71 - 16 71 - 17 71 - 18 71 - 19 72 - 1a 72 - 1b 72 - 1c 72 - 1d 72 - 1e 72 - 1f 72 - 20 71 - 22 71 - 23 74 - 24 74 - 25 70 - 26 75 - 27 75 - 28 75 - 29 75 - 2a 75 - 2d 75 - 31 75 - 32 75 - 33 75 - 34 75 - 35 75 - 38 70 - 3b 70 + 0 76 + 1 76 + 2 76 + 3 76 + 4 76 + 5 76 + 6 76 + 8 76 + 9 76 + a 76 + b 76 + c 76 + d 76 + e 76 + f 76 + 10 76 + 11 76 + 12 76 + 13 76 + 15 76 + 16 76 + 17 76 + 18 76 + 19 77 + 1a 77 + 1b 77 + 1c 77 + 1d 77 + 1e 77 + 1f 77 + 20 76 + 22 76 + 23 79 + 24 79 + 25 75 + 26 80 + 27 80 + 28 80 + 29 80 + 2a 80 + 2d 80 + 31 80 + 32 80 + 33 80 + 34 80 + 35 80 + 38 75 + 3b 75 } method 'equals (Ljava/lang/Object;)Z' { - 0 79 - 1 79 - 2 79 - 5 80 - 6 80 - 7 81 - b 81 - e 82 - f 82 - 10 84 - 11 84 - 12 84 - 13 84 - 14 84 - 15 85 - 16 85 - 17 85 - 18 85 - 19 85 - 1a 85 - 1b 85 - 1c 85 - 20 85 - 23 86 - 24 86 - 25 87 - 26 87 - 27 87 - 28 87 - 29 87 - 2a 87 - 2b 87 - 2c 87 - 2d 87 - 30 88 - 31 88 - 32 89 - 33 89 - 34 89 - 35 89 - 36 89 - 37 89 - 38 89 - 39 89 - 3d 89 - 40 90 - 41 90 - 42 92 - 43 92 - 44 92 - 45 92 - 46 92 - 47 92 - 48 92 - 49 92 - 4d 92 + 0 84 + 1 84 + 2 84 + 5 85 + 6 85 + 7 86 + b 86 + e 87 + f 87 + 10 89 + 11 89 + 12 89 + 13 89 + 14 89 + 15 90 + 16 90 + 17 90 + 18 90 + 19 90 + 1a 90 + 1b 90 + 1c 90 + 20 90 + 23 91 + 24 91 + 25 92 + 26 92 + 27 92 + 28 92 + 29 92 + 2a 92 + 2b 92 + 2c 92 + 2d 92 + 30 93 + 31 93 + 32 94 + 33 94 + 34 94 + 35 94 + 36 94 + 37 94 + 38 94 + 39 94 + 3d 94 + 40 95 + 41 95 + 42 97 + 43 97 + 44 97 + 45 97 + 46 97 + 47 97 + 48 97 + 49 97 + 4d 97 } } diff --git a/plugins/kotlin/testData/results/pkg/TestParams.dec b/plugins/kotlin/testData/results/pkg/TestParams.dec index d35e235e6b..654a2a9198 100644 --- a/plugins/kotlin/testData/results/pkg/TestParams.dec +++ b/plugins/kotlin/testData/results/pkg/TestParams.dec @@ -17,7 +17,7 @@ class TestParams { return x * y;// 15 } - public fun printMessageWithPrefix(message: String, prefix: String) { + public fun printMessageWithPrefix(message: String, prefix: String = "Info") { System.out.println("[" + prefix + "] " + message);// 19 }// 20 @@ -75,6 +75,8 @@ class 'pkg/TestParams' { } method 'printMessageWithPrefix (Ljava/lang/String;Ljava/lang/String;)V' { + 6 19 + 7 19 c 20 d 20 e 20 diff --git a/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec b/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec index 4335d2ebed..1fad0317a2 100644 --- a/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec +++ b/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec @@ -68,7 +68,7 @@ class TestTailrecFunctions { } } - public tailrec fun fastPow(x: Long, n: Long, acc: Long): Long { + public tailrec fun fastPow(x: Long, n: Long, acc: Long = 1L): Long { var var7: TestTailrecFunctions = this; var var8: Long = x; var var10: Long = n; @@ -251,7 +251,7 @@ class 'pkg/TestTailrecFunctions' { 4 72 5 72 6 73 - 7 73 + 7 70 8 73 9 74 a 74 @@ -469,4 +469,4 @@ Not mapped: 26 34 38 -40 \ No newline at end of file +40 From 43e6f4db47bbd94232132c3b29b80e9ff2ac7d91 Mon Sep 17 00:00:00 2001 From: coehlrich Date: Fri, 19 Apr 2024 12:32:41 +1200 Subject: [PATCH 12/25] Fix 2 constructors of an inner class with 1 calling another (#375) --- .../main/rels/NestedClassProcessor.java | 36 +++++++---- .../java/decompiler/SingleClassesTest.java | 1 + testData/results/pkg/TestInnerClasses3J21.dec | 64 +++++++++++++++++++ .../src/java21/pkg/TestInnerClasses3J21.java | 20 ++++++ 4 files changed, 108 insertions(+), 13 deletions(-) create mode 100644 testData/results/pkg/TestInnerClasses3J21.dec create mode 100644 testData/src/java21/pkg/TestInnerClasses3J21.java diff --git a/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java b/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java index 6670dc6921..9e5329c32f 100644 --- a/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java @@ -37,6 +37,7 @@ import org.jetbrains.java.decompiler.struct.gen.generics.GenericType; import org.jetbrains.java.decompiler.util.DotExporter; import org.jetbrains.java.decompiler.util.InterpreterUtil; +import org.jetbrains.java.decompiler.util.Pair; import java.util.*; import java.util.Map.Entry; @@ -384,7 +385,7 @@ private static void computeLocalVarsAndDefinitions(ClassNode node) { // FIXME: flags of variables are wrong! Correct the entire functionality. // if(method.varproc.getVarFinal(varPair) != VarTypeProcessor.VAR_NON_FINAL) { - pair = new VarFieldPair(mask.get(i).fieldKey, varPair); + pair = new VarFieldPair(mask.get(i).fieldKey, varPair, mask.get(i).assigned); // } } @@ -467,7 +468,7 @@ private static void computeLocalVarsAndDefinitions(ClassNode node) { mergeListSignatures(interPairMask, interMask, true); for (VarFieldPair pair : interPairMask) { - if (pair != null && !pair.fieldKey.isEmpty()) { + if (pair != null && !pair.fieldKey.isEmpty() && pair.assigned) { nestedNode.mapFieldsToVars.put(pair.fieldKey, pair.varPair); } } @@ -743,12 +744,12 @@ private static Map> getMaskLocalVars(ClassWrapper wra int varIndex = 1; for (int i = 0; i < md.params.length; i++) { // no static methods allowed // Always assume we can use the heuristic if there's only one metho - String keyField = getEnclosingVarField(cl, method, graph, varIndex, i, p == 1 || cl.getMethods().size() == 1); - if (!keyField.isEmpty()) { + Pair keyField = getEnclosingVarField(cl, method, graph, varIndex, i, p == 1 || cl.getMethods().size() == 1); + if (!keyField.a.isEmpty()) { found = true; } - fields.add(keyField == null ? null : new VarFieldPair(keyField, new VarVersionPair(-1, 0))); // TODO: null? + fields.add(keyField == null ? null : new VarFieldPair(keyField.a, new VarVersionPair(-1, 0), keyField.b)); // TODO: null? varIndex += md.params[i].stackSize; } @@ -765,8 +766,9 @@ private static Map> getMaskLocalVars(ClassWrapper wra return mapMasks; } - private static String getEnclosingVarField(StructClass cl, MethodWrapper method, DirectGraph graph, int index, int outerIdx, boolean useHeuristic) { + private static Pair getEnclosingVarField(StructClass cl, MethodWrapper method, DirectGraph graph, int index, int outerIdx, boolean useHeuristic) { String field = ""; + boolean assigned = false; // parameter variable final VarVersionPair var = new VarVersionPair(index, 0); @@ -793,6 +795,7 @@ private static String getEnclosingVarField(StructClass cl, MethodWrapper method, (fd.isSynthetic() || noSynthFlag && possiblySyntheticField(fd))) { // local (== not inherited) field field = InterpreterUtil.makeUniqueKey(left.getName(), left.getDescriptor().descriptorString); + assigned = true; break; } } @@ -812,6 +815,7 @@ private static String getEnclosingVarField(StructClass cl, MethodWrapper method, String name = method.varproc.getVarName(var); VarType type = method.varproc.getVarType(var); field = InterpreterUtil.makeUniqueKey(name, type.toString()); + assigned = false; } } } @@ -827,6 +831,7 @@ private static String getEnclosingVarField(StructClass cl, MethodWrapper method, VarType type = method.varproc.getVarType(var); if (hostName.equals(type.value) && useHeuristic) { field = InterpreterUtil.makeUniqueKey(name, type.toString()); + assigned = false; } else { // Also check the enclosing class if it's anonymous ClassNode nd = DecompilerContext.getClassProcessor().getMapRootClasses().get(cl.qualifiedName); @@ -835,6 +840,7 @@ private static String getEnclosingVarField(StructClass cl, MethodWrapper method, for (String clazz : nd.enclosingClasses) { if (clazz.equals(type.value)) { field = InterpreterUtil.makeUniqueKey(name, type.toString()); + assigned = false; break; } } @@ -843,7 +849,7 @@ private static String getEnclosingVarField(StructClass cl, MethodWrapper method, } } - return field; + return Pair.of(field, assigned); } private static boolean possiblySyntheticField(StructField fd) { @@ -922,12 +928,14 @@ private static boolean isEqual(boolean both, VarFieldPair fObj, VarFieldPair sOb } else { eq = true; - if (fObj.fieldKey.length() == 0) { + if (!fObj.assigned || fObj.fieldKey.length() == 0) { fObj.fieldKey = sObj.fieldKey; + fObj.assigned = sObj.assigned; } - else if (sObj.fieldKey.length() == 0) { + else if (!sObj.assigned || sObj.fieldKey.length() == 0) { if (both) { sObj.fieldKey = fObj.fieldKey; + sObj.assigned = fObj.assigned; } } else { @@ -1147,10 +1155,12 @@ private static boolean containsType(VarType haystack, VarType needle) { private static class VarFieldPair { public String fieldKey; public VarVersionPair varPair; + public boolean assigned; - VarFieldPair(String field, VarVersionPair varPair) { + VarFieldPair(String field, VarVersionPair varPair, boolean assigned) { this.fieldKey = field; this.varPair = varPair; + this.assigned = assigned; } @Override @@ -1159,17 +1169,17 @@ public boolean equals(Object o) { if (!(o instanceof VarFieldPair)) return false; VarFieldPair pair = (VarFieldPair)o; - return fieldKey.equals(pair.fieldKey) && varPair.equals(pair.varPair); + return fieldKey.equals(pair.fieldKey) && varPair.equals(pair.varPair) && assigned == pair.assigned; } @Override public int hashCode() { - return fieldKey.hashCode() + varPair.hashCode(); + return fieldKey.hashCode() + varPair.hashCode() + Boolean.hashCode(assigned); } @Override public String toString() { - return varPair + ": " + fieldKey; + return varPair + (assigned ? " assigned to " : " stored in variable ") + fieldKey; } } diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index abfaac27ff..86e29fd502 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -699,6 +699,7 @@ private void registerDefault() { register(JAVA_21, "TestSwitchOnEnumJ21", "ext/TestEnum2"); register(JAVA_21, "TestInnerClassesJ21"); register(JAVA_21, "TestInnerClasses2J21"); + register(JAVA_21, "TestInnerClasses3J21"); register(JAVA_8, "TestInnerClassesJ8"); register(JAVA_8, "TestSwitchInTry"); } diff --git a/testData/results/pkg/TestInnerClasses3J21.dec b/testData/results/pkg/TestInnerClasses3J21.dec new file mode 100644 index 0000000000..204d7edf1f --- /dev/null +++ b/testData/results/pkg/TestInnerClasses3J21.dec @@ -0,0 +1,64 @@ +package pkg; + +public class TestInnerClasses3J21 { + private int i = 0; + + private class Inner { + private int j; + + Inner() { + this(0);// 9 + }// 10 + + Inner(int i) { + this.j = i;// 13 + }// 14 + + private void setI() { + TestInnerClasses3J21.this.i = this.j;// 17 + }// 18 + } +} + +class 'pkg/TestInnerClasses3J21$Inner' { + method ' (Lpkg/TestInnerClasses3J21;)V' { + 2 9 + 3 9 + 4 9 + 5 9 + 6 10 + } + + method ' (Lpkg/TestInnerClasses3J21;I)V' { + 9 13 + a 13 + b 13 + c 13 + d 13 + e 14 + } + + method 'setI ()V' { + 1 17 + 2 17 + 3 17 + 4 17 + 5 17 + 6 17 + 7 17 + 8 17 + 9 17 + a 17 + b 18 + } +} + +Lines mapping: +9 <-> 10 +10 <-> 11 +13 <-> 14 +14 <-> 15 +17 <-> 18 +18 <-> 19 +Not mapped: +12 diff --git a/testData/src/java21/pkg/TestInnerClasses3J21.java b/testData/src/java21/pkg/TestInnerClasses3J21.java new file mode 100644 index 0000000000..98690a3225 --- /dev/null +++ b/testData/src/java21/pkg/TestInnerClasses3J21.java @@ -0,0 +1,20 @@ +package pkg; + +public class TestInnerClasses3J21 { + private int i = 0; + + private class Inner { + private int j; + Inner() { + this(0); + } + + Inner(int i) { + this.j = i; + } + + private void setI() { + TestInnerClasses3J21.this.i = j; + } + } +} From 6fcd3017d9e1ef4db57850460b2dac401fd1782c Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 19 Apr 2024 06:17:54 -0700 Subject: [PATCH 13/25] Fix weird indent when inlined simple lambdas return something that takes up multiple lines before reformatting (like an anonymous class instantiation) (#379) --- .../java/decompiler/main/ClassWriter.java | 2 +- testData/results/pkg/TestDoubleNestedClass.dec | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index 8fdcc90d16..c5444053bc 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -284,7 +284,7 @@ public void classLambdaToJava(ClassNode node, TextBuffer buffer, Exprent method_ MethodWrapper outerWrapper = (MethodWrapper)DecompilerContext.getContextProperty(DecompilerContext.CURRENT_METHOD_WRAPPER); DecompilerContext.setProperty(DecompilerContext.CURRENT_METHOD_WRAPPER, methodWrapper); try { - TextBuffer codeBuffer = firstExpr.toJava(indent + 1); + TextBuffer codeBuffer = firstExpr.toJava(indent); if (firstExpr instanceof ExitExprent) codeBuffer.setStart(6); // skip return diff --git a/testData/results/pkg/TestDoubleNestedClass.dec b/testData/results/pkg/TestDoubleNestedClass.dec index de767178f7..1145546598 100644 --- a/testData/results/pkg/TestDoubleNestedClass.dec +++ b/testData/results/pkg/TestDoubleNestedClass.dec @@ -33,13 +33,13 @@ public abstract class TestDoubleNestedClass { Supplier foo(int var1) { byte var2 = 10; return () -> new TestDoubleNestedClass() { - @Override - Object test() { - int var1x = Child1.this.x + var1; - int var2x = var1 + var2; - return Child1.this.x + var1x + var2x; - } - }; + @Override + Object test() { + int var1x = Child1.this.x + var1; + int var2x = var1 + var2; + return Child1.this.x + var1x + var2x; + } + }; } } } From 8ed3c2f83eeccc08679c84929d10c35b0a6e890e Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 19 Apr 2024 06:18:32 -0700 Subject: [PATCH 14/25] Inline empty lambda bodies to `{}` when simple lambda inlining enabled (#380) --- src/org/jetbrains/java/decompiler/main/ClassWriter.java | 3 +++ test/org/jetbrains/java/decompiler/SingleClassesTest.java | 1 + testData/results/pkg/TestEmptyLambda.dec | 6 ++++++ testData/src/java8/pkg/TestEmptyLambda.java | 5 +++++ 4 files changed, 15 insertions(+) create mode 100644 testData/results/pkg/TestEmptyLambda.dec create mode 100644 testData/src/java8/pkg/TestEmptyLambda.java diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index c5444053bc..a428d0d039 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -308,6 +308,9 @@ public void classLambdaToJava(ClassNode node, TextBuffer buffer, Exprent method_ DecompilerContext.setProperty(DecompilerContext.CURRENT_METHOD_WRAPPER, outerWrapper); } } + } else if (firstStat instanceof BasicBlockStatement && firstStat.getExprents() != null && firstStat.getExprents().isEmpty()) { + buffer.append(" {}"); + simpleLambda = true; } } } diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index 86e29fd502..0dba1d9375 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -794,6 +794,7 @@ private void registerJavaRuntime() { register(JAVA_8, "TestInstanceGeneric"); // TODO: wrong cast in lambda for array register(JAVA_8, "TestArrayGenerics"); + register(JAVA_8, "TestEmptyLambda"); } private void registerLiterals() { diff --git a/testData/results/pkg/TestEmptyLambda.dec b/testData/results/pkg/TestEmptyLambda.dec new file mode 100644 index 0000000000..26564e0901 --- /dev/null +++ b/testData/results/pkg/TestEmptyLambda.dec @@ -0,0 +1,6 @@ +package pkg; + +public class TestEmptyLambda { + public static final Runnable EMPTY_LAMBDA = () -> {}; +} + diff --git a/testData/src/java8/pkg/TestEmptyLambda.java b/testData/src/java8/pkg/TestEmptyLambda.java new file mode 100644 index 0000000000..ef0548592f --- /dev/null +++ b/testData/src/java8/pkg/TestEmptyLambda.java @@ -0,0 +1,5 @@ +package pkg; + +public class TestEmptyLambda { + public static final Runnable EMPTY_LAMBDA = () -> {}; +} From 786d566de7a13d0e0e8a9fde3b9104be1a247284 Mon Sep 17 00:00:00 2001 From: sschr15 Date: Fri, 19 Apr 2024 08:23:33 -0500 Subject: [PATCH 15/25] Update to J17 features + fix ctor default params (#376) --- .../org/vineflower/kotlin/KotlinWriter.java | 139 +++++----------- .../kotlin/expr/KAnnotationExprent.java | 28 ++-- .../kotlin/expr/KFunctionExprent.java | 133 ++++++++-------- .../kotlin/metadata/MetadataNameResolver.java | 15 +- .../kotlin/pass/EliminateDeadVarsPass.java | 11 +- .../vineflower/kotlin/pass/KMergePass.java | 47 ++---- .../kotlin/pass/ReplaceExprentsPass.java | 2 +- .../kotlin/struct/DefaultArgsMap.java | 11 +- .../kotlin/struct/KConstructor.java | 51 ++---- .../vineflower/kotlin/struct/KContract.java | 47 ++---- .../vineflower/kotlin/struct/KFunction.java | 88 +++-------- .../vineflower/kotlin/struct/KParameter.java | 16 +- .../vineflower/kotlin/struct/KProperty.java | 148 ++++++------------ .../kotlin/struct/KPropertyAccessor.java | 10 +- .../org/vineflower/kotlin/struct/KType.java | 48 ++---- .../kotlin/struct/KTypeParameter.java | 27 +--- .../org/vineflower/kotlin/util/KTypes.java | 60 +++---- .../org/vineflower/kotlin/util/KUtils.java | 9 ++ .../vineflower/kotlin/util/ProtobufFlags.java | 34 ++-- 19 files changed, 315 insertions(+), 609 deletions(-) diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinWriter.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinWriter.java index e5558e0f0e..f683d79202 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinWriter.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinWriter.java @@ -43,7 +43,6 @@ import java.io.IOException; import java.util.*; -import java.util.stream.Collectors; public class KotlinWriter implements StatementWriter { private static final Set ERROR_DUMP_STOP_POINTS = new HashSet<>(Arrays.asList( @@ -97,8 +96,7 @@ private boolean invokeProcessors(TextBuffer buffer, ClassNode node) { ClassWrapper wrapper = node.getWrapper(); if (wrapper == null) { buffer.append("/* $VF: Couldn't be decompiled. Class " + node.classStruct.qualifiedName + " wasn't processed yet! */"); - List lines = new ArrayList<>(); - lines.addAll(KotlinWriter.getErrorComment()); + List lines = new ArrayList<>(KotlinWriter.getErrorComment()); for (String line : lines) { buffer.append("//"); if (!line.isEmpty()) buffer.append(' ').append(line); @@ -132,8 +130,7 @@ private boolean invokeProcessors(TextBuffer buffer, ClassNode node) { buffer.append("// $VF: Couldn't be decompiled"); buffer.appendLineSeparator(); if (DecompilerContext.getOption(IFernflowerPreferences.DUMP_EXCEPTION_ON_ERROR)) { - List lines = new ArrayList<>(); - lines.addAll(KotlinWriter.getErrorComment()); + List lines = new ArrayList<>(KotlinWriter.getErrorComment()); collectErrorLines(t, lines); for (String line : lines) { buffer.append("//"); @@ -313,7 +310,7 @@ public void writeClass(ClassNode node, TextBuffer buffer, int indent) { } } - if (propertyData == null || !propertyData.associatedFields.contains(fd.getName())) { + if (propertyData == null || !propertyData.associatedFields().contains(fd.getName())) { TextBuffer fieldBuffer = new TextBuffer(); writeField(wrapper, cl, fd, fieldBuffer, indent + 1); fieldBuffer.clearUnassignedBytecodeMappingData(); @@ -335,12 +332,12 @@ public void writeClass(ClassNode node, TextBuffer buffer, int indent) { } } - if (propertyData != null && !propertyData.properties.isEmpty()) { + if (propertyData != null && !propertyData.properties().isEmpty()) { if (hasContent) { buffer.appendLineSeparator(); } - for (KProperty prop : propertyData.properties) { + for (KProperty prop : propertyData.properties()) { buffer.append(prop.stringify(indent + 1)); } @@ -355,7 +352,7 @@ public void writeClass(ClassNode node, TextBuffer buffer, int indent) { mt.hasModifier(CodeConstants.ACC_BRIDGE) && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_BRIDGE) || wrapper.getHiddenMembers().contains(InterpreterUtil.makeUniqueKey(mt.getName(), mt.getDescriptor())) || mt.getName().equals("") && mt.getDescriptor().equals("(Lkotlin/jvm/internal/DefaultConstructorMarker;)V") || - propertyData != null && propertyData.associatedMethods.contains(InterpreterUtil.makeUniqueKey(mt.getName(), mt.getDescriptor())); + propertyData != null && propertyData.associatedMethods().contains(InterpreterUtil.makeUniqueKey(mt.getName(), mt.getDescriptor())); if (hide) continue; KFunction function = functions.get(mt); @@ -369,7 +366,7 @@ public void writeClass(ClassNode node, TextBuffer buffer, int indent) { } if (constructorData != null) { - KConstructor constructor = constructorData.constructors.get(mt); + KConstructor constructor = constructorData.constructors().get(mt); if (constructor != null) { if (hasContent) { buffer.appendLineSeparator(); @@ -423,12 +420,12 @@ private void writeKotlinFile(ClassNode node, TextBuffer buffer, int indent, KPro ClassWrapper wrapper = node.getWrapper(); StructClass cl = wrapper.getClassStruct(); - for (KProperty property : propertyData.properties) { + for (KProperty property : propertyData.properties()) { buffer.append(property.stringify(indent)); } for (StructField fd : cl.getFields()) { - if (propertyData.associatedFields.contains(fd.getName())) continue; + if (propertyData.associatedFields().contains(fd.getName())) continue; TextBuffer fieldBuffer = new TextBuffer(); writeField(wrapper, cl, fd, fieldBuffer, indent); @@ -449,7 +446,7 @@ private void writeKotlinFile(ClassNode node, TextBuffer buffer, int indent, KPro } String key = InterpreterUtil.makeUniqueKey(mt.getName(), mt.getDescriptor()); - if (mt.getName().equals("") || propertyData.associatedMethods.contains(key)) continue; + if (mt.getName().equals("") || propertyData.associatedMethods().contains(key)) continue; TextBuffer methodBuffer = new TextBuffer(); writeMethod(node, mt, i, methodBuffer, indent); @@ -495,31 +492,31 @@ private void writeAnnotationDefinition(ClassNode node, TextBuffer buffer, int in .append("(") .appendLineSeparator(); - List nonParameterProperties = new ArrayList<>(propertyData.properties); + List nonParameterProperties = new ArrayList<>(propertyData.properties()); boolean first = true; - for (KParameter param : constructorData.primary.parameters) { + for (KParameter param : constructorData.primary().parameters()) { if (!first) { buffer.append(",").appendLineSeparator(); } first = false; buffer.appendIndent(indent + 1) .append("val ") - .append(KotlinWriter.toValidKotlinIdentifier(param.name)) + .append(KotlinWriter.toValidKotlinIdentifier(param.name())) .append(": ") - .append(param.type.stringify(indent + 1)); + .append(param.type().stringify(indent + 1)); // Because Kotlin really doesn't like making this easy for us, defaults are still passed directly via attributes - KProperty prop = propertyData.properties.stream() - .filter(p -> p.name.equals(param.name)) + KProperty prop = propertyData.properties().stream() + .filter(p -> p.name().equals(param.name())) .findFirst() .orElseThrow(); nonParameterProperties.remove(prop); - KPropertyAccessor getter = prop.getter; + KPropertyAccessor getter = prop.getter(); if (getter != null) { - StructMethod mt = getter.underlyingMethod.methodStruct; + StructMethod mt = getter.underlyingMethod().methodStruct; StructAnnDefaultAttribute paramAttr = mt.getAttribute(StructGeneralAttribute.ATTRIBUTE_ANNOTATION_DEFAULT); if (paramAttr != null) { Exprent kExpr = KUtils.replaceExprent(paramAttr.getDefaultValue()); @@ -582,10 +579,6 @@ private void writeAnnotationDefinition(ClassNode node, TextBuffer buffer, int in buffer.appendLineSeparator(); } - private static boolean isGenerated(int flags) { - return (flags & (CodeConstants.ACC_SYNTHETIC | CodeConstants.ACC_MANDATED)) != 0; - } - private void writeClassDefinition(ClassNode node, TextBuffer buffer, int indent, KConstructor.Data constructorData) { if (node.type == ClassNode.Type.ANONYMOUS) { buffer.append(" {").appendLineSeparator(); @@ -597,16 +590,9 @@ private void writeClassDefinition(ClassNode node, TextBuffer buffer, int indent, int flags = node.type == ClassNode.Type.ROOT ? cl.getAccessFlags() : node.access; boolean isDeprecated = cl.hasAttribute(StructGeneralAttribute.ATTRIBUTE_DEPRECATED); - boolean isSynthetic = (flags & CodeConstants.ACC_SYNTHETIC) != 0 || cl.hasAttribute(StructGeneralAttribute.ATTRIBUTE_SYNTHETIC); boolean isEnum = DecompilerContext.getOption(IFernflowerPreferences.DECOMPILE_ENUM) && (flags & CodeConstants.ACC_ENUM) != 0; boolean isInterface = (flags & CodeConstants.ACC_INTERFACE) != 0; boolean isAnnotation = (flags & CodeConstants.ACC_ANNOTATION) != 0; - boolean isModuleInfo = (flags & CodeConstants.ACC_MODULE) != 0 && cl.hasAttribute(StructGeneralAttribute.ATTRIBUTE_MODULE); - StructPermittedSubclassesAttribute permittedSubClassesAttr = cl.getAttribute(StructGeneralAttribute.ATTRIBUTE_PERMITTED_SUBCLASSES); - List permittedSubClasses = permittedSubClassesAttr != null ? permittedSubClassesAttr.getClasses() : Collections.emptyList(); - boolean isSealed = permittedSubClassesAttr != null && !permittedSubClasses.isEmpty(); - boolean isFinal = (flags & CodeConstants.ACC_FINAL) != 0; - boolean isNonSealed = !isSealed && !isFinal && cl.getVersion().hasSealedClasses() && isSuperClassSealed(cl); if (isDeprecated) { if (!containsDeprecatedAnnotation(cl)) { @@ -691,7 +677,7 @@ private void writeClassDefinition(ClassNode node, TextBuffer buffer, int indent, boolean appendedColon = false; if (!isEnum && !isInterface && cl.superClass != null) { - if (constructorData != null && constructorData.primary != null && constructorData.primary.writePrimaryConstructor(buffer, indent)) { + if (constructorData != null && constructorData.primary() != null && constructorData.primary().writePrimaryConstructor(buffer, indent)) { appendedColon = true; } else { VarType supertype = new VarType(cl.superClass.getString(), true); @@ -728,22 +714,6 @@ private void writeClassDefinition(ClassNode node, TextBuffer buffer, int indent, buffer.append(" {").appendLineSeparator(); } - private static boolean isSuperClassSealed(StructClass cl) { - if (cl.superClass != null) { - StructClass superClass = DecompilerContext.getStructContext().getClass((String) cl.superClass.value); - if (superClass != null && superClass.hasAttribute(StructGeneralAttribute.ATTRIBUTE_PERMITTED_SUBCLASSES)) { - return true; - } - } - for (String iface : cl.getInterfaceNames()) { - StructClass ifaceClass = DecompilerContext.getStructContext().getClass(iface); - if (ifaceClass != null && ifaceClass.hasAttribute(StructGeneralAttribute.ATTRIBUTE_PERMITTED_SUBCLASSES)) { - return true; - } - } - return false; - } - public void writeField(ClassWrapper wrapper, StructClass cl, StructField fd, TextBuffer buffer, int indent) { boolean isInterface = cl.hasModifier(CodeConstants.ACC_INTERFACE); boolean isDeprecated = fd.hasAttribute(StructGeneralAttribute.ATTRIBUTE_DEPRECATED); @@ -804,10 +774,9 @@ public void writeField(ClassWrapper wrapper, StructClass cl, StructField fd, Tex } if (initializer != null) { - if (isEnum && initializer instanceof NewExprent) { - NewExprent expr = (NewExprent) initializer; - expr.setEnumConst(true); - buffer.append(expr.toJava(indent)); + if (isEnum && initializer instanceof NewExprent newExpr) { + newExpr.setEnumConst(true); + buffer.append(newExpr.toJava(indent)); } else { buffer.append(" = "); @@ -992,7 +961,7 @@ public boolean writeMethod(ClassNode node, StructMethod mt, int methodIndex, Tex boolean extension = varprocName != null && varprocName.startsWith("$this$"); if (extension) { - VarType paramType = descriptor != null && descriptor.parameterTypes.size() > 0 ? descriptor.parameterTypes.get(0) : md.params[0]; + VarType paramType = descriptor != null && !descriptor.parameterTypes.isEmpty() ? descriptor.parameterTypes.get(0) : md.params[0]; String typeName = KTypes.getKotlinType(paramType); boolean isNullable = processParameterAnnotations(buffer, mt, 0); @@ -1039,7 +1008,7 @@ public boolean writeMethod(ClassNode node, StructMethod mt, int methodIndex, Tex } boolean hasDescriptor = descriptor != null; - //mask should now have the Outer.this in it... so this *shouldn't* be nessasary. + //mask should now have the Outer.this in it... so this *shouldn't* be necessary. //if (init && !isEnum && ((node.access & CodeConstants.ACC_STATIC) == 0) && node.type == ClassNode.CLASS_MEMBER) // index++; @@ -1163,9 +1132,7 @@ public static boolean writeMethodBody(ClassNode node, MethodWrapper methodWrappe if (root != null && methodWrapper.decompileError == null) { // check for existence try { // Avoid generating imports for ObjectMethods during root.toJava(...) - if (RecordHelper.isHiddenRecordMethod(cl, mt, root)) { - hideMethod = true; - } else { + if (!RecordHelper.isHiddenRecordMethod(cl, mt, root)) { TextBuffer code = root.toJava(indent + 1); code.addBytecodeMapping(root.getDummyExit().bytecode); hideMethod = code.length() == 0 && hideIfInit; @@ -1253,7 +1220,7 @@ public static void collectErrorLines(Throwable error, List lines) { } private static void collectBytecode(MethodWrapper wrapper, List lines) throws IOException { - ClassNode classNode = (ClassNode) DecompilerContext.getContextProperty(DecompilerContext.CURRENT_CLASS_NODE); + ClassNode classNode = DecompilerContext.getContextProperty(DecompilerContext.CURRENT_CLASS_NODE); StructMethod method = wrapper.methodStruct; InstructionSequence instructions = method.getInstructionSequence(); if (instructions == null) { @@ -1270,14 +1237,14 @@ private static void collectBytecode(MethodWrapper wrapper, List lines) t Instruction instr = instructions.getInstr(idx); StringBuilder sb = new StringBuilder(); String offHex = Integer.toHexString(offset); - for (int i = offHex.length(); i < digits; i++) sb.append('0'); + sb.append("0".repeat(Math.max(0, digits - offHex.length()))); sb.append(offHex).append(": "); if (instr.wide) { sb.append("wide "); } sb.append(TextUtil.getInstructionName(instr.opcode)); switch (instr.group) { - case CodeConstants.GROUP_INVOCATION: { + case CodeConstants.GROUP_INVOCATION -> { sb.append(' '); if (instr.opcode == CodeConstants.opc_invokedynamic && bootstrap != null) { appendBootstrapCall(sb, pool.getLinkConstant(instr.operand(0)), bootstrap); @@ -1287,29 +1254,22 @@ private static void collectBytecode(MethodWrapper wrapper, List lines) t for (int i = 1; i < instr.operandsCount(); i++) { sb.append(' ').append(instr.operand(i)); } - break; } - case CodeConstants.GROUP_FIELDACCESS: { + case CodeConstants.GROUP_FIELDACCESS -> { sb.append(' '); appendConstant(sb, pool.getConstant(instr.operand(0))); - break; } - case CodeConstants.GROUP_JUMP: { + case CodeConstants.GROUP_JUMP -> { sb.append(' '); int dest = offset + instr.operand(0); String destHex = Integer.toHexString(dest); - for (int i = destHex.length(); i < digits; i++) sb.append('0'); + sb.append("0".repeat(Math.max(0, digits - destHex.length()))); sb.append(destHex); - break; } - default: { + default -> { switch (instr.opcode) { - case CodeConstants.opc_new: - case CodeConstants.opc_checkcast: - case CodeConstants.opc_instanceof: - case CodeConstants.opc_ldc: - case CodeConstants.opc_ldc_w: - case CodeConstants.opc_ldc2_w: { + case CodeConstants.opc_new, CodeConstants.opc_checkcast, CodeConstants.opc_instanceof, + CodeConstants.opc_ldc, CodeConstants.opc_ldc_w, CodeConstants.opc_ldc2_w -> { sb.append(' '); PooledConstant constant = pool.getConstant(instr.operand(0)); if (constant.type == CodeConstants.CONSTANT_Dynamic && bootstrap != null) { @@ -1317,9 +1277,8 @@ private static void collectBytecode(MethodWrapper wrapper, List lines) t } else { appendConstant(sb, constant); } - break; } - default: { + default -> { for (int i = 0; i < instr.operandsCount(); i++) { sb.append(' ').append(instr.operand(i)); } @@ -1354,8 +1313,7 @@ private static void appendConstant(StringBuilder sb, PooledConstant constant) { sb.append(""); return; } - if (constant instanceof PrimitiveConstant) { - PrimitiveConstant prim = ((PrimitiveConstant) constant); + if (constant instanceof PrimitiveConstant prim) { Object value = prim.value; String stringValue = String.valueOf(value); if (prim.type == CodeConstants.CONSTANT_Class) { @@ -1365,8 +1323,7 @@ private static void appendConstant(StringBuilder sb, PooledConstant constant) { } else { sb.append(stringValue); } - } else if (constant instanceof LinkConstant) { - LinkConstant linkConstant = (LinkConstant) constant; + } else if (constant instanceof LinkConstant linkConstant) { sb.append(linkConstant.classname).append('.').append(linkConstant.elementname).append(' ').append(linkConstant.descriptor); } } @@ -1476,7 +1433,7 @@ private static String getTypePrintOut(VarType type) { } public static List getErrorComment() { - return Arrays.stream(((String) DecompilerContext.getProperty(IFernflowerPreferences.ERROR_MESSAGE)).split("\n")).filter(s -> !s.isEmpty()).collect(Collectors.toList()); + return Arrays.stream(((String) DecompilerContext.getProperty(IFernflowerPreferences.ERROR_MESSAGE)).split("\n")).filter(s -> !s.isEmpty()).toList(); } private static void appendComment(TextBuffer buffer, String comment, int indent) { @@ -1588,7 +1545,7 @@ public static void appendJvmAnnotations(TextBuffer buffer, int indent, StructMem static boolean isNullable(StructMember mb) { for (Key key : ANNOTATION_ATTRIBUTES) { - StructAnnotationAttribute attribute = (StructAnnotationAttribute) mb.getAttribute((Key) key); + StructAnnotationAttribute attribute = mb.getAttribute((Key) key); if (attribute != null) { return attribute.getAnnotations().stream().anyMatch(annotation -> annotation.getClassName().equals(NULLABLE_ANN_NAME)); } @@ -1647,7 +1604,7 @@ public static boolean processParameterAnnotations(TextBuffer buffer, StructMetho boolean ret = false; for (Key key : PARAMETER_ANNOTATION_ATTRIBUTES) { - StructAnnotationParameterAttribute attribute = (StructAnnotationParameterAttribute) mt.getAttribute((Key) key); + StructAnnotationParameterAttribute attribute = mt.getAttribute((Key) key); if (attribute != null) { List> annotations = attribute.getParamAnnotations(); if (param < annotations.size()) { @@ -1672,7 +1629,7 @@ public static boolean processParameterAnnotations(TextBuffer buffer, StructMetho private static void appendTypeAnnotations(TextBuffer buffer, int indent, StructMember mb, int targetType, int index, Set filter) { for (Key key : TYPE_ANNOTATION_ATTRIBUTES) { - StructTypeAnnotationAttribute attribute = (StructTypeAnnotationAttribute) mb.getAttribute((Key) key); + StructTypeAnnotationAttribute attribute = mb.getAttribute((Key) key); if (attribute != null) { for (TypeAnnotation annotation : attribute.getAnnotations()) { if (annotation.isTopLevel() && annotation.getTargetType() == targetType && (index < 0 || annotation.getIndex() == index)) { @@ -1735,10 +1692,6 @@ private static void appendModifiers(TextBuffer buffer, int flags, int allowed, b } } - public static String getModifiers(int flags) { - return MODIFIERS.entrySet().stream().filter(e -> (e.getKey() & flags) != 0).map(Map.Entry::getValue).collect(Collectors.joining(" ")); - } - public static void appendTypeParameters(TextBuffer buffer, List parameters, List> bounds) { buffer.append('<'); @@ -1762,14 +1715,4 @@ public static void appendTypeParameters(TextBuffer buffer, List paramete buffer.append('>'); } - - private static void appendFQClassNames(TextBuffer buffer, List names) { - for (int i = 0; i < names.size(); i++) { - String name = names.get(i); - buffer.appendIndent(2).append(name); - if (i < names.size() - 1) { - buffer.append(',').appendLineSeparator(); - } - } - } } diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/expr/KAnnotationExprent.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/expr/KAnnotationExprent.java index c7432ca7b8..d8ab0bfd14 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/expr/KAnnotationExprent.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/expr/KAnnotationExprent.java @@ -47,12 +47,12 @@ public TextBuffer toJava(int indent) { buffer.append(KTypes.getKotlinType(type)); switch (getAnnotationType()) { - case SINGLE_ELEMENT: + case SINGLE_ELEMENT -> { buffer.append('(').appendPossibleNewline(); writeAnnotationValue(getParValues().get(0), buffer); buffer.append(')'); - break; - case NORMAL: + } + case NORMAL -> { buffer.append('(').appendPossibleNewline(); boolean first = true; for (int i = 0; i < getParValues().size(); i++) { @@ -67,16 +67,15 @@ public TextBuffer toJava(int indent) { writeAnnotationValue(getParValues().get(i), buffer); } buffer.append(')'); - break; + } } return buffer; } public static void writeAnnotationValue(Exprent expr, TextBuffer buffer) { - if (expr instanceof FieldExprent) { + if (expr instanceof FieldExprent fieldExprent) { // Enum value - FieldExprent fieldExprent = (FieldExprent) expr; VarType type = new VarType(fieldExprent.getClassname(), true); DecompilerContext.getImportCollector().getShortName(fieldExprent.getClassname(), true); @@ -84,9 +83,8 @@ public static void writeAnnotationValue(Exprent expr, TextBuffer buffer) { .append(KTypes.getKotlinType(type)) .append(".") .append(fieldExprent.getName()); - } else if (expr instanceof NewExprent) { + } else if (expr instanceof NewExprent newExprent) { // Array value - NewExprent newExprent = (NewExprent) expr; buffer.append('['); boolean first = true; for (Exprent exprent : newExprent.getLstArrayElements()) { @@ -98,19 +96,18 @@ public static void writeAnnotationValue(Exprent expr, TextBuffer buffer) { writeAnnotationValue(exprent, buffer); } buffer.append(']'); - } else if (expr instanceof AnnotationExprent) { - AnnotationExprent annotationExprent = (AnnotationExprent) expr; + } else if (expr instanceof AnnotationExprent annotationExprent) { buffer.append('@'); VarType type = new VarType(annotationExprent.getClassName(), true); buffer.append(KTypes.getKotlinType(type)); switch (annotationExprent.getAnnotationType()) { - case SINGLE_ELEMENT: + case SINGLE_ELEMENT -> { buffer.append('('); writeAnnotationValue(annotationExprent.getParValues().get(0), buffer); buffer.append(')'); - break; - case NORMAL: + } + case NORMAL -> { buffer.append('('); boolean first = true; for (int i = 0; i < annotationExprent.getParValues().size(); i++) { @@ -125,10 +122,9 @@ public static void writeAnnotationValue(Exprent expr, TextBuffer buffer) { writeAnnotationValue(annotationExprent.getParValues().get(i), buffer); } buffer.append(')'); - break; + } } - } else if (expr instanceof ConstExprent) { - ConstExprent constExprent = (ConstExprent) expr; + } else if (expr instanceof ConstExprent constExprent) { if (constExprent.getConstType().equals(VarType.VARTYPE_CLASS)) { VarType type = new VarType((String) constExprent.getValue(), true); DecompilerContext.getImportCollector().getShortName((String) constExprent.getValue(), true); diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/expr/KFunctionExprent.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/expr/KFunctionExprent.java index b6f8553d6e..e1e5873404 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/expr/KFunctionExprent.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/expr/KFunctionExprent.java @@ -13,6 +13,7 @@ import java.util.ArrayList; import java.util.BitSet; import java.util.List; +import java.util.Objects; public class KFunctionExprent extends FunctionExprent implements KExprent { private KFunctionType kType = KFunctionType.NONE; @@ -65,30 +66,30 @@ public TextBuffer toJava(int indent) { List lstOperands = getLstOperands(); optimizeType(); - - switch(getFuncType()) { - case OTHER: + + switch (getFuncType()) { + case OTHER -> { switch (kType) { - case EQUALS3: + case EQUALS3 -> { buf.append(wrapOperandString(lstOperands.get(0), true, indent)) .append(" === ") .append(wrapOperandString(lstOperands.get(1), true, indent)); return buf; - case IF_NULL: + } + case IF_NULL -> { buf.append(wrapOperandString(lstOperands.get(0), true, indent)) .append(" ?: ") .append(wrapOperandString(lstOperands.get(1), true, indent)); return buf; - case GET_KCLASS: + } + case GET_KCLASS -> { Exprent operand = lstOperands.get(0); - if (operand instanceof VarExprent) { - VarExprent varExprent = ((VarExprent) operand); + if (operand instanceof VarExprent varExprent) { if (!varExprent.getVarType().equals(VarType.VARTYPE_CLASS)) { throw new IllegalArgumentException("Variable accessing KClass is not a Class"); } return buf.append(varExprent.toJava()).append(".kotlin"); - } else if (operand instanceof ConstExprent) { - ConstExprent constExprent = (ConstExprent) operand; + } else if (operand instanceof ConstExprent constExprent) { String value = constExprent.getValue().toString(); VarType type = new VarType(value, !value.startsWith("[")); buf.append(KTypes.getKotlinType(type)); @@ -99,27 +100,28 @@ public TextBuffer toJava(int indent) { buf.append(KTypes.getKotlinType(type)); } return buf.append("::class"); + } } throw new IllegalStateException("Unknown function type: " + kType); - case TERNARY: + } + case TERNARY -> { Exprent condition = lstOperands.get(0); Exprent ifTrue = lstOperands.get(1); Exprent ifFalse = lstOperands.get(2); if ( condition instanceof KFunctionExprent && ((KFunctionExprent) condition).getFuncType() == FunctionType.INSTANCEOF - && ifTrue instanceof KFunctionExprent && ((KFunctionExprent) ifTrue).getFuncType() == FunctionType.CAST - && ifFalse.getExprType() == VarType.VARTYPE_NULL + && ifTrue instanceof KFunctionExprent cast && ((KFunctionExprent) ifTrue).getFuncType() == FunctionType.CAST + && ifFalse.getExprType() == VarType.VARTYPE_NULL ) { // Safe cast - KFunctionExprent cast = (KFunctionExprent) ifTrue; buf.append(cast.getLstOperands().get(0).toJava(indent)); buf.append(" as? "); buf.append(cast.getLstOperands().get(1).toJava(indent)); return buf; } - + buf.pushNewlineGroup(indent, 1); buf.append("if ("); buf.append(wrapOperandString(condition, true, indent)) @@ -131,60 +133,69 @@ public TextBuffer toJava(int indent) { .appendPossibleNewline(" ") .append(wrapOperandString(ifFalse, true, indent)); buf.popNewlineGroup(); - + return buf; - case INSTANCEOF: + } + case INSTANCEOF -> { buf.append(wrapOperandString(lstOperands.get(0), true, indent)) .append(" is ") .append(wrapOperandString(lstOperands.get(1), true, indent)); - + return buf; - case BOOL_NOT: + } + case BOOL_NOT -> { // Special cases for `is` and `!is` // TODO: do the same for `in` and `!in` - if (lstOperands.get(0) instanceof KFunctionExprent) { - KFunctionExprent func = (KFunctionExprent) lstOperands.get(0); - if (func.getFuncType() == FunctionExprent.FunctionType.INSTANCEOF) { + if (lstOperands.get(0) instanceof KFunctionExprent func) { + if (func.getFuncType() == FunctionType.INSTANCEOF) { buf.append(wrapOperandString(func.getLstOperands().get(0), true, indent)) .append(" !is ") .append(wrapOperandString(func.getLstOperands().get(1), true, indent)); return buf; } } - break; - case CAST: + } + case CAST -> { if (!doesCast()) { return buf.append(lstOperands.get(0).toJava(indent)); } buf.append(wrapOperandString(lstOperands.get(0), true, indent)).append(" as ").append(lstOperands.get(1).toJava(indent)); return buf; - case BIT_NOT: + } + case BIT_NOT -> { buf.append(wrapOperandString(lstOperands.get(0), true, indent)); return buf.append(".inv()"); - case AND: // Bitwise AND + } + case AND -> { buf.append(wrapOperandString(lstOperands.get(0), true, indent)).append(" and ") .append(wrapOperandString(lstOperands.get(1), true, indent)); - return buf; - case OR: + return buf; // Bitwise AND + } + case OR -> { buf.append(wrapOperandString(lstOperands.get(0), true, indent)).append(" or ") .append(wrapOperandString(lstOperands.get(1), true, indent)); return buf; - case XOR: + } + case XOR -> { buf.append(wrapOperandString(lstOperands.get(0), true, indent)).append(" xor ") .append(wrapOperandString(lstOperands.get(1), true, indent)); return buf; - case SHL: + } + case SHL -> { buf.append(wrapOperandString(lstOperands.get(0), true, indent)).append(" shl ") .append(wrapOperandString(lstOperands.get(1), true, indent)); return buf; - case SHR: + } + case SHR -> { buf.append(wrapOperandString(lstOperands.get(0), true, indent)).append(" shr ") .append(wrapOperandString(lstOperands.get(1), true, indent)); return buf; - case USHR: + } + case USHR -> { buf.append(wrapOperandString(lstOperands.get(0), true, indent)).append(" ushr ") .append(wrapOperandString(lstOperands.get(1), true, indent)); return buf; + } } return buf.append(super.toJava(indent)); @@ -192,25 +203,19 @@ public TextBuffer toJava(int indent) { @Override public VarType getExprType() { - switch (kType) { - case EQUALS3: - return VarType.VARTYPE_BOOLEAN; - case IF_NULL: + return switch (kType) { + case EQUALS3 -> VarType.VARTYPE_BOOLEAN; + case IF_NULL -> { Exprent param1 = getLstOperands().get(0); Exprent param2 = getLstOperands().get(1); VarType supertype = VarType.getCommonSupertype(param1.getExprType(), param2.getExprType()); - if (supertype != null) { - return supertype; - } else { - // TODO: Needs a better default! - return VarType.VARTYPE_OBJECT; - } - case GET_KCLASS: - return VarType.VARTYPE_CLASS; - } - - return super.getExprType(); + // TODO: Needs a better default! + yield Objects.requireNonNullElse(supertype, VarType.VARTYPE_OBJECT); + } + case GET_KCLASS -> VarType.VARTYPE_CLASS; + case NONE -> super.getExprType(); + }; } @Override @@ -228,27 +233,25 @@ public CheckTypesResult checkExprTypeBounds() { } switch (kType) { - case IF_NULL: + case IF_NULL -> { VarType supertype = getExprType(); result.addMinTypeExprent(param1, VarType.getMinTypeInFamily(supertype.typeFamily)); result.addMinTypeExprent(param2, VarType.getMinTypeInFamily(supertype.typeFamily)); - break; - case EQUALS3: { + } + case EQUALS3 -> { if (type1.type == CodeType.BOOLEAN) { if (type2.isStrictSuperset(type1)) { result.addMinTypeExprent(param1, VarType.VARTYPE_BYTECHAR); - } - else { // both are booleans - boolean param1_false_boolean = (param1 instanceof ConstExprent && !((ConstExprent)param1).hasBooleanValue()); - boolean param2_false_boolean = (param2 instanceof ConstExprent && !((ConstExprent)param2).hasBooleanValue()); + } else { // both are booleans + boolean param1_false_boolean = (param1 instanceof ConstExprent && !((ConstExprent) param1).hasBooleanValue()); + boolean param2_false_boolean = (param2 instanceof ConstExprent && !((ConstExprent) param2).hasBooleanValue()); if (param1_false_boolean || param2_false_boolean) { result.addMinTypeExprent(param1, VarType.VARTYPE_BYTECHAR); result.addMinTypeExprent(param2, VarType.VARTYPE_BYTECHAR); } } - } - else if (type2.type == CodeType.BOOLEAN) { + } else if (type2.type == CodeType.BOOLEAN) { if (type1.isStrictSuperset(type2)) { result.addMinTypeExprent(param2, VarType.VARTYPE_BYTECHAR); } @@ -306,18 +309,12 @@ public void setFuncType(Typed typed) { @Override public int getPrecedence() { - switch (kType) { - case EQUALS3: - return 6; - case IF_NULL: - return 11; - case GET_KCLASS: - return 1; - case NONE: - break; - } - - return super.getPrecedence(); + return switch (kType) { + case EQUALS3 -> 6; + case IF_NULL -> 11; + case GET_KCLASS -> 1; + case NONE -> super.getPrecedence(); + }; } @Override diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/metadata/MetadataNameResolver.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/metadata/MetadataNameResolver.java index 9108149bc5..73cdb59b81 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/metadata/MetadataNameResolver.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/metadata/MetadataNameResolver.java @@ -55,18 +55,17 @@ public String resolve(int idx) { } var operation = record.getOperation() == null ? JvmProtoBuf.StringTableTypes.Record.Operation.NONE : record.getOperation(); - switch (operation) { - case INTERNAL_TO_CLASS_ID: - string = string.replace('$', '.'); - break; - case DESC_TO_CLASS_ID: + string = switch (operation) { + case INTERNAL_TO_CLASS_ID -> string.replace('$', '.'); + case DESC_TO_CLASS_ID -> { if (string.length() >= 2) { string = string.substring(1, string.length() - 1); } - string = string.replace('$', '.'); - break; - } + yield string.replace('$', '.'); + } + default -> string; + }; return string; } diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/EliminateDeadVarsPass.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/EliminateDeadVarsPass.java index 824badcbf9..fc3049c263 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/EliminateDeadVarsPass.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/EliminateDeadVarsPass.java @@ -40,14 +40,11 @@ private static boolean eliminate(RootStatement root, StructMethod mt) { for (int i = 0; i < exprents.size(); i++) { Exprent ex = exprents.get(i); - if (ex instanceof AssignmentExprent) { - AssignmentExprent aex = (AssignmentExprent) ex; + if (ex instanceof AssignmentExprent aex) { Exprent left = aex.getLeft(); Exprent right = aex.getRight(); - if (left instanceof VarExprent) { - VarExprent var = (VarExprent) left; - + if (left instanceof VarExprent var) { VarVersionPair vvp = var.getVarVersionPair(); if (isPureToReplace(right)) { if (!ssu.nodes.getWithKey(vvp).hasAnySuccessors()) { @@ -75,9 +72,7 @@ private static boolean isPureToReplace(Exprent expr) { return true; } - if (expr instanceof FieldExprent) { - FieldExprent field = (FieldExprent) expr; - + if (expr instanceof FieldExprent field) { return field.isStatic() && field.getClassname().equals("kotlin/Unit"); } diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/KMergePass.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/KMergePass.java index 7e11eb64bd..9b9a837f3a 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/KMergePass.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/KMergePass.java @@ -46,24 +46,22 @@ private static boolean enhanceLoop(DoStatement stat) { DoStatement.Type oldloop = stat.getLooptype(); switch (oldloop) { - case INFINITE: - + case INFINITE -> { // identify a while loop if (matchWhile(stat)) { if (!matchForEach(stat)) { matchFor(stat); } - } - else { + } else { // identify a do{}while loop //matchDoWhile(stat); } - - break; - case WHILE: + } + case WHILE -> { if (!matchForEach(stat)) { matchFor(stat); } + } } return (stat.getLooptype() != oldloop); @@ -126,8 +124,7 @@ protected static boolean matchForEach(DoStatement stat) { return false; } - if (!isHasNextCall(drillNots(stat.getConditionExprent())) || - !(firstDoExprent instanceof AssignmentExprent)) { + if (!isHasNextCall(drillNots(stat.getConditionExprent()))) { return false; } @@ -148,8 +145,7 @@ protected static boolean matchForEach(DoStatement stat) { // Casted foreach Exprent right = initExprents[0].getRight(); - if (right instanceof FunctionExprent) { - FunctionExprent fRight = (FunctionExprent) right; + if (right instanceof FunctionExprent fRight) { if (fRight.getFuncType() == FunctionExprent.FunctionType.CAST) { right = fRight.getLstOperands().get(0); } @@ -183,10 +179,8 @@ protected static boolean matchForEach(DoStatement stat) { preData.getExprents().remove(initExprents[0]); firstData.getExprents().remove(firstDoExprent); - if (initExprents[1] != null && initExprents[1].getLeft() instanceof VarExprent && - holder.getInstance() instanceof VarExprent) { - VarExprent copy = (VarExprent)initExprents[1].getLeft(); - VarExprent inc = (VarExprent)holder.getInstance(); + if (initExprents[1] != null && initExprents[1].getLeft() instanceof VarExprent copy && + holder.getInstance() instanceof VarExprent inc) { if (copy.getIndex() == inc.getIndex() && copy.getVersion() == inc.getVersion() && !inc.isVarReferenced(stat.getTopParent(), copy) && !isNextCall(initExprents[1].getRight())) { preData.getExprents().remove(initExprents[1]); @@ -206,43 +200,36 @@ protected static boolean matchForEach(DoStatement stat) { return true; } else if (initExprents[1] != null) { - if (!(firstDoExprent.getRight() instanceof ArrayExprent) || !(firstDoExprent.getLeft() instanceof VarExprent)) { + if (!(firstDoExprent.getRight() instanceof ArrayExprent arr) || !(firstDoExprent.getLeft() instanceof VarExprent)) { return false; } - if (!(lastExprent instanceof FunctionExprent)) { + if (!(lastExprent instanceof FunctionExprent funcInc)) { return false; } // Kotlin: Inverted indices 0 and 1 as kotlinc inverts the cases if (!(initExprents[1].getRight() instanceof ConstExprent) || - !(initExprents[0].getRight() instanceof FunctionExprent) || + !(initExprents[0].getRight() instanceof FunctionExprent funcRight) || !(stat.getConditionExprent() instanceof FunctionExprent)) { return false; } //FunctionExprent funcCond = (FunctionExprent)drillNots(stat.getConditionExprent()); //TODO: Verify this is counter < copy.length - FunctionExprent funcRight = (FunctionExprent)initExprents[0].getRight(); - FunctionExprent funcInc = (FunctionExprent)lastExprent; - ArrayExprent arr = (ArrayExprent)firstDoExprent.getRight(); FunctionExprent.FunctionType incType = funcInc.getFuncType(); if (funcRight.getFuncType() != FunctionExprent.FunctionType.ARRAY_LENGTH || (incType != FunctionExprent.FunctionType.PPI && incType != FunctionExprent.FunctionType.IPP) || - !(arr.getIndex() instanceof VarExprent) || - !(arr.getArray() instanceof VarExprent)) { + !(arr.getIndex() instanceof VarExprent index) || + !(arr.getArray() instanceof VarExprent array)) { return false; } - VarExprent index = (VarExprent)arr.getIndex(); - VarExprent array = (VarExprent)arr.getArray(); Exprent countExpr = funcInc.getLstOperands().get(0); // Foreach over multi dimensional array initializers can cause this to not be a var exprent - if (countExpr instanceof VarExprent) { - VarExprent counter = (VarExprent) countExpr; - + if (countExpr instanceof VarExprent counter) { if (counter.getIndex() != index.getIndex() || counter.getVersion() != index.getVersion()) { return false; @@ -273,9 +260,7 @@ protected static boolean matchForEach(DoStatement stat) { firstData.getExprents().remove(firstDoExprent); lastData.getExprents().remove(lastExprent); - if (initExprents[2] != null && initExprents[2].getLeft() instanceof VarExprent) { - VarExprent copy = (VarExprent)initExprents[2].getLeft(); - + if (initExprents[2] != null && initExprents[2].getLeft() instanceof VarExprent copy) { if (copy.getIndex() == array.getIndex() && copy.getVersion() == array.getVersion()) { preData.getExprents().remove(initExprents[2]); initExprents[2].getRight().addBytecodeOffsets(initExprents[2].bytecode); diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/ReplaceExprentsPass.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/ReplaceExprentsPass.java index 285131846a..e2673fa132 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/ReplaceExprentsPass.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/pass/ReplaceExprentsPass.java @@ -30,7 +30,7 @@ private static boolean replace(Statement stat) { exprs = ((IfStatement)stat).getHeadexprentList(); } - if (exprs.size() > 0) { + if (!exprs.isEmpty()) { for(int i = 0; i < exprs.size(); i++){ Exprent expr = exprs.get(i); Exprent map = KUtils.replaceExprent(expr); diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/DefaultArgsMap.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/DefaultArgsMap.java index 808220857d..41e20c1054 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/DefaultArgsMap.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/DefaultArgsMap.java @@ -12,6 +12,7 @@ import org.jetbrains.java.decompiler.struct.gen.VarType; import org.jetbrains.java.decompiler.util.TextBuffer; import org.vineflower.kotlin.KotlinOptions; +import org.vineflower.kotlin.util.KUtils; import java.util.HashMap; import java.util.Map; @@ -65,8 +66,8 @@ public static DefaultArgsMap from(MethodWrapper defaults, MethodWrapper calling, int startOfBitmasks = 0; - if (defaults.methodStruct.hasModifier(CodeConstants.ACC_STATIC) && !calling.methodStruct.hasModifier(CodeConstants.ACC_STATIC)) { - // "this" is passed as an extra parameter to the default method + if (!calling.methodStruct.hasModifier(CodeConstants.ACC_STATIC)) { + // "this" fills the first variable slot startOfBitmasks++; } @@ -113,8 +114,10 @@ public static DefaultArgsMap from(MethodWrapper defaults, MethodWrapper calling, } } - for (KParameter param : params) { - assert map.containsKey(param) == param.flags.declaresDefault : "Parameter " + param.name + " has default value but no default value was found"; + if (KUtils.assertionsEnabled()) { + for (KParameter param : params) { + assert map.containsKey(param) == param.flags().declaresDefault : "Parameter " + param.name() + " has default value but no default value was found"; + } } return new DefaultArgsMap(map); diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KConstructor.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KConstructor.java index ceefff3807..e8883ac1c7 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KConstructor.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KConstructor.java @@ -28,32 +28,16 @@ import java.util.List; import java.util.Map; -public class KConstructor { +public record KConstructor( + KParameter[] parameters, + ProtobufFlags.Constructor flags, + MethodWrapper method, + boolean isPrimary, + DefaultArgsMap defaultArgs, + ClassesProcessor.ClassNode node +) { private static final VarType DEFAULT_CONSTRUCTOR_MARKER = new VarType("kotlin/jvm/internal/DefaultConstructorMarker", true); - public final ProtobufFlags.Constructor flags; - public final KParameter[] parameters; - public final boolean isPrimary; - - public final MethodWrapper method; - private final DefaultArgsMap defaultArgs; - private final ClassesProcessor.ClassNode node; - - private KConstructor( - KParameter[] parameters, - ProtobufFlags.Constructor flags, - MethodWrapper method, - boolean isPrimary, - DefaultArgsMap defaultArgs, - ClassesProcessor.ClassNode node) { - this.parameters = parameters; - this.flags = flags; - this.method = method; - this.isPrimary = isPrimary; - this.defaultArgs = defaultArgs; - this.node = node; - } - public static Data parse(ClassesProcessor.ClassNode node) { MetadataNameResolver resolver = KotlinDecompilationContext.getNameResolver(); ClassWrapper wrapper = node.getWrapper(); @@ -104,7 +88,7 @@ public static Data parse(ClassesProcessor.ClassNode node) { StringBuilder defaultArgsDesc = new StringBuilder("("); for (KParameter parameter : parameters) { - defaultArgsDesc.append(parameter.type); + defaultArgsDesc.append(parameter.type()); } defaultArgsDesc.append("I".repeat(parameters.length / 32 + 1)); @@ -159,8 +143,8 @@ public boolean stringify(TextBuffer buffer, int indent) { parameter.stringify(indent + 1, buf); - if (parameter.flags.declaresDefault) { - buf.append(" = ").append(defaultArgs.toJava(parameter, indent + 1), node.classStruct.qualifiedName, methodKey); + if (parameter.flags().declaresDefault) { + buf.append(defaultArgs.toJava(parameter, indent + 1), node.classStruct.qualifiedName, methodKey); } } @@ -255,8 +239,8 @@ public boolean writePrimaryConstructor(TextBuffer buffer, int indent) { parameter.stringify(indent + 1, buf); - if (parameter.flags.declaresDefault) { - buf.append(" = ").append(defaultArgs.toJava(parameter, indent + 1), node.classStruct.qualifiedName, methodKey); + if (parameter.flags().declaresDefault) { + buf.append(defaultArgs.toJava(parameter, indent + 1), node.classStruct.qualifiedName, methodKey); } } @@ -303,13 +287,6 @@ public boolean writePrimaryConstructor(TextBuffer buffer, int indent) { return true; } - public static class Data { - public final Map constructors; - public final KConstructor primary; - - public Data(Map constructors, KConstructor primary) { - this.constructors = constructors; - this.primary = primary; - } + public record Data(Map constructors, KConstructor primary) { } } diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KContract.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KContract.java index 813361b7aa..7c552e386b 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KContract.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KContract.java @@ -81,7 +81,7 @@ public void stringify(TextBuffer buf, int indent) { case CALLS: buf.append("callsInPlace("); KExpression func = expressions.get(0); - String name = func.valueParameterReference.name; + String name = func.valueParameterReference.name(); buf.append(KotlinWriter.toValidKotlinIdentifier(name)); if (kind != null) { buf.append(", ") @@ -109,38 +109,17 @@ public void stringify(TextBuffer buf, int indent) { } } - public static class KExpression { + public record KExpression( + @NotNull ProtobufFlags.Expression flags, + @Nullable KParameter valueParameterReference, + @Nullable ProtoBuf.Expression.ConstantValue constantValue, + @Nullable KType instanceofType, + @NotNull List andArguments, + @NotNull List orArguments + ) { // Placeholder type for receiver type private static final KParameter THIS_TYPE = new KParameter(new ProtobufFlags.ValueParameter(0), "this", KType.NOTHING, null, 0); - @NotNull - public final ProtobufFlags.Expression flags; - @Nullable - public final KParameter valueParameterReference; - @Nullable - public final ProtoBuf.Expression.ConstantValue constantValue; - @Nullable - public final KType instanceofType; // isInstanceType - @NotNull - public final List andArguments; - @NotNull - public final List orArguments; - - private KExpression( - @NotNull ProtobufFlags.Expression flags, - @Nullable KParameter valueParameterReference, - @Nullable ProtoBuf.Expression.ConstantValue constantValue, - @Nullable KType instanceofType, - @NotNull List andArguments, - @NotNull List orArguments) { - this.flags = flags; - this.valueParameterReference = valueParameterReference; - this.constantValue = constantValue; - this.instanceofType = instanceofType; - this.andArguments = andArguments; - this.orArguments = orArguments; - } - static KExpression from(ProtoBuf.Expression proto, List params, MetadataNameResolver nameResolver) { ProtobufFlags.Expression flags = new ProtobufFlags.Expression(proto.getFlags()); KParameter valueParameterReference = null; @@ -173,7 +152,7 @@ public void stringify(TextBuffer buf, int indent, boolean partOfOr) { if (valueParameterReference == THIS_TYPE) { paramName = "this"; } else if (valueParameterReference != null) { - paramName = KotlinWriter.toValidKotlinIdentifier(valueParameterReference.name); + paramName = KotlinWriter.toValidKotlinIdentifier(valueParameterReference.name()); } if (instanceofType != null) { @@ -189,14 +168,14 @@ public void stringify(TextBuffer buf, int indent, boolean partOfOr) { .append(' ') .append("null"); } else if (constantValue != null) { - if (valueParameterReference != null && valueParameterReference.type.isNullable) { + if (valueParameterReference != null && valueParameterReference.type().isNullable) { buf.append(paramName) .append(' ') .append(flags.isNegated ? "!=" : "==") .append(' ') .append(constantValue.name().toLowerCase()); } else { - String output = valueParameterReference != null && "kotlin/Boolean".equals(valueParameterReference.type.kotlinType) + String output = valueParameterReference != null && "kotlin/Boolean".equals(valueParameterReference.type().kotlinType) ? paramName : constantValue.name().toLowerCase(); @@ -207,7 +186,7 @@ public void stringify(TextBuffer buf, int indent, boolean partOfOr) { buf.append(output); } } else if (valueParameterReference != null) { - if (!valueParameterReference.type.kotlinType.equals("kotlin/Boolean")) { + if (!valueParameterReference.type().kotlinType.equals("kotlin/Boolean")) { //TODO figure out why this happens } if (flags.isNegated) { diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KFunction.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KFunction.java index 944868065c..627e74faa6 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KFunction.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KFunction.java @@ -30,55 +30,19 @@ import java.util.Map; import java.util.stream.Collectors; -public class KFunction { - public final String name; - public final ProtobufFlags.Function flags; - public final List contextReceiverTypes; - public final KParameter[] parameters; - public final List typeParameters; - public final KType returnType; - - public final MethodWrapper method; - - @Nullable - public final KType receiverType; - - @Nullable - public final KContract contract; - - public final boolean knownOverride; - - @NotNull - private final DefaultArgsMap defaultArgs; - - private final ClassesProcessor.ClassNode node; - - private KFunction( - String name, - KParameter[] parameters, - List typeParameters, - KType returnType, - ProtobufFlags.Function flags, - List contextReceiverTypes, MethodWrapper method, - @Nullable KType receiverType, - @Nullable KContract contract, - boolean knownOverride, - @NotNull DefaultArgsMap defaultArgs, - ClassesProcessor.ClassNode node) { - this.name = name; - this.parameters = parameters; - this.typeParameters = typeParameters; - this.returnType = returnType; - this.flags = flags; - this.contextReceiverTypes = contextReceiverTypes; - this.method = method; - this.receiverType = receiverType; - this.contract = contract; - this.knownOverride = knownOverride; - this.defaultArgs = defaultArgs; - this.node = node; - } - +public record KFunction( + String name, + KParameter[] parameters, + List typeParameters, + KType returnType, + ProtobufFlags.Function flags, + List contextReceiverTypes, MethodWrapper method, + @Nullable KType receiverType, + @Nullable KContract contract, + boolean knownOverride, + @NotNull DefaultArgsMap defaultArgs, + ClassesProcessor.ClassNode node +) { public static Map parse(ClassesProcessor.ClassNode node) { MetadataNameResolver resolver = KotlinDecompilationContext.getNameResolver(); ClassWrapper wrapper = node.getWrapper(); @@ -137,7 +101,7 @@ public static Map parse(ClassesProcessor.ClassNode node } for (KParameter parameter : parameters) { - desc.append(parameter.type); + desc.append(parameter.type()); } desc.append(")").append(returnType); @@ -167,16 +131,16 @@ public static Map parse(ClassesProcessor.ClassNode node defaultArgsDesc.append(receiverType); } for (KParameter parameter : parameters) { - if (parameter.type.typeParameterName != null) { + if (parameter.type().typeParameterName != null) { typeParameters.stream() - .filter(typeParameter -> typeParameter.name.equals(parameter.type.typeParameterName)) + .filter(typeParameter -> typeParameter.name().equals(parameter.type().typeParameterName)) .findAny() - .map(typeParameter -> typeParameter.upperBounds) + .map(KTypeParameter::upperBounds) .filter(bounds -> bounds.size() == 1) .map(bounds -> bounds.get(0)) .ifPresentOrElse(defaultArgsDesc::append, () -> defaultArgsDesc.append("Ljava/lang/Object;")); } else { - defaultArgsDesc.append(parameter.type); + defaultArgsDesc.append(parameter.type()); } } @@ -283,7 +247,7 @@ public TextBuffer stringify(int indent) { buf.append("fun "); List complexTypeParams = typeParameters.stream() - .filter(typeParameter -> typeParameter.upperBounds.size() > 1) + .filter(typeParameter -> typeParameter.upperBounds().size() > 1) .toList(); if (!typeParameters.isEmpty()) { @@ -292,14 +256,14 @@ public TextBuffer stringify(int indent) { for (int i = 0; i < typeParameters.size(); i++) { KTypeParameter typeParameter = typeParameters.get(i); - if (typeParameter.reified) { + if (typeParameter.reified()) { buf.append("reified "); } - buf.append(KotlinWriter.toValidKotlinIdentifier(typeParameter.name)); + buf.append(KotlinWriter.toValidKotlinIdentifier(typeParameter.name())); - if (typeParameter.upperBounds.size() == 1) { - buf.append(" : ").append(typeParameter.upperBounds.get(0).stringify(indent + 1)); + if (typeParameter.upperBounds().size() == 1) { + buf.append(" : ").append(typeParameter.upperBounds().get(0).stringify(indent + 1)); } if (i < typeParameters.size() - 1) { @@ -338,7 +302,7 @@ public TextBuffer stringify(int indent) { first = false; parameter.stringify(indent + 1, buf); - if (parameter.flags.declaresDefault) { + if (parameter.flags().declaresDefault) { buf.append(defaultArgs.toJava(parameter, indent + 1), node.classStruct.qualifiedName, methodKey); } } @@ -361,12 +325,12 @@ public TextBuffer stringify(int indent) { first = true; for (KTypeParameter typeParameter : complexTypeParams) { - for (KType upperBound : typeParameter.upperBounds) { + for (KType upperBound : typeParameter.upperBounds()) { if (!first) { buf.appendPossibleNewline(",").appendPossibleNewline(" "); } - buf.append(KotlinWriter.toValidKotlinIdentifier(typeParameter.name)) + buf.append(KotlinWriter.toValidKotlinIdentifier(typeParameter.name())) .append(" : ") .append(upperBound.stringify(indent + 1)); diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KParameter.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KParameter.java index cd4eb4af9b..5ff14420b6 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KParameter.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KParameter.java @@ -4,21 +4,7 @@ import org.vineflower.kotlin.KotlinWriter; import org.vineflower.kotlin.util.ProtobufFlags; -public class KParameter { - public final ProtobufFlags.ValueParameter flags; - public final String name; - public final KType type; - public final KType varargType; - public final int typeId; - - KParameter(ProtobufFlags.ValueParameter flags, String name, KType type, KType varargType, int typeId) { - this.flags = flags; - this.name = name; - this.type = type; - this.varargType = varargType; - this.typeId = typeId; - } - +public record KParameter(ProtobufFlags.ValueParameter flags, String name, KType type, KType varargType, int typeId) { public void stringify(int indent, TextBuffer buf) { if (flags.isCrossinline) { buf.append("crossinline "); diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KProperty.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KProperty.java index aed36a8be6..6536d7b18c 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KProperty.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KProperty.java @@ -30,49 +30,17 @@ import java.util.*; -public final class KProperty { - public final String name; - public final KType type; - - public final ProtobufFlags.Property flags; - - @Nullable - public final KPropertyAccessor getter; - - @Nullable - public final KPropertyAccessor setter; - - @Nullable - public final String setterParamName; - - @Nullable - public final StructField underlyingField; - - @Nullable - public final Exprent initializer; - - private final ClassesProcessor.ClassNode node; - - private KProperty( - String name, - KType type, - ProtobufFlags.Property flags, - KPropertyAccessor getter, - KPropertyAccessor setter, - @Nullable String setterParamName, StructField underlyingField, - Exprent initializer, - ClassesProcessor.ClassNode node) { - this.name = name; - this.type = type; - this.flags = flags; - this.getter = getter; - this.setter = setter; - this.setterParamName = setterParamName; - this.underlyingField = underlyingField; - this.initializer = initializer; - this.node = node; - } - +public record KProperty( + String name, + KType type, + ProtobufFlags.Property flags, + @Nullable KPropertyAccessor getter, + @Nullable KPropertyAccessor setter, + @Nullable String setterParamName, + @Nullable StructField underlyingField, + @Nullable Exprent initializer, + ClassesProcessor.ClassNode node +) { public TextBuffer stringify(int indent) { TextBuffer buf = new TextBuffer(); @@ -121,50 +89,50 @@ public TextBuffer stringify(int indent) { } // Custom getters and setters, and possible modifier differences - if (getter != null && getter.flags.isNotDefault) { + if (getter != null && getter.flags().isNotDefault) { buf.pushNewlineGroup(indent, 1) .appendLineSeparator() .appendIndent(indent + 1); - KUtils.appendVisibility(buf, getter.flags.visibility); + KUtils.appendVisibility(buf, getter.flags().visibility); - buf.append(getter.flags.modality.name().toLowerCase()) + buf.append(getter.flags().modality.name().toLowerCase()) .append(' '); - if (getter.flags.isExternal) { + if (getter.flags().isExternal) { buf.append("external "); } - if (getter.flags.isInline) { + if (getter.flags().isInline) { buf.append("inline "); } buf.append("get() "); - KotlinWriter.writeMethodBody(node, getter.underlyingMethod, buf, indent + 1, false); + KotlinWriter.writeMethodBody(node, getter.underlyingMethod(), buf, indent + 1, false); buf.popNewlineGroup(); - } else if (getter != null && getter.flags.isExternal) { + } else if (getter != null && getter.flags().isExternal) { buf.appendLineSeparator() .appendIndent(indent + 1) .append("external get"); } - if (setter != null && setter.flags.isNotDefault) { + if (setter != null && setter.flags().isNotDefault) { buf.pushNewlineGroup(indent, 1) .appendLineSeparator() .appendIndent(indent + 1); - KUtils.appendVisibility(buf, getter.flags.visibility); + KUtils.appendVisibility(buf, getter.flags().visibility); - buf.append(setter.flags.modality.name().toLowerCase()) + buf.append(setter.flags().modality.name().toLowerCase()) .append(' '); - if (setter.flags.isExternal) { + if (setter.flags().isExternal) { buf.append("external "); } - if (setter.flags.isInline) { + if (setter.flags().isInline) { buf.append("inline "); } @@ -172,22 +140,22 @@ public TextBuffer stringify(int indent) { .append(setterParamName) .append(") "); - KotlinWriter.writeMethodBody(node, setter.underlyingMethod, buf, indent + 1, false); + KotlinWriter.writeMethodBody(node, setter.underlyingMethod(), buf, indent + 1, false); buf.popNewlineGroup(); - } else if (setter != null && (setter.flags.isExternal || setter.flags.visibility != flags.visibility || setter.flags.modality != flags.modality)) { + } else if (setter != null && (setter.flags().isExternal || setter.flags().visibility != flags.visibility || setter.flags().modality != flags.modality)) { buf.appendLineSeparator().appendIndent(indent + 1); - if (setter.flags.visibility != flags.visibility) { - KUtils.appendVisibility(buf, setter.flags.visibility); + if (setter.flags().visibility != flags.visibility) { + KUtils.appendVisibility(buf, setter.flags().visibility); } - if (setter.flags.modality != flags.modality) { - buf.append(setter.flags.modality.name().toLowerCase()) + if (setter.flags().modality != flags.modality) { + buf.append(setter.flags().modality.name().toLowerCase()) .append(' '); } - if (setter.flags.isExternal) { + if (setter.flags().isExternal) { buf.append("external "); } @@ -205,22 +173,16 @@ public TextBuffer stringify(int indent) { private static void appendVisibility(TextBuffer buf, ProtoBuf.Visibility visibility) { switch (visibility) { - case LOCAL: - buf.append("// QF: local property") - .appendLineSeparator() - .append("internal "); - break; - case PRIVATE_TO_THIS: - buf.append("private "); - break; - case PUBLIC: + case LOCAL -> buf.append("// QF: local property") + .appendLineSeparator() + .append("internal "); + case PRIVATE_TO_THIS -> buf.append("private "); + case PUBLIC -> { if (DecompilerContext.getOption(KotlinOptions.SHOW_PUBLIC_VISIBILITY)) { buf.append("public "); } - break; - default: - buf.append(visibility.name().toLowerCase()) - .append(' '); + } + default -> buf.append(visibility.name().toLowerCase()).append(' '); } } @@ -229,26 +191,17 @@ private static void appendVisibility(TextBuffer buf, ProtoBuf.Visibility visibil ClassWrapper wrapper = node.getWrapper(); StructClass structClass = wrapper.getClassStruct(); - List protoProperties; - KotlinDecompilationContext.KotlinType currentType = KotlinDecompilationContext.getCurrentType(); if (currentType == null) return null; - switch (currentType) { - case CLASS: - protoProperties = KotlinDecompilationContext.getCurrentClass().getPropertyList(); - break; - case FILE: - protoProperties = KotlinDecompilationContext.getFilePackage().getPropertyList(); - break; - case MULTIFILE_CLASS: - protoProperties = KotlinDecompilationContext.getMultifilePackage().getPropertyList(); - break; - case SYNTHETIC_CLASS: - return null; // No property information in synthetic classes - default: - throw new IllegalStateException("Unexpected value: " + KotlinDecompilationContext.getCurrentType()); - } + List protoProperties = switch (currentType) { + case CLASS -> KotlinDecompilationContext.getCurrentClass().getPropertyList(); + case FILE -> KotlinDecompilationContext.getFilePackage().getPropertyList(); + case MULTIFILE_CLASS -> KotlinDecompilationContext.getMultifilePackage().getPropertyList(); + case SYNTHETIC_CLASS -> null; + }; + + if (protoProperties == null) return null; List properties = new ArrayList<>(); Set associatedFields = new HashSet<>(); @@ -358,15 +311,6 @@ private static void appendVisibility(TextBuffer buf, ProtoBuf.Visibility visibil return new Data(properties, associatedFields, associatedMethods); } - public static class Data { - public final List properties; - public final Set associatedFields; - public final Set associatedMethods; - - public Data(List properties, Set associatedFields, Set associatedMethods) { - this.properties = properties; - this.associatedFields = associatedFields; - this.associatedMethods = associatedMethods; - } + public record Data(List properties, Set associatedFields, Set associatedMethods) { } } diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KPropertyAccessor.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KPropertyAccessor.java index d6dd8510dc..fb4f619264 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KPropertyAccessor.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KPropertyAccessor.java @@ -1,15 +1,7 @@ package org.vineflower.kotlin.struct; import org.jetbrains.java.decompiler.main.rels.MethodWrapper; -import org.jetbrains.java.decompiler.struct.StructMethod; import org.vineflower.kotlin.util.ProtobufFlags; -public class KPropertyAccessor { - public final ProtobufFlags.PropertyAccessor flags; - public final MethodWrapper underlyingMethod; - - public KPropertyAccessor(ProtobufFlags.PropertyAccessor flags, MethodWrapper underlyingMethod) { - this.flags = flags; - this.underlyingMethod = underlyingMethod; - } +public record KPropertyAccessor(ProtobufFlags.PropertyAccessor flags, MethodWrapper underlyingMethod) { } diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KType.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KType.java index 5d6f4728bb..5adc46803f 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KType.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KType.java @@ -81,23 +81,12 @@ public static KType from(ProtoBuf.Type type, MetadataNameResolver nameResolver) } public static KType from(int tableIndex, MetadataNameResolver resolver) { - ProtoBuf.TypeTable table; - switch (KotlinDecompilationContext.getCurrentType()) { - case CLASS: - table = KotlinDecompilationContext.getCurrentClass().getTypeTable(); - break; - case SYNTHETIC_CLASS: - table = KotlinDecompilationContext.getSyntheticClass().getTypeTable(); - break; - case FILE: - table = KotlinDecompilationContext.getFilePackage().getTypeTable(); - break; - case MULTIFILE_CLASS: - table = KotlinDecompilationContext.getMultifilePackage().getTypeTable(); - break; - default: - throw new IllegalStateException("No decompilation context found"); - } + ProtoBuf.TypeTable table = switch (KotlinDecompilationContext.getCurrentType()) { + case CLASS -> KotlinDecompilationContext.getCurrentClass().getTypeTable(); + case SYNTHETIC_CLASS -> KotlinDecompilationContext.getSyntheticClass().getTypeTable(); + case FILE -> KotlinDecompilationContext.getFilePackage().getTypeTable(); + case MULTIFILE_CLASS -> KotlinDecompilationContext.getMultifilePackage().getTypeTable(); + }; return from(table.getType(tableIndex), resolver); } @@ -163,29 +152,18 @@ public TextBuffer stringify(int indent) { return buf; } - public static class TypeArgument { - public final KType type; - public final ProtoBuf.Type.Argument.Projection typeProjection; - - public TypeArgument(KType type, ProtoBuf.Type.Argument.Projection typeProjection) { - this.type = type; - this.typeProjection = typeProjection; - } - + public record TypeArgument(KType type, ProtoBuf.Type.Argument.Projection typeProjection) { public TextBuffer stringify(int indent) { TextBuffer buf = new TextBuffer(); switch (typeProjection) { - case IN: - buf.append("in "); - break; - case OUT: - buf.append("out "); - break; - case STAR: + case IN -> buf.append("in "); + case OUT -> buf.append("out "); + case STAR -> { buf.append("*"); return buf; - case INV: - break; + } + case INV -> { + } } buf.append(type.stringify(indent)); return buf; diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KTypeParameter.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KTypeParameter.java index e802a58088..8b04749e06 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KTypeParameter.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KTypeParameter.java @@ -6,26 +6,13 @@ import java.util.List; import java.util.stream.Collectors; -public class KTypeParameter { - public final boolean reified; - public final ProtoBuf.TypeParameter.Variance variance; - public final List upperBounds; - public final String name; - public final int id; - - private KTypeParameter( - boolean reified, - ProtoBuf.TypeParameter.Variance variance, - List upperBounds, - String name, - int id) { - this.reified = reified; - this.variance = variance; - this.upperBounds = upperBounds; - this.name = name; - this.id = id; - } - +public record KTypeParameter( + boolean reified, + ProtoBuf.TypeParameter.Variance variance, + List upperBounds, + String name, + int id +) { public static KTypeParameter from(ProtoBuf.TypeParameter proto, MetadataNameResolver resolver) { return new KTypeParameter( proto.getReified(), diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/KTypes.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/KTypes.java index 8d698c3cfd..c93ee44502 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/KTypes.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/KTypes.java @@ -168,42 +168,24 @@ public static String getKotlinType(VarType type, boolean includeOuterClasses) { private static String mapJavaTypeToKotlin(String type) { if (type.endsWith("[]")) { String baseType = type.substring(0, type.length() - 2); - switch (baseType) { - case "boolean": - case "byte": - case "char": - case "short": - case "int": - case "long": - case "float": - case "double": - return mapJavaTypeToKotlin(baseType) + "Array"; - default: - return "Array<" + mapJavaTypeToKotlin(baseType) + ">"; - } + return switch (baseType) { + case "boolean", "byte", "char", "short", "int", "long", "float", "double" -> + mapJavaTypeToKotlin(baseType) + "Array"; + default -> "Array<" + mapJavaTypeToKotlin(baseType) + ">"; + }; } - switch (type) { - case "boolean": - return "Boolean"; - case "byte": - return "Byte"; - case "char": - return "Char"; - case "short": - return "Short"; - case "int": - return "Int"; - case "long": - return "Long"; - case "float": - return "Float"; - case "double": - return "Double"; - case "void": - return "Unit"; - - default: + return switch (type) { + case "boolean" -> "Boolean"; + case "byte" -> "Byte"; + case "char" -> "Char"; + case "short" -> "Short"; + case "int" -> "Int"; + case "long" -> "Long"; + case "float" -> "Float"; + case "double" -> "Double"; + case "void" -> "Unit"; + default -> { String[] parts = type.split("\\."); StringBuilder sb = new StringBuilder(); boolean appendDot = false; @@ -229,8 +211,9 @@ private static String mapJavaTypeToKotlin(String type) { appendDot = true; } } - return sb.toString(); - } + yield sb.toString(); + } + }; } public static boolean isFunctionType(VarType type) { @@ -243,7 +226,7 @@ private static String functionTypeToKotlin(VarType type) { } String paramCount = type.value.substring("kotlin/jvm/functions/Function".length()); - if (paramCount.equals("N") || !(type instanceof GenericType)) { + if (paramCount.equals("N") || !(type instanceof GenericType genericType)) { // TODO: support FunctionN properly String typeStr = ExprProcessor.getCastTypeName(type); if (ExprProcessor.UNDEFINED_TYPE_STRING.equals(typeStr)) { @@ -251,8 +234,7 @@ private static String functionTypeToKotlin(VarType type) { } return mapJavaTypeToKotlin(typeStr); } - - GenericType genericType = (GenericType) type; + List params = genericType.getArguments(); int paramCountInt = Integer.parseInt(paramCount); diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/KUtils.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/KUtils.java index ca0879d7d2..d8c0afca6f 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/KUtils.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/KUtils.java @@ -107,4 +107,13 @@ public static void removeArguments(InvocationExprent expr, VarType toRemove, Var expr.setStringDescriptor(newDesc); } + + public static boolean assertionsEnabled() { + try { + assert false; + return false; + } catch (AssertionError e) { + return true; + } + } } diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/ProtobufFlags.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/ProtobufFlags.java index 8a32ad4edf..4cee41e4e8 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/ProtobufFlags.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/util/ProtobufFlags.java @@ -222,30 +222,20 @@ public Expression(int flags) { //endregion static String toString(ProtoBuf.Visibility visibility) { - switch (visibility) { - case PRIVATE: - case PRIVATE_TO_THIS: - return "private"; - case PROTECTED: - return "protected"; - case INTERNAL: - return "internal"; - default: - return "public"; - } + return switch (visibility) { + case PRIVATE, PRIVATE_TO_THIS -> "private"; + case PROTECTED -> "protected"; + case INTERNAL -> "internal"; + default -> "public"; + }; } static String toString(ProtoBuf.Modality modality) { - switch (modality) { - case FINAL: - return "final"; - case OPEN: - return "open"; - case ABSTRACT: - return "abstract"; - case SEALED: - return "sealed"; - } - throw new IllegalStateException("Unknown modality: " + modality); + return switch (modality) { + case FINAL -> "final"; + case OPEN -> "open"; + case ABSTRACT -> "abstract"; + case SEALED -> "sealed"; + }; } } From 4999386fd2c8101bb746a3bb51e729da86d54fe6 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 19 Apr 2024 14:14:47 -0700 Subject: [PATCH 16/25] Simplify empty anonymous class bodies to `{}` (#381) * Simplify empty anonymous class bodies to `{}` This is typically how people actually write code like this (as can be seen in the existing tests) The improvement is extra noticeable with things like type tokens * Switch to AtomicBoolean and add comments --- .../java/decompiler/main/ClassWriter.java | 40 ++- .../pkg/TestAnonymousClassConstructor.dec | 328 +++++++++--------- .../results/pkg/TestAnonymousClassNaming.dec | 30 +- .../results/pkg/TestAnonymousParamNames.dec | 7 +- .../results/pkg/TestDoubleNestedClass.dec | 79 +++-- 5 files changed, 243 insertions(+), 241 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index a428d0d039..869a20f653 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -1,6 +1,7 @@ // Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.java.decompiler.main; +import java.util.concurrent.atomic.AtomicBoolean; import net.fabricmc.fernflower.api.IFabricJavadocProvider; import org.jetbrains.java.decompiler.api.plugin.StatementWriter; import org.jetbrains.java.decompiler.code.CodeConstants; @@ -377,7 +378,19 @@ public void writeClass(ClassNode node, TextBuffer buffer, int indent) { // write class definition writeClassDefinition(node, buffer, indent); - boolean hasContent = false; + final AtomicBoolean hasContent = new AtomicBoolean(false); + // writeClassDefinition will skip adding a trailing newline for anonymous classes. + // This allows us to only add it if we end up writing any content for the class, so something + // like `new Object() {}` will not have a newline in between `{` and `}`. + // The runnable should be executed immediately before writing any anonymous class content to the buffer. + // hasContent also fills a similar purpose, determining whether elements need an extra newline prepended due to previous content being written. + final Runnable haveContent = () -> { + if (!hasContent.get() && node.type == ClassNode.Type.ANONYMOUS) { + buffer.appendLineSeparator(); + } + hasContent.set(true); + }; + boolean enumFields = false; List components = cl.getRecordComponents(); @@ -443,9 +456,8 @@ else if (enumFields) { TextBuffer fieldBuffer = new TextBuffer(); writeField(wrapper, cl, fd, fieldBuffer, indent + 1); fieldBuffer.clearUnassignedBytecodeMappingData(); + haveContent.run(); buffer.append(fieldBuffer); - - hasContent = true; } if (enumFields) { @@ -472,10 +484,10 @@ else if (enumFields) { TextBuffer methodBuffer = new TextBuffer(); boolean methodSkipped = !writeMethod(node, mt, i, methodBuffer, indent + 1); if (!methodSkipped) { - if (hasContent) { + if (hasContent.get()) { buffer.appendLineSeparator(); } - hasContent = true; + haveContent.run(); buffer.append(methodBuffer); } } @@ -489,16 +501,21 @@ else if (enumFields) { wrapper.getHiddenMembers().contains(innerCl.qualifiedName); if (hide) continue; - if (hasContent) { + if (hasContent.get()) { buffer.appendLineSeparator(); } - writeClass(inner, buffer, indent + 1); - - hasContent = true; + TextBuffer clsBuffer = new TextBuffer(); + writeClass(inner, clsBuffer, indent + 1); + haveContent.run(); + buffer.append(clsBuffer); } } - buffer.appendIndent(indent).append('}'); + if (hasContent.get() || node.type != ClassNode.Type.ANONYMOUS) { + // Skip indent for anonymous classes with no content, since we also skipped the newline in the cls definition + buffer.appendIndent(indent); + } + buffer.append('}'); if (node.type != ClassNode.Type.ANONYMOUS) { buffer.appendLineSeparator(); @@ -622,7 +639,8 @@ private void writeClassDefinition(ClassNode node, TextBuffer buffer, int indent) if (markSynthetics) { appendSyntheticClassComment(cl, buffer); } - buffer.append(" {").appendLineSeparator(); + buffer.append(" {"); + // Omit trailing newline, will be added by the caller if there is any content in the class return; } diff --git a/testData/results/pkg/TestAnonymousClassConstructor.dec b/testData/results/pkg/TestAnonymousClassConstructor.dec index dc88098732..6887f54e87 100644 --- a/testData/results/pkg/TestAnonymousClassConstructor.dec +++ b/testData/results/pkg/TestAnonymousClassConstructor.dec @@ -2,63 +2,51 @@ package pkg; class TestAnonymousClassConstructor { void innerPrivateString() { - new TestAnonymousClassConstructor.InnerPrivateString("text") {// 5 - }; + new TestAnonymousClassConstructor.InnerPrivateString("text") {};// 5 }// 6 void innerPrivate() { - new TestAnonymousClassConstructor.InnerPrivate(3L, 4) {// 9 - }; + new TestAnonymousClassConstructor.InnerPrivate(3L, 4) {};// 9 }// 10 void innerStaticPrivateString() { - new TestAnonymousClassConstructor.InnerStaticPrivateString("text") {// 13 - }; + new TestAnonymousClassConstructor.InnerStaticPrivateString("text") {};// 13 }// 14 void innerStaticPrivate() { - new TestAnonymousClassConstructor.InnerStaticPrivate(3L, 4) {// 17 - }; + new TestAnonymousClassConstructor.InnerStaticPrivate(3L, 4) {};// 17 }// 18 static void innerStaticPrivateStringStatic() { - new TestAnonymousClassConstructor.InnerStaticPrivateString("text") {// 21 - }; + new TestAnonymousClassConstructor.InnerStaticPrivateString("text") {};// 21 }// 22 static void innerStaticPrivateStatic() { - new TestAnonymousClassConstructor.InnerStaticPrivate(3L, 4) {// 25 - }; + new TestAnonymousClassConstructor.InnerStaticPrivate(3L, 4) {};// 25 }// 26 void innerPublicString() { - new TestAnonymousClassConstructor.InnerPublicString("text") {// 29 - }; + new TestAnonymousClassConstructor.InnerPublicString("text") {};// 29 }// 30 void innerPublic() { - new TestAnonymousClassConstructor.InnerPublic(3L, 4) {// 33 - }; + new TestAnonymousClassConstructor.InnerPublic(3L, 4) {};// 33 }// 34 void innerStaticPublicString() { - new TestAnonymousClassConstructor.InnerStaticPublicString("text") {// 37 - }; + new TestAnonymousClassConstructor.InnerStaticPublicString("text") {};// 37 }// 38 void innerStaticPublic() { - new TestAnonymousClassConstructor.InnerStaticPublic(3L, 4) {// 41 - }; + new TestAnonymousClassConstructor.InnerStaticPublic(3L, 4) {};// 41 }// 42 static void innerStaticPublicStringStatic() { - new TestAnonymousClassConstructor.InnerStaticPublicString("text") {// 45 - }; + new TestAnonymousClassConstructor.InnerStaticPublicString("text") {};// 45 }// 46 static void innerStaticPublicStatic() { - new TestAnonymousClassConstructor.InnerStaticPublic(3L, 4) {// 49 - }; + new TestAnonymousClassConstructor.InnerStaticPublic(3L, 4) {};// 49 }// 50 static void n(String s) { @@ -118,105 +106,132 @@ class 'pkg/TestAnonymousClassConstructor' { method 'innerPrivateString ()V' { 5 4 6 4 - b 6 + b 5 } method 'innerPrivate ()V' { - 5 9 - 6 9 - 7 9 - 8 9 - d 11 + 5 8 + 6 8 + 7 8 + 8 8 + d 9 } method 'innerStaticPrivateString ()V' { - 5 14 - 6 14 - b 16 + 5 12 + 6 12 + b 13 } method 'innerStaticPrivate ()V' { - 5 19 - 6 19 - 7 19 - 8 19 - d 21 + 5 16 + 6 16 + 7 16 + 8 16 + d 17 } method 'innerStaticPrivateStringStatic ()V' { - 4 24 - 5 24 - a 26 + 4 20 + 5 20 + a 21 } method 'innerStaticPrivateStatic ()V' { - 4 29 - 5 29 - 6 29 - 7 29 - c 31 + 4 24 + 5 24 + 6 24 + 7 24 + c 25 } method 'innerPublicString ()V' { - 5 34 - 6 34 - b 36 + 5 28 + 6 28 + b 29 } method 'innerPublic ()V' { - 5 39 - 6 39 - 7 39 - 8 39 - d 41 + 5 32 + 6 32 + 7 32 + 8 32 + d 33 } method 'innerStaticPublicString ()V' { - 5 44 - 6 44 - b 46 + 5 36 + 6 36 + b 37 } method 'innerStaticPublic ()V' { - 5 49 - 6 49 - 7 49 - 8 49 - d 51 + 5 40 + 6 40 + 7 40 + 8 40 + d 41 } method 'innerStaticPublicStringStatic ()V' { - 4 54 - 5 54 - a 56 + 4 44 + 5 44 + a 45 } method 'innerStaticPublicStatic ()V' { - 4 59 - 5 59 - 6 59 - 7 59 - c 61 + 4 48 + 5 48 + 6 48 + 7 48 + c 49 } method 'n (Ljava/lang/String;)V' { - 0 64 - 1 64 - 2 64 - a 64 - b 64 - f 64 - 13 64 - 14 64 - 15 64 - 16 64 - 17 64 - 18 64 - 19 65 + 0 52 + 1 52 + 2 52 + a 52 + b 52 + f 52 + 13 52 + 14 52 + 15 52 + 16 52 + 17 52 + 18 52 + 19 53 } } class 'pkg/TestAnonymousClassConstructor$InnerPrivate' { + method ' (Lpkg/TestAnonymousClassConstructor;JI)V' { + 10 57 + 14 57 + 15 57 + 19 57 + 1a 57 + 1e 57 + 1f 57 + 20 57 + 21 57 + 22 57 + 23 57 + 24 58 + } +} + +class 'pkg/TestAnonymousClassConstructor$InnerPrivateString' { + method ' (Lpkg/TestAnonymousClassConstructor;Ljava/lang/String;)V' { + 9 63 + a 63 + b 63 + c 63 + d 64 + } +} + +class 'pkg/TestAnonymousClassConstructor$InnerPublic' { method ' (Lpkg/TestAnonymousClassConstructor;JI)V' { 10 69 14 69 @@ -233,7 +248,7 @@ class 'pkg/TestAnonymousClassConstructor$InnerPrivate' { } } -class 'pkg/TestAnonymousClassConstructor$InnerPrivateString' { +class 'pkg/TestAnonymousClassConstructor$InnerPublicString' { method ' (Lpkg/TestAnonymousClassConstructor;Ljava/lang/String;)V' { 9 75 a 75 @@ -243,34 +258,33 @@ class 'pkg/TestAnonymousClassConstructor$InnerPrivateString' { } } -class 'pkg/TestAnonymousClassConstructor$InnerPublic' { - method ' (Lpkg/TestAnonymousClassConstructor;JI)V' { +class 'pkg/TestAnonymousClassConstructor$InnerStaticPrivate' { + method ' (JI)V' { + b 81 + f 81 10 81 14 81 - 15 81 + 18 81 19 81 1a 81 - 1e 81 - 1f 81 - 20 81 - 21 81 - 22 81 - 23 81 - 24 82 + 1b 81 + 1c 81 + 1d 81 + 1e 82 } } -class 'pkg/TestAnonymousClassConstructor$InnerPublicString' { - method ' (Lpkg/TestAnonymousClassConstructor;Ljava/lang/String;)V' { - 9 87 - a 87 - b 87 - c 87 - d 88 +class 'pkg/TestAnonymousClassConstructor$InnerStaticPrivateString' { + method ' (Ljava/lang/String;)V' { + 4 87 + 5 87 + 6 87 + 7 87 + 8 88 } } -class 'pkg/TestAnonymousClassConstructor$InnerStaticPrivate' { +class 'pkg/TestAnonymousClassConstructor$InnerStaticPublic' { method ' (JI)V' { b 93 f 93 @@ -286,7 +300,7 @@ class 'pkg/TestAnonymousClassConstructor$InnerStaticPrivate' { } } -class 'pkg/TestAnonymousClassConstructor$InnerStaticPrivateString' { +class 'pkg/TestAnonymousClassConstructor$InnerStaticPublicString' { method ' (Ljava/lang/String;)V' { 4 99 5 99 @@ -296,75 +310,49 @@ class 'pkg/TestAnonymousClassConstructor$InnerStaticPrivateString' { } } -class 'pkg/TestAnonymousClassConstructor$InnerStaticPublic' { - method ' (JI)V' { - b 105 - f 105 - 10 105 - 14 105 - 18 105 - 19 105 - 1a 105 - 1b 105 - 1c 105 - 1d 105 - 1e 106 - } -} - -class 'pkg/TestAnonymousClassConstructor$InnerStaticPublicString' { - method ' (Ljava/lang/String;)V' { - 4 111 - 5 111 - 6 111 - 7 111 - 8 112 - } -} - Lines mapping: 5 <-> 5 -6 <-> 7 -9 <-> 10 -10 <-> 12 -13 <-> 15 -14 <-> 17 -17 <-> 20 -18 <-> 22 -21 <-> 25 -22 <-> 27 -25 <-> 30 -26 <-> 32 -29 <-> 35 -30 <-> 37 -33 <-> 40 -34 <-> 42 -37 <-> 45 -38 <-> 47 -41 <-> 50 -42 <-> 52 -45 <-> 55 -46 <-> 57 -49 <-> 60 -50 <-> 62 -53 <-> 65 -54 <-> 66 -58 <-> 76 -59 <-> 77 -64 <-> 70 -65 <-> 71 -70 <-> 100 -71 <-> 101 -76 <-> 94 -77 <-> 95 -82 <-> 88 -83 <-> 89 -88 <-> 82 -89 <-> 83 -94 <-> 112 -95 <-> 113 -100 <-> 106 -101 <-> 107 +6 <-> 6 +9 <-> 9 +10 <-> 10 +13 <-> 13 +14 <-> 14 +17 <-> 17 +18 <-> 18 +21 <-> 21 +22 <-> 22 +25 <-> 25 +26 <-> 26 +29 <-> 29 +30 <-> 30 +33 <-> 33 +34 <-> 34 +37 <-> 37 +38 <-> 38 +41 <-> 41 +42 <-> 42 +45 <-> 45 +46 <-> 46 +49 <-> 49 +50 <-> 50 +53 <-> 53 +54 <-> 54 +58 <-> 64 +59 <-> 65 +64 <-> 58 +65 <-> 59 +70 <-> 88 +71 <-> 89 +76 <-> 82 +77 <-> 83 +82 <-> 76 +83 <-> 77 +88 <-> 70 +89 <-> 71 +94 <-> 100 +95 <-> 101 +100 <-> 94 +101 <-> 95 Not mapped: 57 63 diff --git a/testData/results/pkg/TestAnonymousClassNaming.dec b/testData/results/pkg/TestAnonymousClassNaming.dec index f48d256f3e..c76942ec31 100644 --- a/testData/results/pkg/TestAnonymousClassNaming.dec +++ b/testData/results/pkg/TestAnonymousClassNaming.dec @@ -2,8 +2,7 @@ package pkg; public class TestAnonymousClassNaming { public void run(int i, final String s) throws Exception { - new Object() /* TestAnonymousClassNaming$1 */ { - }; + new Object() /* TestAnonymousClassNaming$1 */ {}; if (i < 0) {// 6 throw new Exception() /* TestAnonymousClassNaming$2 */ {// 7 public String getMessage() { @@ -14,33 +13,32 @@ public class TestAnonymousClassNaming { }// 14 private static class InnerClass { - Object o = new Object() /* TestAnonymousClassNaming$InnerClass$1 */ { - }; + Object o = new Object() /* TestAnonymousClassNaming$InnerClass$1 */ {}; } } class 'pkg/TestAnonymousClassNaming' { method 'run (ILjava/lang/String;)V' { - 9 6 - a 6 - 16 7 - 17 13 + 9 5 + a 5 + 16 6 + 17 12 } } class 'pkg/TestAnonymousClassNaming$2' { method 'getMessage ()Ljava/lang/String;' { - 1 9 - 2 9 - 3 9 - 4 9 + 1 8 + 2 8 + 3 8 + 4 8 } } Lines mapping: -6 <-> 7 -7 <-> 8 -10 <-> 10 -14 <-> 14 +6 <-> 6 +7 <-> 7 +10 <-> 9 +14 <-> 13 Not mapped: 5 diff --git a/testData/results/pkg/TestAnonymousParamNames.dec b/testData/results/pkg/TestAnonymousParamNames.dec index 810799c81b..411b154907 100644 --- a/testData/results/pkg/TestAnonymousParamNames.dec +++ b/testData/results/pkg/TestAnonymousParamNames.dec @@ -1,8 +1,7 @@ package pkg; public class TestAnonymousParamNames { - private final TestAnonymousParamNames.Clazz reference = new TestAnonymousParamNames.Clazz(0L, false) { - }; + private final TestAnonymousParamNames.Clazz reference = new TestAnonymousParamNames.Clazz(0L, false) {}; private class Clazz { public Clazz(long paramL, boolean paramB) { @@ -12,11 +11,11 @@ public class TestAnonymousParamNames { class 'pkg/TestAnonymousParamNames$Clazz' { method ' (Lpkg/TestAnonymousParamNames;JZ)V' { - 9 8 + 9 7 } } Lines mapping: -25 <-> 9 +25 <-> 8 Not mapped: 24 diff --git a/testData/results/pkg/TestDoubleNestedClass.dec b/testData/results/pkg/TestDoubleNestedClass.dec index 1145546598..1418770854 100644 --- a/testData/results/pkg/TestDoubleNestedClass.dec +++ b/testData/results/pkg/TestDoubleNestedClass.dec @@ -20,8 +20,7 @@ public abstract class TestDoubleNestedClass { private static final TestDoubleNestedClass INNER2 = new TestDoubleNestedClass() { @Override Object test() { - return new Object() { - }; + return new Object() {}; } }; @@ -70,52 +69,52 @@ class 'pkg/TestDoubleNestedClass$2' { class 'pkg/TestDoubleNestedClass$Child1' { method 'foo (I)Ljava/util/function/Supplier;' { - 0 33 - 1 33 - 2 33 - b 34 + 0 32 + 1 32 + 2 32 + b 33 } method 'lambda$foo$0 (II)Lpkg/TestDoubleNestedClass;' { - a 34 + a 33 } } class 'pkg/TestDoubleNestedClass$Child1$1' { method 'test ()Ljava/lang/Object;' { - 1 37 - 2 37 - 3 37 - 4 37 - 5 37 - 6 37 - 8 37 - 9 37 - a 37 - b 37 - c 37 - e 38 - f 38 - 10 38 - 12 38 - 13 38 - 14 38 - 15 38 - 16 38 - 18 39 - 19 39 - 1a 39 - 1b 39 - 1c 39 - 1d 39 - 1e 39 - 1f 39 - 20 39 - 21 39 - 22 39 - 23 39 - 24 39 - 25 39 + 1 36 + 2 36 + 3 36 + 4 36 + 5 36 + 6 36 + 8 36 + 9 36 + a 36 + b 36 + c 36 + e 37 + f 37 + 10 37 + 12 37 + 13 37 + 14 37 + 15 37 + 16 37 + 18 38 + 19 38 + 1a 38 + 1b 38 + 1c 38 + 1d 38 + 1e 38 + 1f 38 + 20 38 + 21 38 + 22 38 + 23 38 + 24 38 + 25 38 } } From e54ccfd469d8743cc3c3d974fbd8da0f3a41e229 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Tue, 23 Apr 2024 10:50:52 -0700 Subject: [PATCH 17/25] Fix indent on 'simple' switch branches (#382) --- .../decompiler/exps/SwitchExprent.java | 6 +- .../java/decompiler/SingleClassesTest.java | 1 + .../results/pkg/TestSwitchSimpleMultiLine.dec | 74 +++++++++++++++++++ .../java21/pkg/TestSwitchSimpleMultiLine.java | 22 ++++++ 4 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 testData/results/pkg/TestSwitchSimpleMultiLine.dec create mode 100644 testData/src/java21/pkg/TestSwitchSimpleMultiLine.java diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/SwitchExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/SwitchExprent.java index b3a051cf20..9cf79a2e2a 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/SwitchExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/SwitchExprent.java @@ -148,17 +148,17 @@ public TextBuffer toJava(int indent) { ((ConstExprent)content).setConstType(this.type); } - buf.append(content.toJava(indent).append(";")); + buf.append(content.toJava(indent + 1).append(";")); } else if (exprent instanceof ExitExprent) { ExitExprent exit = (ExitExprent) exprent; if (exit.getExitType() == ExitExprent.Type.THROW) { - buf.append(exit.toJava(indent).append(";")); + buf.append(exit.toJava(indent + 1).append(";")); } else { throw new IllegalStateException("Can't have return in switch expression"); } } else { // Catchall - buf.append(exprent.toJava(indent).append(";")); + buf.append(exprent.toJava(indent + 1).append(";")); } } else { buf.append("{"); diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index 0dba1d9375..3b969261fb 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -697,6 +697,7 @@ private void registerDefault() { register(JAVA_8, "TestNumberDisambiguation"); register(JAVA_8, "TestDanglingBoxingCall"); register(JAVA_21, "TestSwitchOnEnumJ21", "ext/TestEnum2"); + register(JAVA_21, "TestSwitchSimpleMultiLine"); register(JAVA_21, "TestInnerClassesJ21"); register(JAVA_21, "TestInnerClasses2J21"); register(JAVA_21, "TestInnerClasses3J21"); diff --git a/testData/results/pkg/TestSwitchSimpleMultiLine.dec b/testData/results/pkg/TestSwitchSimpleMultiLine.dec new file mode 100644 index 0000000000..29ef04249d --- /dev/null +++ b/testData/results/pkg/TestSwitchSimpleMultiLine.dec @@ -0,0 +1,74 @@ +package pkg; + +import java.util.Random; +import java.util.function.Predicate; + +public class TestSwitchSimpleMultiLine { + public static Predicate predicates() { + int i = new Random().nextInt();// 8 + + return switch (i) {// 9 + case 0 -> object -> true;// 10 + case 1 -> object -> false;// 11 + default -> object -> { + boolean r1 = new Random().nextBoolean();// 13 + boolean r2 = new Random().nextBoolean();// 14 + return r1 && r2 ? true : new Random().nextBoolean();// 15 16 18 + }; + }; + } +} + +class 'pkg/TestSwitchSimpleMultiLine' { + method 'predicates ()Ljava/util/function/Predicate;' { + 7 7 + 8 7 + 9 7 + a 7 + b 9 + c 9 + 3d 9 + } + + method 'lambda$predicates$0 (Ljava/lang/Object;)Z' { + 0 10 + 1 10 + } + + method 'lambda$predicates$1 (Ljava/lang/Object;)Z' { + 0 11 + 1 11 + } + + method 'lambda$predicates$2 (Ljava/lang/Object;)Z' { + 7 13 + 8 13 + 9 13 + a 13 + 12 14 + 13 14 + 14 14 + 15 14 + 16 15 + 17 15 + 1a 15 + 1b 15 + 1e 15 + 27 15 + 28 15 + 29 15 + } +} + +Lines mapping: +8 <-> 8 +9 <-> 10 +10 <-> 11 +11 <-> 12 +13 <-> 14 +14 <-> 15 +15 <-> 16 +16 <-> 16 +18 <-> 16 +Not mapped: +12 diff --git a/testData/src/java21/pkg/TestSwitchSimpleMultiLine.java b/testData/src/java21/pkg/TestSwitchSimpleMultiLine.java new file mode 100644 index 0000000000..0d7bbc8d6b --- /dev/null +++ b/testData/src/java21/pkg/TestSwitchSimpleMultiLine.java @@ -0,0 +1,22 @@ +package pkg; + +import java.util.Random; +import java.util.function.Predicate; + +public class TestSwitchSimpleMultiLine { + public static Predicate predicates() { + int i = new Random().nextInt(); + return switch (i) { + case 0 -> object -> true; + case 1 -> object -> false; + default -> object -> { + final boolean r1 = new Random().nextBoolean(); + final boolean r2 = new Random().nextBoolean(); + if (r1 && r2) { + return true; + } + return new Random().nextBoolean(); + }; + }; + } +} From e9ce490441882198eb3a35ff2d42f73a8568c7ca Mon Sep 17 00:00:00 2001 From: EpicPlayerA10 <62206933+EpicPlayerA10@users.noreply.github.com> Date: Wed, 1 May 2024 00:34:47 +0200 Subject: [PATCH 18/25] Fix breaking decompile switch-on-enum when enum does not exist in classpath (#384) --- .../modules/decompiler/SwitchHelper.java | 16 +++++--- .../java/decompiler/SingleClassesTest.java | 2 + .../TestSwitchOnEnumWithoutEnumJ21.class | Bin 0 -> 804 bytes .../TestSwitchOnEnumWithoutEnumJ21.dec | 36 ++++++++++++++++++ 4 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 testData/classes/custom/TestSwitchOnEnumWithoutEnumJ21.class create mode 100644 testData/results/TestSwitchOnEnumWithoutEnumJ21.dec diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchHelper.java index 393aa16942..a1689a9905 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchHelper.java @@ -10,12 +10,12 @@ import org.jetbrains.java.decompiler.modules.decompiler.exps.*; import org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent.FunctionType; import org.jetbrains.java.decompiler.modules.decompiler.stats.*; +import org.jetbrains.java.decompiler.struct.StructClass; import org.jetbrains.java.decompiler.struct.StructField; import org.jetbrains.java.decompiler.struct.StructMethod; import org.jetbrains.java.decompiler.struct.gen.FieldDescriptor; import org.jetbrains.java.decompiler.struct.gen.TypeFamily; import org.jetbrains.java.decompiler.struct.gen.VarType; -import org.jetbrains.java.decompiler.util.DotExporter; import org.jetbrains.java.decompiler.util.Pair; import java.util.*; @@ -38,7 +38,7 @@ public static boolean simplifySwitches(Statement stat, StructMethod mt, RootStat } private static boolean simplify(SwitchStatement switchStatement, StructMethod mt, RootStatement root) { - if (simplifyNewEnumSwitch(switchStatement)) { + if (simplifySwitchOnEnumJ21(switchStatement, root)) { return true; } @@ -285,7 +285,7 @@ private static boolean simplify(SwitchStatement switchStatement, StructMethod mt return false; } - private static boolean simplifyNewEnumSwitch(SwitchStatement switchSt) { + private static boolean simplifySwitchOnEnumJ21(SwitchStatement switchSt, RootStatement root) { SwitchHeadExprent head = (SwitchHeadExprent) switchSt.getHeadexprent(); Exprent inner = head.getValue(); @@ -313,14 +313,18 @@ private static boolean simplifyNewEnumSwitch(SwitchStatement switchSt) { if (inner instanceof InvocationExprent && ((InvocationExprent) inner).getName().equals("ordinal")) { InvocationExprent invInner = (InvocationExprent) inner; - ClassesProcessor.ClassNode classNode = DecompilerContext.getClassProcessor().getMapRootClasses().get(invInner.getClassname()); + StructClass classStruct = DecompilerContext.getStructContext().getClass(invInner.getClassname()); + if (classStruct == null) { + root.addComment("$VF: Unable to simplify switch-on-enum, as the enum class was not able to be found.", true); + return false; + } // Check for enum - if ((classNode.classStruct.getAccessFlags() & CodeConstants.ACC_ENUM) == CodeConstants.ACC_ENUM) { + if ((classStruct.getAccessFlags() & CodeConstants.ACC_ENUM) == CodeConstants.ACC_ENUM) { List enumNames = new ArrayList<>(); // Capture fields - for (StructField fd : classNode.classStruct.getFields()) { + for (StructField fd : classStruct.getFields()) { if ((fd.getAccessFlags() & CodeConstants.ACC_ENUM) == CodeConstants.ACC_ENUM) { enumNames.add(fd.getName()); } diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index 3b969261fb..0a64ce4f98 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -697,6 +697,8 @@ private void registerDefault() { register(JAVA_8, "TestNumberDisambiguation"); register(JAVA_8, "TestDanglingBoxingCall"); register(JAVA_21, "TestSwitchOnEnumJ21", "ext/TestEnum2"); + // Test switch-on-enum decompilation when enum does not exist in the classpath + registerRaw(CUSTOM, "TestSwitchOnEnumWithoutEnumJ21"); register(JAVA_21, "TestSwitchSimpleMultiLine"); register(JAVA_21, "TestInnerClassesJ21"); register(JAVA_21, "TestInnerClasses2J21"); diff --git a/testData/classes/custom/TestSwitchOnEnumWithoutEnumJ21.class b/testData/classes/custom/TestSwitchOnEnumWithoutEnumJ21.class new file mode 100644 index 0000000000000000000000000000000000000000..85fe0906c16441302be3b35298a10b0ede63f9de GIT binary patch literal 804 zcma)4-)|B@5dMa{6HWBpKgu|J5bG1V$?nX2GxN>N?*9Ds^*ewUSPzkdMAx~I667NKFEc9V> ze|RKgL&!fY-VAVEsnNY8GF2Z^yRr;{?7t$Z4$*CBQ zWve#uafPt9xFdqQlN?CGN=IqAH$5K8v~TkX#ZD57@j#@?+H=q~BQ+sZI*Vyr1kdoS z8-yp-f5iT|lvb@xAVH}8cLt%*Ga`Q56({os!(K8?WBF3q5!M%X*|0ZBSl;7KyV8!% zqeX44Wx6vKlZj+AuoU*ma1TZP8+PTu;~~%IRkoTeiKSOR2Yt@m*Z8z<@GkKg%>r;8 z0phUgqCKio3}-WlBdC&nGvS|x7B z>UCyou)fLFpR#RhmuCF)+Q1fWaRtI1_66`NOOCV6pAc(o=WrJlmM;4P9vBESt%&>E F<=?fDw5I?7 literal 0 HcmV?d00001 diff --git a/testData/results/TestSwitchOnEnumWithoutEnumJ21.dec b/testData/results/TestSwitchOnEnumWithoutEnumJ21.dec new file mode 100644 index 0000000000..125643b359 --- /dev/null +++ b/testData/results/TestSwitchOnEnumWithoutEnumJ21.dec @@ -0,0 +1,36 @@ +import TestSwitchOnEnumWithoutEnumJ21.TestEnum; + +public class TestSwitchOnEnumWithoutEnumJ21 { + // $VF: Unable to simplify switch-on-enum, as the enum class was not able to be found. + public int test1(TestEnum a) { + return switch (a.ordinal()) {// 3 + case 0 -> 1;// 4 + case 1 -> 2;// 5 + case 2 -> 3;// 6 + default -> throw new MatchException(null, null); + }; + } +} + +class 'TestSwitchOnEnumWithoutEnumJ21' { + method 'test1 (LTestSwitchOnEnumWithoutEnumJ21$TestEnum;)I' { + 0 5 + 1 5 + 2 5 + 3 5 + 4 5 + 24 9 + 25 9 + 29 9 + 2a 6 + 2e 7 + 32 8 + 33 5 + } +} + +Lines mapping: +3 <-> 6 +4 <-> 7 +5 <-> 8 +6 <-> 9 From fa6317a28d63ce66e522b1d72667d55909463168 Mon Sep 17 00:00:00 2001 From: Jasmine Karthikeyan <25208576+jaskarth@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:25:28 -0400 Subject: [PATCH 19/25] Map all bytecode in range (#386) --- .../testData/results/TestIdeaNotNull.dec | 14 + .../testData/results/pkg/TestAnyType.dec | 2 + .../testData/results/pkg/TestComparison.dec | 8 + .../results/pkg/TestCompileTimeErrors.dec | 4 + .../testData/results/pkg/TestContracts.dec | 16 + .../testData/results/pkg/TestDataClass.dec | 24 ++ .../testData/results/pkg/TestDestructors.dec | 29 +- .../testData/results/pkg/TestForRange.dec | 62 +++ .../testData/results/pkg/TestIfRange.dec | 76 ++++ .../testData/results/pkg/TestLabeledJumps.dec | 14 + .../results/pkg/TestNothingReturns.dec | 4 + .../results/pkg/TestNullableOperator.dec | 52 +-- .../testData/results/pkg/TestParams.dec | 2 + .../testData/results/pkg/TestSafeCasts.dec | 52 +++ .../testData/results/pkg/TestShadowParam.dec | 4 + .../testData/results/pkg/TestSmartCasts.dec | 46 ++ .../testData/results/pkg/TestSynchronized.dec | 7 - .../results/pkg/TestTailrecFunctions.dec | 30 +- .../results/pkg/TestTryCatchExpressions.dec | 16 + .../results/pkg/TestTryFinallyExpressions.dec | 114 ++--- .../kotlin/testData/results/pkg/TestVars.dec | 4 + .../kotlin/testData/results/pkg/TestWhen.dec | 60 +++ .../testData/results/pkg/TestWhenBoolean.dec | 38 ++ .../results/pkg/TestWhenControlFlow.dec | 12 + .../testData/results/TestJadLvtCollision.dec | 2 +- .../testData/results/pkg/TestJADNaming.dec | 10 +- .../testData/results/pkg/TestTinyNaming.dec | 2 +- .../modules/decompiler/ExprProcessor.java | 6 +- .../java/decompiler/SingleClassesTest.java | 1 - testData/results/Java14Test.dec | 6 + testData/results/JsHurt.dec | 7 + testData/results/TestEclipseSwitchEnum.dec | 29 ++ testData/results/TestEclipseSwitchString.dec | 190 ++++++++- testData/results/TestHotjava.dec | 12 +- testData/results/TestIdeaNotNull.dec | 58 +++ testData/results/TestJsr.dec | 4 +- testData/results/TestJsr2.dec | 4 + .../TestSwitchOnEnumWithoutEnumJ21.dec | 29 +- .../pkg/TestAccidentalSwitchExpression.dec | 28 ++ .../results/pkg/TestAmbiguousArraylen.dec | 6 + testData/results/pkg/TestAmbiguousCall.dec | 8 + testData/results/pkg/TestAnonymousClass.dec | 6 +- .../results/pkg/TestAnonymousClassNaming.dec | 2 + testData/results/pkg/TestArrayAssign.dec | 16 + testData/results/pkg/TestArrayAssign2.dec | 4 + testData/results/pkg/TestArrayCopy.dec | 2 + testData/results/pkg/TestArrayDoWhile.dec | 2 + testData/results/pkg/TestArrayFieldAccess.dec | 10 + .../results/pkg/TestArrayFieldAccess1.dec | 10 + testData/results/pkg/TestArrayTernary.dec | 14 + testData/results/pkg/TestAssertJ16.dec | 2 + testData/results/pkg/TestAssertMerge.dec | 6 + .../pkg/TestAssertSwitchExpression.dec | 28 ++ testData/results/pkg/TestAsserts.dec | 6 + .../results/pkg/TestAssignmentInDoWhile.dec | 28 ++ testData/results/pkg/TestAssignmentInLoop.dec | 8 + .../pkg/TestAssignmentSwitchExpression1.dec | 62 +++ .../pkg/TestAssignmentSwitchExpression2.dec | 62 +++ .../pkg/TestAssignmentSwitchExpression3.dec | 78 ++++ .../pkg/TestAssignmentSwitchExpression4.dec | 38 ++ .../pkg/TestAssignmentSwitchExpression5.dec | 40 +- .../pkg/TestAssignmentSwitchExpression6.dec | 40 +- .../pkg/TestAssignmentSwitchExpression7.dec | 27 ++ ...ssignmentTernaryConstantSimplification.dec | 26 ++ .../pkg/TestBackwardsExceptionHandler.dec | 4 + .../pkg/TestBinaryOperationWrapping.dec | 60 +++ testData/results/pkg/TestBlankLinesSpaces.dec | 6 + .../results/pkg/TestBooleanAssignment.dec | 4 + .../results/pkg/TestBooleanExpressions.dec | 6 + .../pkg/TestBooleanSwitchExpression1.dec | 68 +++ .../pkg/TestBooleanSwitchExpression2.dec | 98 +++++ .../pkg/TestBooleanSwitchExpression3.dec | 90 ++++ .../pkg/TestBooleanSwitchExpression4.dec | 138 ++++++ .../pkg/TestBooleanSwitchExpression5.dec | 96 +++++ testData/results/pkg/TestCaseClasses.dec | 119 +++++- .../results/pkg/TestCastObjectToPrimitive.dec | 16 + testData/results/pkg/TestChainedCFG.dec | 18 + testData/results/pkg/TestClassCast.dec | 2 + testData/results/pkg/TestClassLambda.dec | 4 + testData/results/pkg/TestClassLoop.dec | 32 ++ .../pkg/TestClassSimpleBytecodeMapping.dec | 6 + testData/results/pkg/TestClassSwitch.dec | 111 +++++ testData/results/pkg/TestClassTypes.dec | 56 +++ testData/results/pkg/TestClassVar.dec | 20 + testData/results/pkg/TestCollectionItr.dec | 2 +- .../results/pkg/TestComplexIfElseChain.dec | 349 +++++++++++++++- .../results/pkg/TestCompoundAssignment.dec | 20 + .../pkg/TestCompoundAssignmentReplace.dec | 2 + testData/results/pkg/TestConstType.dec | 100 +++++ .../pkg/TestConstructorSwitchExpression1.dec | 30 ++ .../pkg/TestConstructorSwitchExpression2.dec | 9 + .../pkg/TestConstructorSwitchExpression3.dec | 51 +++ .../results/pkg/TestDanglingBoxingCall.dec | 2 + .../results/pkg/TestDefiniteAssignment.dec | 86 ++++ testData/results/pkg/TestDoWhileMerge.dec | 26 ++ testData/results/pkg/TestDoWhileTrue.dec | 2 + testData/results/pkg/TestDoubleForeach.dec | 4 + .../results/pkg/TestDoublePopAfterJump.dec | 14 + .../TestDuplicateAssignmentInSwitchExpr.dec | 18 + .../results/pkg/TestDuplicateSwitchLocals.dec | 38 ++ testData/results/pkg/TestEmptyBlocks.dec | 4 + testData/results/pkg/TestEnum.dec | 51 +++ testData/results/pkg/TestExceptionElse.dec | 16 + .../results/pkg/TestFieldSingleAccess.dec | 4 + .../pkg/TestFinallyBlockVariableUse.dec | 10 + testData/results/pkg/TestFinallyThrow.dec | 12 + .../TestFloatInvertedIfConditionEarlyExit.dec | 6 + testData/results/pkg/TestForContinue.dec | 6 + testData/results/pkg/TestForCyclicVarDef.dec | 2 + .../pkg/TestForeachMultiDimensionalArray.dec | 17 + .../results/pkg/TestForeachMultipleLoops.dec | 38 +- testData/results/pkg/TestForeachVardef.dec | 8 + testData/results/pkg/TestGenericArrays.dec | 2 +- testData/results/pkg/TestGenericCastCall.dec | 8 + testData/results/pkg/TestGenericCasts.dec | 10 +- .../results/pkg/TestGenericComparison.dec | 4 +- .../results/pkg/TestGenericObjectType.dec | 2 +- .../results/pkg/TestGenericSubclassTypes.dec | 2 +- testData/results/pkg/TestGenericSuper.dec | 2 +- testData/results/pkg/TestGenericWildcard.dec | 6 +- testData/results/pkg/TestGenerics.dec | 2 +- .../results/pkg/TestGenericsHierarchy.dec | 4 +- .../pkg/TestGenericsInvocUnchecked.dec | 2 +- testData/results/pkg/TestGenericsTernary.dec | 4 + testData/results/pkg/TestGroovyClass.dec | 6 + testData/results/pkg/TestGroovyTryCatch.dec | 2 + testData/results/pkg/TestIfElseSwitch.dec | 51 +++ testData/results/pkg/TestIfElseTernary1.dec | 164 ++++++++ .../results/pkg/TestIfElseTernary1J17.dec | 164 ++++++++ testData/results/pkg/TestIfLoop.dec | 36 ++ .../results/pkg/TestIfPatternMatchMethod.dec | 12 + testData/results/pkg/TestIfTernary1.dec | 148 +++++++ testData/results/pkg/TestIfTernary1J17.dec | 148 +++++++ testData/results/pkg/TestIfTernary2.dec | 50 +++ testData/results/pkg/TestIfTernary3.dec | 8 + testData/results/pkg/TestIfTernaryReturn.dec | 12 + .../results/pkg/TestIffSimplification.dec | 22 + .../results/pkg/TestIllegalMethodNames.dec | 2 + testData/results/pkg/TestInUse.dec | 2 + testData/results/pkg/TestInfiniteLoop.dec | 10 + .../results/pkg/TestInlineAssignments.dec | 6 + .../results/pkg/TestInlineNoSuccessor.dec | 14 + .../pkg/TestInlineSwitchExpression1.dec | 36 ++ .../pkg/TestInlineSwitchExpression2.dec | 35 ++ .../pkg/TestInlineSwitchExpression3.dec | 36 ++ .../pkg/TestInlineSwitchExpression4.dec | 22 + .../pkg/TestInlineSwitchExpression5.dec | 29 ++ .../pkg/TestInlineSwitchExpression6.dec | 22 +- testData/results/pkg/TestInnerClasses2J21.dec | 2 +- testData/results/pkg/TestInnerClassesJ21.dec | 2 +- testData/results/pkg/TestInstanceGeneric.dec | 2 +- testData/results/pkg/TestIntBoolMerge.dec | 4 +- .../pkg/TestInvertedFloatComparison.dec | 32 ++ testData/results/pkg/TestIrreducible.dec | 10 + .../TestIterationOverGenericsWithoutLvt.dec | 7 + testData/results/pkg/TestItrLoop.dec | 2 +- .../results/pkg/TestKotlinConstructorKt.dec | 2 + testData/results/pkg/TestKotlinEnumWhen.dec | 194 +++++++++ testData/results/pkg/TestLabeledBreaks.dec | 20 + .../results/pkg/TestLambdaGenericCall.dec | 2 +- .../results/pkg/TestLambdaLocalCapture.dec | 4 + testData/results/pkg/TestListEquals.dec | 2 + .../results/pkg/TestLocalClassesSwitch.dec | 56 +++ testData/results/pkg/TestLocalEnum.dec | 4 + testData/results/pkg/TestLocalScopeClash.dec | 4 + testData/results/pkg/TestLocalScopes.dec | 4 + .../results/pkg/TestLocalVariableMerge.dec | 16 + .../pkg/TestLocalVariableMergeSwitch.dec | 27 ++ testData/results/pkg/TestLocalsNames.dec | 4 + testData/results/pkg/TestLoopBreak.dec | 4 + testData/results/pkg/TestLoopBreak2.dec | 4 + testData/results/pkg/TestLoopBreak3.dec | 10 + testData/results/pkg/TestLoopBreak4.dec | 18 + .../results/pkg/TestLoopBreakException.dec | 6 + testData/results/pkg/TestLoopFinally.dec | 67 +++ testData/results/pkg/TestLoopMerging2.dec | 12 +- testData/results/pkg/TestLoopReturn.dec | 24 ++ .../pkg/TestMixedCompoundAssignment.dec | 8 + testData/results/pkg/TestMultiBoolean.dec | 32 ++ .../results/pkg/TestMultipleStaticBlocks.dec | 8 + .../results/pkg/TestNamedSuspendFun2Kt.dec | 160 ++++--- testData/results/pkg/TestNestedFor.dec | 4 + testData/results/pkg/TestNestedLambdas.dec | 4 + testData/results/pkg/TestNestedLoops.dec | 12 + testData/results/pkg/TestNestedLoops2.dec | 4 + .../results/pkg/TestNestedTernaryAssign.dec | 44 ++ .../pkg/TestNestedTernaryCondition.dec | 7 + testData/results/pkg/TestNextGaussian.dec | 4 + testData/results/pkg/TestNoUse.dec | 10 + testData/results/pkg/TestObject.dec | 4 + testData/results/pkg/TestObjectBitwise.dec | 20 + testData/results/pkg/TestObjectPhi.dec | 2 + testData/results/pkg/TestOldECJInner.dec | 4 + testData/results/pkg/TestPPMMLoop.dec | 8 + testData/results/pkg/TestPPMMPhi.dec | 2 + testData/results/pkg/TestPatternMatching.dec | 58 ++- .../results/pkg/TestPatternMatching17.dec | 98 ++++- .../pkg/TestPatternMatching17AlreadyUsed.dec | 74 +++- .../results/pkg/TestPatternMatching17Fake.dec | 70 +++- .../pkg/TestPatternMatching17FakeLoops.dec | 58 +++ ...TestPatternMatching17FakeLoopsInverted.dec | 117 +++++- .../pkg/TestPatternMatching17FakeNew.dec | 124 +++++- .../results/pkg/TestPatternMatchingAssign.dec | 4 + .../pkg/TestPatternMatchingCompoundBool.dec | 6 + .../results/pkg/TestPatternMatchingFake.dec | 70 +++- .../pkg/TestPatternMatchingFakeLoops.dec | 58 +++ .../TestPatternMatchingFakeLoopsInverted.dec | 117 +++++- .../pkg/TestPatternMatchingFakeNew.dec | 124 +++++- .../results/pkg/TestPatternMatchingInline.dec | 8 + .../pkg/TestPatternMatchingInteger.dec | 26 ++ .../pkg/TestPatternMatchingLocalCapture.dec | 2 + .../results/pkg/TestPatternMatchingMerge.dec | 4 + .../results/pkg/TestPatternMatchingStatic.dec | 4 + testData/results/pkg/TestPiDivision.dec | 2 + testData/results/pkg/TestPrimitives.dec | 26 ++ .../pkg/TestRecordCanonicalConstructor.dec | 2 + .../pkg/TestRecordCanonicalConstructor2.dec | 6 + testData/results/pkg/TestRecordPattern1.dec | 58 +++ testData/results/pkg/TestRecordPattern2.dec | 113 ++++- testData/results/pkg/TestRecordPattern3.dec | 6 + testData/results/pkg/TestRecordPattern4.dec | 38 ++ testData/results/pkg/TestRecordPatterns1.dec | 40 +- testData/results/pkg/TestRecordPatterns2.dec | 6 + testData/results/pkg/TestReturnIf.dec | 12 + .../pkg/TestReturnSwitchExpression1.dec | 27 ++ .../pkg/TestReturnSwitchExpression2.dec | 53 +++ .../pkg/TestReturnSwitchExpression3.dec | 28 ++ .../pkg/TestReturnSwitchExpression4.dec | 29 ++ .../pkg/TestReturnSwitchExpression5.dec | 26 ++ .../results/pkg/TestReturnTernaryChar.dec | 10 + ...estReturnTernaryConstantSimplification.dec | 26 ++ testData/results/pkg/TestRunSuspend.dec | 2 + testData/results/pkg/TestSelfIterableLoop.dec | 2 + testData/results/pkg/TestShiftLoop.dec | 2 + testData/results/pkg/TestSimpleIf.dec | 8 + testData/results/pkg/TestSimpleWhile.dec | 2 + .../results/pkg/TestSingleCaseStrSwitch.dec | 40 ++ .../results/pkg/TestSplitColorComponents.dec | 2 + .../results/pkg/TestStaticBlockFinalField.dec | 2 +- testData/results/pkg/TestStringConcat.dec | 2 +- testData/results/pkg/TestStringLiteral.dec | 4 + testData/results/pkg/TestSuspendLambdaKt.dec | 19 + testData/results/pkg/TestSwitchAssign.dec | 67 +++ .../results/pkg/TestSwitchDefaultBefore.dec | 61 +++ .../pkg/TestSwitchDefaultCaseReturn.dec | 61 +++ testData/results/pkg/TestSwitchExprInvoc.dec | 27 ++ .../results/pkg/TestSwitchExprString1.dec | 44 ++ .../pkg/TestSwitchExpressionFallthrough1.dec | 32 ++ .../pkg/TestSwitchExpressionNested1.dec | 54 +++ .../results/pkg/TestSwitchExpressionPPMM.dec | 30 ++ testData/results/pkg/TestSwitchFinally.dec | 203 +++++---- testData/results/pkg/TestSwitchInTry.dec | 34 ++ testData/results/pkg/TestSwitchLoop.dec | 394 ++++++++++++++++++ testData/results/pkg/TestSwitchOnEnum.dec | 82 ++++ testData/results/pkg/TestSwitchOnEnumJ21.dec | 227 ++++++++++ testData/results/pkg/TestSwitchOnStrings.dec | 95 +++++ .../results/pkg/TestSwitchOnlyDefault.dec | 20 + .../pkg/TestSwitchPatternMatching1.dec | 29 ++ .../pkg/TestSwitchPatternMatching10.dec | 26 ++ .../pkg/TestSwitchPatternMatching11.dec | 25 ++ .../pkg/TestSwitchPatternMatching12.dec | 49 +++ .../pkg/TestSwitchPatternMatching13.dec | 44 ++ .../pkg/TestSwitchPatternMatching14.dec | 32 ++ .../pkg/TestSwitchPatternMatching15.dec | 35 ++ .../pkg/TestSwitchPatternMatching16.dec | 118 ++++-- .../pkg/TestSwitchPatternMatching17.dec | 48 +++ .../pkg/TestSwitchPatternMatching18.dec | 91 ++++ .../pkg/TestSwitchPatternMatching19.dec | 68 +++ .../pkg/TestSwitchPatternMatching2.dec | 24 ++ .../pkg/TestSwitchPatternMatching20.dec | 33 +- .../pkg/TestSwitchPatternMatching21.dec | 97 +++++ .../pkg/TestSwitchPatternMatching22.dec | 129 +++++- .../pkg/TestSwitchPatternMatching3.dec | 18 + .../pkg/TestSwitchPatternMatching4.dec | 11 + .../pkg/TestSwitchPatternMatching5.dec | 32 ++ .../pkg/TestSwitchPatternMatching6.dec | 47 +++ .../pkg/TestSwitchPatternMatching7.dec | 16 + .../pkg/TestSwitchPatternMatching8.dec | 25 ++ .../pkg/TestSwitchPatternMatching9.dec | 31 ++ .../TestSwitchPatternMatchingConstructor1.dec | 27 ++ .../TestSwitchPatternMatchingConstructor2.dec | 28 ++ .../pkg/TestSwitchPatternMatchingFuzz1.dec | 19 + .../TestSwitchPatternMatchingInstanceof1.dec | 36 +- .../TestSwitchPatternMatchingInstanceof2.dec | 36 +- .../TestSwitchPatternMatchingInstanceof3.dec | 31 ++ .../TestSwitchPatternMatchingInstanceof4.dec | 31 +- .../pkg/TestSwitchPatternMatchingLoop.dec | 29 ++ .../pkg/TestSwitchPatternMatchingReturn1.dec | 27 ++ .../pkg/TestSwitchPatternMatchingReturn2.dec | 29 ++ .../pkg/TestSwitchPatternMatchingWithNull.dec | 64 ++- testData/results/pkg/TestSwitchReturn.dec | 58 +++ .../results/pkg/TestSwitchSimpleMultiLine.dec | 31 ++ .../pkg/TestSwitchStringHashcodeCollision.dec | 29 +- testData/results/pkg/TestSwitchTernary.dec | 95 +++++ testData/results/pkg/TestSynchronized.dec | 28 ++ testData/results/pkg/TestSynchronizedLoop.dec | 26 +- .../results/pkg/TestSynchronizedTernary.dec | 2 + .../results/pkg/TestSynchronizedThrow.dec | 6 + testData/results/pkg/TestSynchronizedTry.dec | 22 + .../results/pkg/TestSynchronizedTryReturn.dec | 2 + .../pkg/TestSynchronizedTrySharing.dec | 4 + .../pkg/TestSynchronizedUnprotected.dec | 7 - testData/results/pkg/TestTempAssign.dec | 2 + testData/results/pkg/TestTernaryAssign.dec | 2 + testData/results/pkg/TestTernaryCall.dec | 12 + testData/results/pkg/TestTernaryReturn.dec | 10 + testData/results/pkg/TestTernaryReturn2.dec | 5 + testData/results/pkg/TestTextTokens3.dec | 24 ++ testData/results/pkg/TestThrowException.dec | 2 + testData/results/pkg/TestThrowLoop.dec | 14 + testData/results/pkg/TestTryCatchFinally.dec | 27 +- testData/results/pkg/TestTryCatchNested.dec | 2 + testData/results/pkg/TestTryFinally.dec | 24 +- testData/results/pkg/TestTryLoop.dec | 4 + testData/results/pkg/TestTryLoop2.dec | 2 + testData/results/pkg/TestTryLoopNoCatch.dec | 6 + testData/results/pkg/TestTryLoopRecompile.dec | 4 + .../results/pkg/TestTryLoopReturnFinally.dec | 6 + .../results/pkg/TestTryLoopSimpleFinally.dec | 14 +- testData/results/pkg/TestTryReturn.dec | 96 +++-- testData/results/pkg/TestTryReturnNoDebug.dec | 2 + testData/results/pkg/TestTrySplit.dec | 10 +- testData/results/pkg/TestTrySynchronized.dec | 4 + testData/results/pkg/TestTryVar.dec | 4 + testData/results/pkg/TestTryVarNoDebug.dec | 4 + .../pkg/TestTryWithResourcesAfterSwitch.dec | 50 +++ .../TestTryWithResourcesCatchFinallyJ16.dec | 8 + .../pkg/TestTryWithResourcesCatchJ16.dec | 12 + .../results/pkg/TestTryWithResourcesFake.dec | 8 + .../pkg/TestTryWithResourcesFakeTrigger.dec | 16 + .../pkg/TestTryWithResourcesFinallyJ16.dec | 4 + .../results/pkg/TestTryWithResourcesJ16.dec | 26 +- .../pkg/TestTryWithResourcesLoopJ16.dec | 12 + .../pkg/TestTryWithResourcesManyJ16.dec | 26 +- .../pkg/TestTryWithResourcesMultiJ16.dec | 28 +- .../pkg/TestTryWithResourcesNestedJ16.dec | 34 +- .../pkg/TestTryWithResourcesNestedLoop.dec | 8 + .../pkg/TestTryWithResourcesOuterJ16.dec | 152 ++++++- .../pkg/TestTryWithResourcesReturnJ16.dec | 12 + .../pkg/TestTryWithResourcesSwitchJ16.dec | 97 +++++ testData/results/pkg/TestUnionTypeAssign.dec | 2 +- testData/results/pkg/TestUnknownCast.dec | 4 + testData/results/pkg/TestUnknownCastJ17.dec | 11 + testData/results/pkg/TestUnnamedVar1.dec | 20 +- testData/results/pkg/TestVarRedef.dec | 6 + testData/results/pkg/TestWhileCondition.dec | 16 + .../results/pkg/TestWhileConditionTernary.dec | 10 + testData/results/pkg/TestWhileForeach.dec | 6 +- testData/results/pkg/TestWhileIterator.dec | 6 + testData/results/pkg/TestWhileLambda.dec | 2 + testData/results/pkg/TestWhileTernary1.dec | 8 + testData/results/pkg/TestWhileTernary10.dec | 32 ++ testData/results/pkg/TestWhileTernary2.dec | 6 + testData/results/pkg/TestWhileTernary3.dec | 6 + testData/results/pkg/TestWhileTernary4.dec | 6 + testData/results/pkg/TestWhileTernary5.dec | 10 + testData/results/pkg/TestWhileTernary6.dec | 10 + testData/results/pkg/TestWhileTernary7.dec | 6 + testData/results/pkg/TestWhileTernary8.dec | 10 + testData/results/pkg/TestWhileTernary9.dec | 30 ++ testData/results/pkg/TestWhileTernaryFake.dec | 6 + 361 files changed, 10410 insertions(+), 774 deletions(-) diff --git a/plugins/idea-not-null/testData/results/TestIdeaNotNull.dec b/plugins/idea-not-null/testData/results/TestIdeaNotNull.dec index 02010fc8e0..8f3aa2dd71 100644 --- a/plugins/idea-not-null/testData/results/TestIdeaNotNull.dec +++ b/plugins/idea-not-null/testData/results/TestIdeaNotNull.dec @@ -76,6 +76,8 @@ class 'pkg/TestIdeaNotNull' { f 9 10 10 11 10 + 12 10 + 13 10 14 11 1d 11 1e 13 @@ -83,6 +85,8 @@ class 'pkg/TestIdeaNotNull' { 20 13 21 13 22 13 + 23 13 + 24 13 2c 14 30 14 34 14 @@ -145,11 +149,15 @@ class 'pkg/TestIdeaNotNull' { 2a 33 2b 33 2c 33 + 2d 33 + 2e 33 2f 34 30 34 31 34 32 34 33 34 + 34 34 + 35 34 36 36 } @@ -168,6 +176,8 @@ class 'pkg/TestIdeaNotNull' { 12 43 13 43 14 43 + 15 43 + 16 43 1e 44 22 44 26 44 @@ -190,6 +200,8 @@ class 'pkg/TestIdeaNotNull' { e 53 f 53 10 53 + 11 53 + 12 53 13 54 1d 54 1e 56 @@ -200,6 +212,8 @@ class 'pkg/TestIdeaNotNull' { 23 56 24 56 25 56 + 26 56 + 27 56 2f 57 33 57 37 57 diff --git a/plugins/kotlin/testData/results/pkg/TestAnyType.dec b/plugins/kotlin/testData/results/pkg/TestAnyType.dec index 40e0f17498..ca1baf9181 100644 --- a/plugins/kotlin/testData/results/pkg/TestAnyType.dec +++ b/plugins/kotlin/testData/results/pkg/TestAnyType.dec @@ -18,6 +18,8 @@ class 'pkg/TestAnyType' { 8 4 9 4 a 4 + b 4 + c 4 d 5 e 5 f 5 diff --git a/plugins/kotlin/testData/results/pkg/TestComparison.dec b/plugins/kotlin/testData/results/pkg/TestComparison.dec index deae0a7218..cdac5da365 100644 --- a/plugins/kotlin/testData/results/pkg/TestComparison.dec +++ b/plugins/kotlin/testData/results/pkg/TestComparison.dec @@ -37,18 +37,24 @@ class 'pkg/TestComparison' { c 8 d 8 e 8 + f 8 + 10 8 16 8 } method 'testNull2 (Ljava/lang/Object;)Z' { 0 12 1 12 + 2 12 + 3 12 9 12 } method 'testNull3 (Ljava/lang/Object;)Z' { 0 16 1 16 + 2 16 + 3 16 9 16 } @@ -62,6 +68,8 @@ class 'pkg/TestComparison' { 0 24 1 24 2 24 + 3 24 + 4 24 a 24 } } diff --git a/plugins/kotlin/testData/results/pkg/TestCompileTimeErrors.dec b/plugins/kotlin/testData/results/pkg/TestCompileTimeErrors.dec index b39d3dee40..7593b4c6a4 100644 --- a/plugins/kotlin/testData/results/pkg/TestCompileTimeErrors.dec +++ b/plugins/kotlin/testData/results/pkg/TestCompileTimeErrors.dec @@ -44,9 +44,13 @@ class 'pkg/TestCompileTimeErrors' { method 'test2 (Ljava/lang/Integer;)Lpkg/TestCompileTimeErrors$Test;' { 0 10 1 10 + 2 10 + 3 10 4 10 c 10 10 10 + 11 10 + 12 10 13 10 } } diff --git a/plugins/kotlin/testData/results/pkg/TestContracts.dec b/plugins/kotlin/testData/results/pkg/TestContracts.dec index 4025e8953b..d7a520b053 100644 --- a/plugins/kotlin/testData/results/pkg/TestContracts.dec +++ b/plugins/kotlin/testData/results/pkg/TestContracts.dec @@ -75,6 +75,8 @@ class 'pkg/TestContracts' { method 'testSimpleContract (Ljava/lang/Integer;)I' { 1 10 2 10 + 3 10 + 4 10 9 11 a 11 b 11 @@ -91,20 +93,32 @@ class 'pkg/TestContracts' { method 'testBooleanContract (ZZ)Ljava/lang/Boolean;' { 1 24 2 24 + 3 24 + 4 24 5 24 6 24 + 7 24 + 8 24 9 24 d 24 e 24 + f 24 + 10 24 11 24 12 24 + 13 24 + 14 24 1a 24 + 1b 24 + 1c 24 1d 24 } method 'testTypeContract (Ljava/lang/Object;)I' { 1 32 5 32 + 6 32 + 7 32 c 33 d 33 e 33 @@ -140,6 +154,8 @@ class 'pkg/TestContracts' { method 'testFunctionalContract2 (Lkotlin/jvm/functions/Function0;Z)I' { 7 52 8 52 + 9 52 + a 52 b 52 c 52 d 52 diff --git a/plugins/kotlin/testData/results/pkg/TestDataClass.dec b/plugins/kotlin/testData/results/pkg/TestDataClass.dec index fefb45b08c..e03a9746ca 100644 --- a/plugins/kotlin/testData/results/pkg/TestDataClass.dec +++ b/plugins/kotlin/testData/results/pkg/TestDataClass.dec @@ -188,6 +188,8 @@ class 'pkg/TestDataClass' { 2 43 3 43 4 43 + 5 43 + 6 43 7 44 8 44 9 44 @@ -198,6 +200,8 @@ class 'pkg/TestDataClass' { e 47 f 47 10 47 + 11 47 + 12 47 13 48 14 48 15 48 @@ -208,6 +212,8 @@ class 'pkg/TestDataClass' { 1a 51 1b 51 1c 51 + 1d 51 + 1e 51 1f 52 20 52 21 52 @@ -219,6 +225,8 @@ class 'pkg/TestDataClass' { 27 55 28 55 29 55 + 2a 55 + 2b 55 2c 56 2d 56 2e 56 @@ -303,12 +311,16 @@ class 'pkg/TestDataClass' { 28 80 29 80 2a 80 + 2b 80 + 2c 80 2d 80 31 80 32 80 33 80 34 80 35 80 + 36 80 + 37 80 38 75 3b 75 } @@ -317,10 +329,14 @@ class 'pkg/TestDataClass' { 0 84 1 84 2 84 + 3 84 + 4 84 5 85 6 85 7 86 b 86 + c 86 + d 86 e 87 f 87 10 89 @@ -337,6 +353,8 @@ class 'pkg/TestDataClass' { 1b 90 1c 90 20 90 + 21 90 + 22 90 23 91 24 91 25 92 @@ -348,6 +366,8 @@ class 'pkg/TestDataClass' { 2b 92 2c 92 2d 92 + 2e 92 + 2f 92 30 93 31 93 32 94 @@ -359,6 +379,8 @@ class 'pkg/TestDataClass' { 38 94 39 94 3d 94 + 3e 94 + 3f 94 40 95 41 95 42 97 @@ -370,6 +392,8 @@ class 'pkg/TestDataClass' { 48 97 49 97 4d 97 + 4e 97 + 4f 97 } } diff --git a/plugins/kotlin/testData/results/pkg/TestDestructors.dec b/plugins/kotlin/testData/results/pkg/TestDestructors.dec index cf9eb96cff..3d2afeff4d 100644 --- a/plugins/kotlin/testData/results/pkg/TestDestructors.dec +++ b/plugins/kotlin/testData/results/pkg/TestDestructors.dec @@ -493,12 +493,18 @@ class 'pkg/TestDestructors' { 12 48 13 48 14 48 + 15 48 + 16 48 17 48 18 48 19 48 1a 48 1b 48 + 1c 48 + 1d 48 27 48 + 28 48 + 29 48 2a 49 2e 57 2f 49 @@ -509,22 +515,25 @@ class 'pkg/TestDestructors' { 34 49 35 49 36 49 - 37 49 38 51 - 39 51 3e 51 3f 51 45 50 46 50 47 50 - 48 50 49 50 + 4a 50 + 4b 50 4d 50 4e 50 4f 50 50 50 51 50 + 52 50 + 53 50 5d 50 + 5e 50 + 5f 50 60 51 64 57 65 51 @@ -535,22 +544,25 @@ class 'pkg/TestDestructors' { 6a 51 6b 51 6c 51 - 6d 51 6e 53 - 6f 53 74 53 75 53 7b 52 7c 52 7d 52 - 7e 52 7f 52 + 80 52 + 81 52 83 52 84 52 85 52 86 52 87 52 + 88 52 + 89 52 93 52 + 94 52 + 95 52 96 53 9a 57 9b 53 @@ -559,6 +571,7 @@ class 'pkg/TestDestructors' { 9e 53 9f 53 a0 53 + a1 53 a4 53 a5 53 a6 53 @@ -570,9 +583,9 @@ class 'pkg/TestDestructors' { ac 53 ad 53 ae 53 - af 53 - b0 53 b4 53 + b5 53 + b6 53 b8 57 } diff --git a/plugins/kotlin/testData/results/pkg/TestForRange.dec b/plugins/kotlin/testData/results/pkg/TestForRange.dec index c09d5857d9..04ed20c1ef 100644 --- a/plugins/kotlin/testData/results/pkg/TestForRange.dec +++ b/plugins/kotlin/testData/results/pkg/TestForRange.dec @@ -187,6 +187,8 @@ class 'pkg/TestForRange' { 3 6 4 6 5 6 + 6 6 + 7 6 8 7 9 7 a 7 @@ -208,6 +210,8 @@ class 'pkg/TestForRange' { 4 12 5 12 6 12 + 7 12 + 8 12 9 13 a 13 b 13 @@ -234,6 +238,8 @@ class 'pkg/TestForRange' { a 20 b 20 c 20 + d 20 + e 20 f 22 10 22 11 22 @@ -244,6 +250,8 @@ class 'pkg/TestForRange' { 16 23 17 23 18 23 + 19 23 + 1a 23 1b 27 1c 27 1d 27 @@ -253,6 +261,8 @@ class 'pkg/TestForRange' { method 'testIntStepX (I)V' { 0 33 1 33 + 2 33 + 3 33 8 34 9 34 a 34 @@ -273,6 +283,8 @@ class 'pkg/TestForRange' { 1c 38 1d 38 1e 38 + 1f 38 + 20 38 21 40 22 40 23 40 @@ -283,6 +295,8 @@ class 'pkg/TestForRange' { 28 41 29 41 2a 41 + 2b 41 + 2c 41 2e 45 30 45 34 49 @@ -295,6 +309,8 @@ class 'pkg/TestForRange' { 3 52 4 52 5 52 + 6 52 + 7 52 8 53 9 53 a 53 @@ -324,6 +340,8 @@ class 'pkg/TestForRange' { c 60 d 60 e 60 + f 60 + 10 60 11 62 12 62 13 62 @@ -334,6 +352,8 @@ class 'pkg/TestForRange' { 18 63 19 63 1a 63 + 1b 63 + 1c 63 1d 67 1e 67 1f 67 @@ -343,6 +363,8 @@ class 'pkg/TestForRange' { method 'testIntDownToStepX (I)V' { 0 73 1 73 + 2 73 + 3 73 8 74 9 74 a 74 @@ -369,6 +391,8 @@ class 'pkg/TestForRange' { 22 79 23 79 24 79 + 25 79 + 26 79 27 81 28 81 29 81 @@ -380,6 +404,8 @@ class 'pkg/TestForRange' { 2f 82 30 82 31 82 + 32 82 + 33 82 35 86 37 86 3b 90 @@ -392,6 +418,8 @@ class 'pkg/TestForRange' { 3 93 4 93 5 93 + 6 93 + 7 93 8 94 9 94 a 94 @@ -439,15 +467,23 @@ class 'pkg/TestForRange' { 1e 103 1f 103 20 103 + 21 103 + 22 103 23 103 24 103 25 103 + 26 103 + 27 103 28 103 29 103 2a 103 + 2b 103 + 2c 103 2d 103 2e 103 2f 103 + 30 103 + 31 103 32 105 33 105 34 105 @@ -458,6 +494,8 @@ class 'pkg/TestForRange' { 39 106 3a 106 3b 106 + 3c 106 + 3d 106 3f 110 40 110 42 110 @@ -499,17 +537,25 @@ class 'pkg/TestForRange' { 1f 120 20 120 21 120 + 22 120 + 23 120 24 120 25 120 26 120 27 120 + 28 120 + 29 120 2a 120 2b 120 2c 120 + 2d 120 + 2e 120 2f 120 30 120 31 120 32 120 + 33 120 + 34 120 35 122 36 122 37 122 @@ -521,6 +567,8 @@ class 'pkg/TestForRange' { 3d 123 3e 123 3f 123 + 40 123 + 41 123 43 127 44 127 46 127 @@ -533,6 +581,8 @@ class 'pkg/TestForRange' { 2 134 3 134 4 134 + 5 134 + 6 134 7 136 8 136 9 136 @@ -543,6 +593,8 @@ class 'pkg/TestForRange' { e 137 f 137 10 137 + 11 137 + 12 137 13 141 14 141 15 141 @@ -564,6 +616,8 @@ class 'pkg/TestForRange' { b 149 c 149 d 149 + e 149 + f 149 10 151 11 151 12 151 @@ -575,6 +629,8 @@ class 'pkg/TestForRange' { 18 152 19 152 1a 152 + 1b 152 + 1c 152 1d 156 1e 156 1f 156 @@ -584,6 +640,8 @@ class 'pkg/TestForRange' { method 'testIntYStepX (III)V' { 0 162 1 162 + 2 162 + 3 162 8 163 9 163 a 163 @@ -607,6 +665,8 @@ class 'pkg/TestForRange' { 1f 167 20 167 21 167 + 22 167 + 23 167 24 169 25 169 26 169 @@ -620,6 +680,8 @@ class 'pkg/TestForRange' { 2e 170 2f 170 30 170 + 31 170 + 32 170 35 174 37 174 38 174 diff --git a/plugins/kotlin/testData/results/pkg/TestIfRange.dec b/plugins/kotlin/testData/results/pkg/TestIfRange.dec index b1b89609e5..d25bf82c20 100644 --- a/plugins/kotlin/testData/results/pkg/TestIfRange.dec +++ b/plugins/kotlin/testData/results/pkg/TestIfRange.dec @@ -79,16 +79,24 @@ class 'pkg/TestIfRange' { 0 4 1 4 2 4 + 3 4 + 4 4 5 4 6 4 7 4 8 4 + 9 4 + a 4 14 4 + 15 4 + 16 4 17 5 18 5 19 5 1a 5 1b 5 + 1c 5 + 1d 5 1e 7 } @@ -97,16 +105,24 @@ class 'pkg/TestIfRange' { 1 10 2 10 3 10 + 4 10 + 5 10 6 10 7 10 8 10 9 10 + a 10 + b 10 15 10 + 16 10 + 17 10 18 11 19 11 1a 11 1b 11 1c 11 + 1d 11 + 1e 11 1f 13 } @@ -114,16 +130,24 @@ class 'pkg/TestIfRange' { 0 16 1 16 2 16 + 3 16 + 4 16 5 16 6 16 7 16 8 16 + 9 16 + a 16 14 16 + 15 16 + 16 16 17 17 18 17 19 17 1a 17 1b 17 + 1c 17 + 1d 17 1e 19 } @@ -149,11 +173,15 @@ class 'pkg/TestIfRange' { 19 22 1a 22 1b 22 + 1c 22 + 1d 22 1e 23 1f 23 20 23 21 23 22 23 + 23 23 + 24 23 25 25 } @@ -179,11 +207,15 @@ class 'pkg/TestIfRange' { 19 28 1a 28 1b 28 + 1c 28 + 1d 28 1e 29 1f 29 20 29 21 29 22 29 + 23 29 + 24 29 25 31 } @@ -191,15 +223,23 @@ class 'pkg/TestIfRange' { 0 34 1 34 2 34 + 3 34 + 4 34 5 34 6 34 7 34 + 8 34 + 9 34 13 34 + 14 34 + 15 34 16 35 17 35 18 35 19 35 1a 35 + 1b 35 + 1c 35 1d 37 } @@ -221,11 +261,15 @@ class 'pkg/TestIfRange' { e 40 f 40 10 40 + 11 40 + 12 40 13 41 14 41 15 41 16 41 17 41 + 18 41 + 19 41 1a 43 } @@ -251,11 +295,15 @@ class 'pkg/TestIfRange' { 12 46 13 46 14 46 + 15 46 + 16 46 17 47 18 47 19 47 1a 47 1b 47 + 1c 47 + 1d 47 1e 49 } @@ -263,16 +311,24 @@ class 'pkg/TestIfRange' { 0 52 1 52 2 52 + 3 52 + 4 52 5 52 6 52 7 52 8 52 + 9 52 + a 52 14 52 + 15 52 + 16 52 17 53 18 53 19 53 1a 53 1b 53 + 1c 53 + 1d 53 1e 55 } @@ -301,11 +357,15 @@ class 'pkg/TestIfRange' { 15 58 16 58 17 58 + 18 58 + 19 58 1a 59 1b 59 1c 59 1d 59 1e 59 + 1f 59 + 20 59 21 61 } @@ -313,15 +373,23 @@ class 'pkg/TestIfRange' { 0 64 1 64 2 64 + 3 64 + 4 64 5 64 6 64 7 64 + 8 64 + 9 64 13 64 + 14 64 + 15 64 16 65 17 65 18 65 19 65 1a 65 + 1b 65 + 1c 65 1d 67 } @@ -329,15 +397,23 @@ class 'pkg/TestIfRange' { 0 70 1 70 2 70 + 3 70 + 4 70 5 70 6 70 7 70 + 8 70 + 9 70 13 70 + 14 70 + 15 70 16 71 17 71 18 71 19 71 1a 71 + 1b 71 + 1c 71 1d 73 } } diff --git a/plugins/kotlin/testData/results/pkg/TestLabeledJumps.dec b/plugins/kotlin/testData/results/pkg/TestLabeledJumps.dec index b6d221b59c..bf01a116ed 100644 --- a/plugins/kotlin/testData/results/pkg/TestLabeledJumps.dec +++ b/plugins/kotlin/testData/results/pkg/TestLabeledJumps.dec @@ -40,12 +40,16 @@ class 'pkg/TestLabeledJumps' { 9 5 a 5 b 5 + c 5 + d 5 e 6 f 6 10 6 11 6 12 6 13 6 + 14 6 + 15 6 16 7 17 7 18 7 @@ -63,6 +67,8 @@ class 'pkg/TestLabeledJumps' { 24 7 25 7 26 7 + 27 7 + 28 7 2c 11 2d 11 2e 11 @@ -85,6 +91,8 @@ class 'pkg/TestLabeledJumps' { 43 14 44 14 46 14 + 47 14 + 48 14 49 5 4a 5 4b 5 @@ -98,12 +106,16 @@ class 'pkg/TestLabeledJumps' { 9 20 a 20 b 20 + c 20 + d 20 e 21 f 21 10 21 11 21 12 21 13 21 + 14 21 + 15 21 16 22 17 22 18 22 @@ -121,6 +133,8 @@ class 'pkg/TestLabeledJumps' { 24 22 25 22 26 22 + 27 22 + 28 22 2c 26 2d 26 2e 26 diff --git a/plugins/kotlin/testData/results/pkg/TestNothingReturns.dec b/plugins/kotlin/testData/results/pkg/TestNothingReturns.dec index 26e29647a7..5c70135f00 100644 --- a/plugins/kotlin/testData/results/pkg/TestNothingReturns.dec +++ b/plugins/kotlin/testData/results/pkg/TestNothingReturns.dec @@ -78,6 +78,8 @@ class 'pkg/TestNothingReturns' { method 'test3 (I)I' { 0 20 1 20 + 2 20 + 3 20 4 21 5 21 6 21 @@ -122,6 +124,8 @@ class 'pkg/TestNothingReturns' { method 'test6 (Ljava/lang/String;)Ljava/lang/String;' { 0 40 2 40 + 3 40 + 4 40 6 41 7 41 8 41 diff --git a/plugins/kotlin/testData/results/pkg/TestNullableOperator.dec b/plugins/kotlin/testData/results/pkg/TestNullableOperator.dec index a8636ad41c..c2375598b4 100644 --- a/plugins/kotlin/testData/results/pkg/TestNullableOperator.dec +++ b/plugins/kotlin/testData/results/pkg/TestNullableOperator.dec @@ -87,47 +87,50 @@ class 'pkg/TestNullableOperator' { method 'test2 (Ljava/lang/String;)Ljava/lang/String;' { 0 8 2 9 + 3 9 + 4 9 6 10 + 7 10 8 13 } method 'test2_1 (Ljava/lang/Object;)Ljava/lang/Object;' { 0 17 2 18 + 3 18 + 4 18 6 19 + 7 19 8 22 } method 'test2_2 (Ljava/lang/Object;)Ljava/lang/Object;' { 0 26 2 27 + 3 27 + 4 27 6 28 + 7 28 8 31 } method 'test3 (Ljava/lang/Integer;)I' { 0 35 2 35 + 3 35 + 4 35 5 36 6 36 7 36 8 36 - 9 36 - a 36 - b 36 - c 36 - d 36 - e 36 - f 36 - 10 36 - 11 36 - 12 36 - 13 36 + 13 38 } method 'test4 (Ljava/lang/Exception;)V' { 0 43 2 43 + 3 43 + 4 43 5 44 6 44 7 44 @@ -137,6 +140,8 @@ class 'pkg/TestNullableOperator' { method 'test5 (Ljava/lang/Exception;)V' { 0 50 2 50 + 3 50 + 4 50 5 51 6 51 7 51 @@ -145,6 +150,8 @@ class 'pkg/TestNullableOperator' { a 52 f 54 10 57 + 11 57 + 12 57 1a 58 1b 60 } @@ -152,29 +159,28 @@ class 'pkg/TestNullableOperator' { method 'test6 (Ljava/lang/Integer;)I' { 0 63 2 63 + 3 63 + 4 63 5 64 6 64 7 64 8 64 - 9 64 - a 64 - b 64 - c 64 - d 64 + c 68 + d 68 e 65 f 65 10 65 - 11 65 12 65 - 13 66 - 14 66 - 15 66 + 13 65 + 14 65 16 66 } method 'test6_1 (Ljava/lang/Integer;)V' { 0 73 2 73 + 3 73 + 4 73 5 74 6 74 7 74 @@ -182,11 +188,9 @@ class 'pkg/TestNullableOperator' { d 74 e 74 f 74 - 10 74 11 74 - 12 76 - 13 76 - 14 76 + 12 74 + 13 74 } } diff --git a/plugins/kotlin/testData/results/pkg/TestParams.dec b/plugins/kotlin/testData/results/pkg/TestParams.dec index 654a2a9198..76d7822a36 100644 --- a/plugins/kotlin/testData/results/pkg/TestParams.dec +++ b/plugins/kotlin/testData/results/pkg/TestParams.dec @@ -98,6 +98,8 @@ class 'pkg/TestParams' { 1 26 2 26 3 26 + 4 26 + 5 26 6 27 7 27 8 27 diff --git a/plugins/kotlin/testData/results/pkg/TestSafeCasts.dec b/plugins/kotlin/testData/results/pkg/TestSafeCasts.dec index f8429bc7fe..aead2eaff0 100644 --- a/plugins/kotlin/testData/results/pkg/TestSafeCasts.dec +++ b/plugins/kotlin/testData/results/pkg/TestSafeCasts.dec @@ -91,16 +91,22 @@ class TestSafeCasts { class 'pkg/TestSafeCasts' { method 'test (Ljava/lang/Object;)Z' { a 4 + b 4 + c 4 d 4 15 4 16 5 17 6 1a 5 + 1b 5 + 1c 5 21 6 22 6 23 6 24 6 25 6 + 26 6 + 27 6 28 7 2c 11 2d 7 @@ -109,19 +115,27 @@ class 'pkg/TestSafeCasts' { method 'testTestBefore (Ljava/lang/Object;)Ljava/lang/Boolean;' { 6 15 a 15 + b 15 + c 15 d 16 e 16 13 18 + 14 18 + 15 18 16 18 1e 18 1f 19 20 20 23 19 + 24 19 + 25 19 2a 20 2b 20 2c 20 2d 20 2e 20 + 2f 20 + 30 20 31 21 35 25 36 21 @@ -132,6 +146,8 @@ class 'pkg/TestSafeCasts' { method 'testHardIncompatible (I)Z' { 7 30 + 8 30 + 9 30 a 30 b 30 c 30 @@ -148,7 +164,11 @@ class 'pkg/TestSafeCasts' { 8 34 9 34 a 34 + b 34 + c 34 13 34 + 14 34 + 15 34 16 34 1f 34 20 34 @@ -157,16 +177,22 @@ class 'pkg/TestSafeCasts' { method 'testCastNonNullToNullable (Ljava/lang/Object;)Z' { a 38 + b 38 + c 38 d 38 15 38 16 39 17 40 1a 39 + 1b 39 + 1c 39 21 40 22 40 23 40 24 40 25 40 + 26 40 + 27 40 28 41 2c 45 2d 41 @@ -175,19 +201,27 @@ class 'pkg/TestSafeCasts' { method 'testBeforeNonNullToNullable (Ljava/lang/Object;)Ljava/lang/Boolean;' { 6 49 a 49 + b 49 + c 49 d 50 e 50 13 52 + 14 52 + 15 52 16 52 1e 52 1f 53 20 54 23 53 + 24 53 + 25 53 2a 54 2b 54 2c 54 2d 54 2e 54 + 2f 54 + 30 54 31 55 35 59 36 55 @@ -198,16 +232,22 @@ class 'pkg/TestSafeCasts' { method 'testCastNullableToNullable (Ljava/lang/Object;)Z' { 4 64 + 5 64 + 6 64 7 64 f 64 10 65 11 66 14 65 + 15 65 + 16 65 1b 66 1c 66 1d 66 1e 66 1f 66 + 20 66 + 21 66 22 67 26 71 27 67 @@ -216,21 +256,33 @@ class 'pkg/TestSafeCasts' { method 'testBeforeNullableToNullable (Ljava/lang/Object;)Ljava/lang/Boolean;' { 0 75 2 75 + 3 75 + 4 75 a 75 + b 75 + c 75 d 75 + e 75 + f 75 10 76 11 76 16 78 + 17 78 + 18 78 19 78 21 78 22 79 23 80 26 79 + 27 79 + 28 79 2d 80 2e 80 2f 80 30 80 31 80 + 32 80 + 33 80 34 81 38 85 39 81 diff --git a/plugins/kotlin/testData/results/pkg/TestShadowParam.dec b/plugins/kotlin/testData/results/pkg/TestShadowParam.dec index ac3433aacf..7633e6dce6 100644 --- a/plugins/kotlin/testData/results/pkg/TestShadowParam.dec +++ b/plugins/kotlin/testData/results/pkg/TestShadowParam.dec @@ -25,11 +25,15 @@ class 'pkg/TestShadowParam' { b 5 c 6 d 6 + e 6 + f 6 10 7 11 7 12 7 13 7 14 7 + 15 7 + 16 7 17 9 } } diff --git a/plugins/kotlin/testData/results/pkg/TestSmartCasts.dec b/plugins/kotlin/testData/results/pkg/TestSmartCasts.dec index 0d58d4ecce..ee55a4a7b4 100644 --- a/plugins/kotlin/testData/results/pkg/TestSmartCasts.dec +++ b/plugins/kotlin/testData/results/pkg/TestSmartCasts.dec @@ -120,6 +120,8 @@ class 'pkg/TestSmartCasts' { 4 4 5 4 6 4 + 7 4 + 8 4 9 5 a 5 b 5 @@ -130,6 +132,8 @@ class 'pkg/TestSmartCasts' { 10 7 11 7 12 7 + 13 7 + 14 7 15 8 16 8 17 8 @@ -144,6 +148,8 @@ class 'pkg/TestSmartCasts' { 21 8 25 10 29 10 + 2a 10 + 2b 10 2c 22 2d 22 2e 22 @@ -161,6 +167,8 @@ class 'pkg/TestSmartCasts' { 3e 11 3f 11 40 11 + 41 11 + 42 11 43 12 44 12 45 12 @@ -191,6 +199,8 @@ class 'pkg/TestSmartCasts' { 5e 12 5f 15 60 15 + 61 15 + 62 15 63 16 64 16 65 16 @@ -203,6 +213,8 @@ class 'pkg/TestSmartCasts' { 6c 19 6d 25 6f 25 + 70 25 + 71 25 77 26 78 26 7c 26 @@ -218,8 +230,12 @@ class 'pkg/TestSmartCasts' { method 'testIf (Ljava/lang/Object;)Ljava/lang/String;' { 0 34 4 34 + 5 34 + 6 34 7 34 b 34 + c 34 + d 34 e 34 f 34 10 34 @@ -241,16 +257,22 @@ class 'pkg/TestSmartCasts' { 2 38 3 38 4 38 + 5 38 + 6 38 7 39 8 39 9 39 a 39 b 39 + c 39 + d 39 e 39 f 39 10 39 11 39 12 39 + 13 39 + 14 39 15 40 16 40 17 40 @@ -262,16 +284,22 @@ class 'pkg/TestSmartCasts' { 1d 40 1e 40 20 40 + 21 40 + 22 40 23 43 24 43 25 43 26 43 27 43 + 28 43 + 29 43 2a 44 2b 44 2c 44 2d 44 2e 44 + 2f 44 + 30 44 31 45 32 45 33 45 @@ -296,11 +324,15 @@ class 'pkg/TestSmartCasts' { 47 46 48 46 4a 46 + 4b 46 + 4c 46 4d 49 4e 49 4f 49 50 49 51 49 + 52 49 + 53 49 54 49 55 49 56 49 @@ -311,11 +343,15 @@ class 'pkg/TestSmartCasts' { 5b 49 5c 49 60 49 + 61 49 + 62 49 63 49 64 49 65 49 66 49 67 49 + 68 49 + 69 49 6a 50 6b 50 6c 50 @@ -327,6 +363,8 @@ class 'pkg/TestSmartCasts' { 72 50 73 50 75 50 + 76 50 + 77 50 78 55 79 55 7a 55 @@ -346,6 +384,8 @@ class 'pkg/TestSmartCasts' { 6 59 7 60 9 60 + a 60 + b 60 11 61 12 61 16 61 @@ -396,6 +436,8 @@ class 'pkg/TestSmartCasts' { 8 71 9 71 a 71 + b 71 + c 71 d 72 e 72 f 72 @@ -409,6 +451,8 @@ class 'pkg/TestSmartCasts' { 17 74 18 74 19 74 + 1a 74 + 1b 74 1c 74 1d 74 1e 74 @@ -428,6 +472,8 @@ class 'pkg/TestSmartCasts' { 8 79 9 79 a 79 + b 79 + c 79 d 79 11 79 12 79 diff --git a/plugins/kotlin/testData/results/pkg/TestSynchronized.dec b/plugins/kotlin/testData/results/pkg/TestSynchronized.dec index 0d166bac19..2de7a9aa0a 100644 --- a/plugins/kotlin/testData/results/pkg/TestSynchronized.dec +++ b/plugins/kotlin/testData/results/pkg/TestSynchronized.dec @@ -22,13 +22,6 @@ class 'pkg/TestSynchronized' { e 5 f 5 17 7 - 18 7 - 19 7 - 1a 7 - 1b 7 - 1c 7 - 1d 7 - 1e 7 } } diff --git a/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec b/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec index 1fad0317a2..c5a29a6847 100644 --- a/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec +++ b/plugins/kotlin/testData/results/pkg/TestTailrecFunctions.dec @@ -25,7 +25,7 @@ class TestTailrecFunctions { this.testFinally();// 13 } - this.testFinally();// 12 14 + this.testFinally(); } } @@ -189,16 +189,10 @@ class 'pkg/TestTailrecFunctions' { 2 27 3 27 4 27 - 5 27 - 6 27 - 7 27 - 8 27 9 24 a 24 - b 27 - c 27 - d 27 - e 27 + b 24 + c 24 } method 'testFinallyReturn ()I' { @@ -227,6 +221,8 @@ class 'pkg/TestTailrecFunctions' { method 'testTryCatchFinally ()V' { 1 53 2 53 + 3 53 + 4 53 5 66 6 66 7 66 @@ -234,12 +230,16 @@ class 'pkg/TestTailrecFunctions' { c 55 d 56 e 56 + f 56 + 10 56 11 62 12 62 13 62 14 62 19 59 1a 59 + 1b 59 + 1c 59 1f 63 } @@ -280,6 +280,8 @@ class 'pkg/TestTailrecFunctions' { 2c 77 2d 77 2e 77 + 2f 77 + 30 77 31 78 32 78 33 78 @@ -347,6 +349,8 @@ class 'pkg/TestTailrecFunctions' { 2 100 3 100 4 100 + 5 100 + 6 100 7 101 8 101 9 101 @@ -382,6 +386,8 @@ class 'pkg/TestTailrecFunctions' { 17 114 18 114 19 114 + 1a 114 + 1b 114 1c 115 1d 116 20 119 @@ -392,6 +398,8 @@ class 'pkg/TestTailrecFunctions' { 25 119 26 119 27 119 + 28 119 + 29 119 2a 124 2b 124 2c 124 @@ -440,9 +448,7 @@ Lines mapping: 4 <-> 5 5 <-> 9 6 <-> 10 -12 <-> 28 13 <-> 25 -14 <-> 28 21 <-> 36 27 <-> 44 29 <-> 45 @@ -463,6 +469,8 @@ Lines mapping: 53 <-> 132 Not mapped: 10 +12 +14 15 18 20 diff --git a/plugins/kotlin/testData/results/pkg/TestTryCatchExpressions.dec b/plugins/kotlin/testData/results/pkg/TestTryCatchExpressions.dec index 53bf0f58a2..b029be688a 100644 --- a/plugins/kotlin/testData/results/pkg/TestTryCatchExpressions.dec +++ b/plugins/kotlin/testData/results/pkg/TestTryCatchExpressions.dec @@ -130,7 +130,10 @@ class 'pkg/TestTryCatchExpressions' { 16 10 17 10 19 11 + 1a 11 + 1b 11 1d 12 + 1e 12 1f 15 20 18 22 18 @@ -172,7 +175,10 @@ class 'pkg/TestTryCatchExpressions' { 2a 33 2b 33 2d 34 + 2e 34 + 2f 34 31 35 + 32 35 33 38 34 38 35 41 @@ -206,7 +212,10 @@ class 'pkg/TestTryCatchExpressions' { 56 52 57 52 59 53 + 5a 53 + 5b 53 5d 54 + 5e 54 5f 57 60 57 61 60 @@ -239,6 +248,8 @@ class 'pkg/TestTryCatchExpressions' { 1c 71 1d 71 1e 71 + 1f 71 + 20 71 21 72 22 75 23 75 @@ -275,6 +286,8 @@ class 'pkg/TestTryCatchExpressions' { 4b 85 4c 85 50 85 + 51 85 + 52 85 53 85 57 85 58 83 @@ -336,7 +349,10 @@ class 'pkg/TestTryCatchExpressions' { a4 103 a5 103 a7 104 + a8 104 + a9 104 ab 105 + ac 105 ad 108 ae 108 af 108 diff --git a/plugins/kotlin/testData/results/pkg/TestTryFinallyExpressions.dec b/plugins/kotlin/testData/results/pkg/TestTryFinallyExpressions.dec index f90533dff6..4a6b3d5caa 100644 --- a/plugins/kotlin/testData/results/pkg/TestTryFinallyExpressions.dec +++ b/plugins/kotlin/testData/results/pkg/TestTryFinallyExpressions.dec @@ -11,7 +11,7 @@ class TestTryFinallyExpressions { System.out.println("bye");// 10 } - System.out.println("bye");// 7 9 11 + System.out.println("bye"); } } @@ -25,7 +25,7 @@ class TestTryFinallyExpressions { ; } - x = b;// 18 19 20 + x = b;// 19 try { var var15: java.lang.String = StringsKt.repeat(x as java.lang.CharSequence, 5);// 21 @@ -33,7 +33,7 @@ class TestTryFinallyExpressions { System.out.println(a);// 23 } - System.out.println(a);// 16 22 24 + System.out.println(a); } } @@ -75,7 +75,7 @@ class TestTryFinallyExpressions { System.out.println(var19);// 49 } - System.out.println(var19);// 29 48 50 + System.out.println(var19); } var19 = if (a == a) b else a; @@ -102,30 +102,14 @@ class 'pkg/TestTryFinallyExpressions' { 16 13 17 13 18 13 - 19 13 - 1a 13 - 1b 13 - 1c 13 1d 10 1e 10 1f 10 20 10 21 10 - 22 13 23 10 - 24 13 - 25 13 - 26 13 - 27 13 - 28 13 - 29 13 - 2a 13 - 2b 13 - 2c 13 - 2d 13 - 2e 13 - 2f 13 - 30 13 + 24 10 + 25 10 } method 'test1 (Ljava/lang/String;Ljava/lang/String;)V' { @@ -143,20 +127,6 @@ class 'pkg/TestTryFinallyExpressions' { 1d 22 1e 27 1f 27 - 20 27 - 21 27 - 22 27 - 23 27 - 24 27 - 25 27 - 26 27 - 27 27 - 28 27 - 29 27 - 2a 27 - 2b 27 - 2c 27 - 2d 27 35 30 36 30 37 30 @@ -174,31 +144,13 @@ class 'pkg/TestTryFinallyExpressions' { 43 35 44 35 45 35 - 46 35 - 47 35 - 48 35 - 49 35 - 4a 35 4b 32 4c 32 4d 32 4e 32 4f 32 - 50 35 - 51 35 - 52 35 - 53 35 - 54 35 - 55 35 - 56 35 - 57 35 - 58 35 - 59 35 - 5a 35 - 5b 35 - 5c 35 - 5d 35 - 5e 35 + 50 32 + 51 32 } method 'test2 (Ljava/lang/String;Ljava/lang/String;)V' { @@ -207,9 +159,13 @@ class 'pkg/TestTryFinallyExpressions' { 16 48 17 48 1b 48 + 1c 48 + 1d 48 1f 80 20 80 24 80 + 25 80 + 26 80 27 80 2b 80 2c 80 @@ -223,6 +179,8 @@ class 'pkg/TestTryFinallyExpressions' { 38 68 39 68 3d 68 + 3e 68 + 3f 68 40 68 44 68 45 68 @@ -247,6 +205,8 @@ class 'pkg/TestTryFinallyExpressions' { 5e 64 5f 64 63 64 + 64 64 + 65 64 66 64 6a 64 6b 64 @@ -254,6 +214,8 @@ class 'pkg/TestTryFinallyExpressions' { 71 61 72 61 76 61 + 77 61 + 78 61 79 61 7d 61 7e 61 @@ -277,48 +239,25 @@ class 'pkg/TestTryFinallyExpressions' { b7 77 b8 77 b9 77 - ba 77 - bb 77 - bc 77 - bd 77 - be 77 bf 74 c0 74 c1 74 c2 74 - c3 77 c4 74 - c5 77 - c6 77 - c7 77 - c8 77 - c9 77 - ca 77 - cb 77 - cc 77 - cd 77 - ce 77 + c5 74 + c6 74 } } Lines mapping: -7 <-> 14 8 <-> 9 -9 <-> 14 10 <-> 11 -11 <-> 14 15 <-> 20 -16 <-> 36 17 <-> 23 -18 <-> 28 19 <-> 28 -20 <-> 28 21 <-> 31 -22 <-> 36 23 <-> 33 -24 <-> 36 28 <-> 42 -29 <-> 78 30 <-> 49 33 <-> 53 34 <-> 54 @@ -331,14 +270,23 @@ Lines mapping: 44 <-> 62 46 <-> 66 47 <-> 73 -48 <-> 78 49 <-> 75 -50 <-> 78 Not mapped: +7 +9 +11 12 +16 +18 +20 +22 +24 25 +29 31 35 40 +48 +50 51 53 diff --git a/plugins/kotlin/testData/results/pkg/TestVars.dec b/plugins/kotlin/testData/results/pkg/TestVars.dec index e2eb7f5894..ed70c2f6c0 100644 --- a/plugins/kotlin/testData/results/pkg/TestVars.dec +++ b/plugins/kotlin/testData/results/pkg/TestVars.dec @@ -55,6 +55,8 @@ class 'pkg/TestVars' { method 'testPhi (Z)V' { 2 13 3 13 + 4 13 + 5 13 6 14 7 14 b 16 @@ -72,6 +74,8 @@ class 'pkg/TestVars' { method 'testIfExpr (Z)V' { 0 23 1 23 + 2 23 + 3 23 4 23 8 23 a 23 diff --git a/plugins/kotlin/testData/results/pkg/TestWhen.dec b/plugins/kotlin/testData/results/pkg/TestWhen.dec index a29a8ffc73..f4020d6d1e 100644 --- a/plugins/kotlin/testData/results/pkg/TestWhen.dec +++ b/plugins/kotlin/testData/results/pkg/TestWhen.dec @@ -63,6 +63,8 @@ class 'pkg/TestWhen' { b 4 c 4 10 4 + 11 4 + 12 4 13 5 14 5 15 5 @@ -75,6 +77,8 @@ class 'pkg/TestWhen' { 20 6 21 6 25 6 + 26 6 + 27 6 28 7 29 7 2a 7 @@ -88,6 +92,8 @@ class 'pkg/TestWhen' { 36 8 37 8 38 8 + 39 8 + 3a 8 3b 9 3c 9 3d 9 @@ -98,6 +104,8 @@ class 'pkg/TestWhen' { 43 9 47 10 4b 10 + 4c 10 + 4d 10 4e 11 4f 11 50 11 @@ -112,6 +120,8 @@ class 'pkg/TestWhen' { 5d 13 5e 13 60 13 + 61 13 + 62 13 63 15 } @@ -123,20 +133,28 @@ class 'pkg/TestWhen' { b 18 c 18 10 18 + 11 18 + 12 18 13 18 17 18 18 18 19 18 1a 18 1b 18 + 1c 18 + 1d 18 1e 18 22 18 23 18 24 18 28 18 + 29 18 + 2a 18 2b 18 2f 18 33 18 + 34 18 + 35 18 36 18 3a 18 3b 18 @@ -150,6 +168,8 @@ class 'pkg/TestWhen' { 11 22 12 22 16 22 + 17 22 + 18 22 19 23 1a 23 1b 23 @@ -162,6 +182,8 @@ class 'pkg/TestWhen' { 26 24 27 24 2b 24 + 2c 24 + 2d 24 2e 25 2f 25 30 25 @@ -175,6 +197,8 @@ class 'pkg/TestWhen' { 3c 26 3d 26 3e 26 + 3f 26 + 40 26 41 27 42 27 43 27 @@ -188,6 +212,8 @@ class 'pkg/TestWhen' { 4f 28 50 28 51 28 + 52 28 + 53 28 54 29 55 29 56 29 @@ -201,6 +227,8 @@ class 'pkg/TestWhen' { 62 30 63 30 64 30 + 65 30 + 66 30 67 31 68 31 69 31 @@ -214,6 +242,8 @@ class 'pkg/TestWhen' { 75 32 76 32 77 32 + 78 32 + 79 32 7a 33 7b 33 7c 33 @@ -228,6 +258,8 @@ class 'pkg/TestWhen' { 89 35 8a 35 8c 35 + 8d 35 + 8e 35 8f 37 } @@ -238,7 +270,11 @@ class 'pkg/TestWhen' { 5 40 6 40 7 40 + 8 40 + 9 40 f 40 + 10 40 + 11 40 12 41 13 41 14 41 @@ -251,10 +287,16 @@ class 'pkg/TestWhen' { 1f 42 20 42 21 42 + 22 42 + 23 42 24 42 25 42 26 42 + 27 42 + 28 42 2e 42 + 2f 42 + 30 42 31 43 32 43 33 43 @@ -267,10 +309,16 @@ class 'pkg/TestWhen' { 3e 44 3f 44 40 44 + 41 44 + 42 44 43 44 44 44 45 44 + 46 44 + 47 44 4d 44 + 4e 44 + 4f 44 50 45 51 45 52 45 @@ -282,6 +330,8 @@ class 'pkg/TestWhen' { 5c 46 5d 46 5e 46 + 5f 46 + 60 46 61 47 62 47 63 47 @@ -295,14 +345,22 @@ class 'pkg/TestWhen' { 6f 48 70 48 71 48 + 72 48 + 73 48 74 48 75 48 76 48 + 77 48 + 78 48 79 48 7a 48 7b 48 7c 48 + 7d 48 + 7e 48 84 48 + 85 48 + 86 48 87 49 88 49 89 49 @@ -317,6 +375,8 @@ class 'pkg/TestWhen' { 96 51 97 51 99 51 + 9a 51 + 9b 51 9c 53 } } diff --git a/plugins/kotlin/testData/results/pkg/TestWhenBoolean.dec b/plugins/kotlin/testData/results/pkg/TestWhenBoolean.dec index e288eca3d1..ac31335448 100644 --- a/plugins/kotlin/testData/results/pkg/TestWhenBoolean.dec +++ b/plugins/kotlin/testData/results/pkg/TestWhenBoolean.dec @@ -19,70 +19,108 @@ class 'pkg/TestWhenBoolean' { 1 4 2 4 3 4 + 4 4 + 5 4 a 5 b 5 c 5 + d 5 + e 5 13 6 14 6 15 6 + 16 6 + 17 6 1c 8 1d 8 1e 8 + 1f 8 + 20 8 25 9 26 9 27 9 + 28 9 + 29 9 2a 9 2b 9 2c 9 + 2d 9 + 2e 9 38 9 + 39 9 + 3a 9 3f 9 40 9 41 9 42 9 43 9 + 44 9 + 45 9 46 9 47 9 48 9 49 9 4a 9 4b 9 + 4c 9 + 4d 9 56 9 57 9 58 9 59 9 + 5a 9 + 5b 9 5c 9 5d 9 + 5e 9 + 5f 9 64 9 65 9 66 9 67 9 + 68 9 + 69 9 6e 9 6f 9 70 9 71 9 72 9 + 73 9 + 74 9 75 9 76 9 77 9 78 9 + 79 9 + 7a 9 7b 9 7c 9 7d 9 7e 9 + 7f 9 + 80 9 8d 9 8e 9 8f 9 90 9 + 91 9 + 92 9 93 9 94 9 95 9 + 96 9 + 97 9 a1 4 + a2 4 + a3 4 a4 11 a5 11 a6 11 a7 11 a8 11 aa 11 + ab 11 + ac 11 ad 13 } } diff --git a/plugins/kotlin/testData/results/pkg/TestWhenControlFlow.dec b/plugins/kotlin/testData/results/pkg/TestWhenControlFlow.dec index 850f632e23..05f8c9e64f 100644 --- a/plugins/kotlin/testData/results/pkg/TestWhenControlFlow.dec +++ b/plugins/kotlin/testData/results/pkg/TestWhenControlFlow.dec @@ -26,6 +26,8 @@ class 'pkg/TestWhenControlFlow' { 1 4 2 6 3 6 + 4 6 + 5 6 6 7 7 7 8 7 @@ -34,16 +36,26 @@ class 'pkg/TestWhenControlFlow' { c 7 d 7 e 7 + f 7 + 10 7 11 11 12 11 13 11 + 14 11 + 15 11 16 12 17 12 18 12 + 19 12 + 1a 12 1b 12 1c 12 1d 12 + 1e 12 + 1f 12 29 12 + 2a 12 + 2b 12 2c 13 2d 16 2e 16 diff --git a/plugins/variable-renaming/testData/results/TestJadLvtCollision.dec b/plugins/variable-renaming/testData/results/TestJadLvtCollision.dec index f215f8dabc..b8a7c00aa5 100644 --- a/plugins/variable-renaming/testData/results/TestJadLvtCollision.dec +++ b/plugins/variable-renaming/testData/results/TestJadLvtCollision.dec @@ -91,4 +91,4 @@ Lines mapping: 16 <-> 13 20 <-> 16 Not mapped: -15 \ No newline at end of file +15 diff --git a/plugins/variable-renaming/testData/results/pkg/TestJADNaming.dec b/plugins/variable-renaming/testData/results/pkg/TestJADNaming.dec index a8429c1090..c5c96930e5 100644 --- a/plugins/variable-renaming/testData/results/pkg/TestJADNaming.dec +++ b/plugins/variable-renaming/testData/results/pkg/TestJADNaming.dec @@ -69,10 +69,14 @@ class 'pkg/TestJADNaming' { 11 8 12 8 13 8 + 14 8 + 15 8 16 8 17 8 18 8 19 8 + 1a 8 + 1b 8 1c 11 1d 11 1e 11 @@ -90,11 +94,15 @@ class 'pkg/TestJADNaming' { 2a 15 2b 15 2c 15 + 2d 15 + 2e 15 2f 15 30 15 31 15 32 15 33 15 + 34 15 + 35 15 36 17 } @@ -208,4 +216,4 @@ Lines mapping: 37 <-> 44 39 <-> 45 40 <-> 46 -41 <-> 47 \ No newline at end of file +41 <-> 47 diff --git a/plugins/variable-renaming/testData/results/pkg/TestTinyNaming.dec b/plugins/variable-renaming/testData/results/pkg/TestTinyNaming.dec index f068b961e8..00a00350e4 100644 --- a/plugins/variable-renaming/testData/results/pkg/TestTinyNaming.dec +++ b/plugins/variable-renaming/testData/results/pkg/TestTinyNaming.dec @@ -833,4 +833,4 @@ Lines mapping: 181 <-> 177 182 <-> 178 183 <-> 179 -184 <-> 180 \ No newline at end of file +184 <-> 180 diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java index a3e90f7ea5..194443a832 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java @@ -212,11 +212,7 @@ public void processBlock(BasicBlockStatement stat, PrimitiveExprsList data, Stru BitSet bytecode_offsets = null; if (bytecode_offset >= 0) { bytecode_offsets = new BitSet(); - bytecode_offsets.set(bytecode_offset); - int end_offset = block.getOldOffset(i+1); - if (end_offset > bytecode_offset) { - bytecode_offsets.set(bytecode_offset, end_offset); - } + bytecode_offsets.set(bytecode_offset, bytecode_offset + instr.length); } switch (instr.opcode) { diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index 0a64ce4f98..da4bb8d68a 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -177,7 +177,6 @@ private void registerDefault() { register(JAVA_8, "TestAnonymousClassConstructor"); register(JAVA_8, "TestInnerClassConstructor"); register(CUSTOM, "v11/TestInnerClassConstructor"); - // [minor] todo: the linenumbers are incorrect on the finally block register(JAVA_8, "TestTryCatchFinally"); register(JAVA_8, "TestTryFinally"); register(JAVA_8, "TestAmbiguousCall"); diff --git a/testData/results/Java14Test.dec b/testData/results/Java14Test.dec index 99166b33a2..50d88dbf95 100644 --- a/testData/results/Java14Test.dec +++ b/testData/results/Java14Test.dec @@ -24,6 +24,8 @@ class 'cfrtest/Java14Test' { method ' ()V' { 4 6 8 6 + 9 6 + a 6 1a 6 1b 6 1c 6 @@ -39,6 +41,8 @@ class 'cfrtest/Java14Test' { method 'instance ()Lcfrtest/Java14Test;' { 3 14 + 4 14 + 5 14 15 14 16 14 17 14 @@ -47,6 +51,8 @@ class 'cfrtest/Java14Test' { method 'getAClass ()Ljava/lang/Class;' { 3 18 + 4 18 + 5 18 15 18 } } diff --git a/testData/results/JsHurt.dec b/testData/results/JsHurt.dec index 22ddc4d92f..817cb39df0 100644 --- a/testData/results/JsHurt.dec +++ b/testData/results/JsHurt.dec @@ -18,6 +18,11 @@ class 'JsHurt' { 0 2 1 2 5 10 + 6 10 + 7 10 + 8 10 + 9 10 + a 10 c 5 d 5 e 5 @@ -29,6 +34,8 @@ class 'JsHurt' { 14 6 15 6 16 6 + 17 6 + 18 6 1c 7 } } diff --git a/testData/results/TestEclipseSwitchEnum.dec b/testData/results/TestEclipseSwitchEnum.dec index 224b509cad..48a153af43 100644 --- a/testData/results/TestEclipseSwitchEnum.dec +++ b/testData/results/TestEclipseSwitchEnum.dec @@ -24,6 +24,33 @@ class 'pkg/TestEclipseSwitchEnum' { 3 8 7 8 8 8 + 9 8 + a 8 + b 8 + c 8 + d 8 + e 8 + f 8 + 10 8 + 11 8 + 12 8 + 13 8 + 14 8 + 15 8 + 16 8 + 17 8 + 18 8 + 19 8 + 1a 8 + 1b 8 + 1c 8 + 1d 8 + 1e 8 + 1f 8 + 20 8 + 21 8 + 22 8 + 23 8 24 10 25 10 26 10 @@ -48,6 +75,8 @@ class 'pkg/TestEclipseSwitchEnum' { 3d 16 3e 16 3f 16 + 40 16 + 41 16 42 18 } } diff --git a/testData/results/TestEclipseSwitchString.dec b/testData/results/TestEclipseSwitchString.dec index b16693585d..6bd76e054b 100644 --- a/testData/results/TestEclipseSwitchString.dec +++ b/testData/results/TestEclipseSwitchString.dec @@ -132,6 +132,31 @@ class 'pkg/TestEclipseSwitchString' { 4 4 5 4 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 20 6 21 6 22 6 @@ -139,6 +164,8 @@ class 'pkg/TestEclipseSwitchString' { 24 6 25 6 26 6 + 27 6 + 28 6 2c 11 2d 11 2e 11 @@ -146,6 +173,8 @@ class 'pkg/TestEclipseSwitchString' { 30 11 31 11 32 11 + 33 11 + 34 11 35 16 36 16 37 16 @@ -155,8 +184,6 @@ class 'pkg/TestEclipseSwitchString' { 3b 16 3c 16 3d 17 - 3e 17 - 3f 17 40 7 41 7 42 12 @@ -170,6 +197,39 @@ class 'pkg/TestEclipseSwitchString' { 4 22 5 22 6 22 + 7 22 + 8 22 + 9 22 + a 22 + b 22 + c 22 + d 22 + e 22 + f 22 + 10 22 + 11 22 + 12 22 + 13 22 + 14 22 + 15 22 + 16 22 + 17 22 + 18 22 + 19 22 + 1a 22 + 1b 22 + 1c 22 + 1d 22 + 1e 22 + 1f 22 + 20 22 + 21 22 + 22 22 + 23 22 + 24 22 + 25 22 + 26 22 + 27 22 28 24 29 24 2a 24 @@ -177,6 +237,8 @@ class 'pkg/TestEclipseSwitchString' { 2c 24 2d 24 2e 24 + 2f 24 + 30 24 34 29 35 29 36 29 @@ -184,6 +246,8 @@ class 'pkg/TestEclipseSwitchString' { 38 29 39 29 3a 29 + 3b 29 + 3c 29 40 34 41 34 42 34 @@ -191,6 +255,8 @@ class 'pkg/TestEclipseSwitchString' { 44 34 45 34 46 34 + 47 34 + 48 34 49 45 4a 45 4b 45 @@ -200,8 +266,6 @@ class 'pkg/TestEclipseSwitchString' { 4f 45 50 45 51 46 - 52 46 - 53 46 54 25 55 25 56 42 @@ -215,6 +279,39 @@ class 'pkg/TestEclipseSwitchString' { 4 51 5 51 6 51 + 7 51 + 8 51 + 9 51 + a 51 + b 51 + c 51 + d 51 + e 51 + f 51 + 10 51 + 11 51 + 12 51 + 13 51 + 14 51 + 15 51 + 16 51 + 17 51 + 18 51 + 19 51 + 1a 51 + 1b 51 + 1c 51 + 1d 51 + 1e 51 + 1f 51 + 20 51 + 21 51 + 22 51 + 23 51 + 24 51 + 25 51 + 26 51 + 27 51 28 53 29 53 2a 53 @@ -222,6 +319,8 @@ class 'pkg/TestEclipseSwitchString' { 2c 53 2d 53 2e 53 + 2f 53 + 30 53 34 60 35 60 36 60 @@ -229,6 +328,8 @@ class 'pkg/TestEclipseSwitchString' { 38 60 39 60 3a 60 + 3b 60 + 3c 60 40 65 41 65 42 65 @@ -236,6 +337,8 @@ class 'pkg/TestEclipseSwitchString' { 44 65 45 65 46 65 + 47 65 + 48 65 49 76 4a 76 4b 76 @@ -245,16 +348,14 @@ class 'pkg/TestEclipseSwitchString' { 4f 76 50 76 51 77 - 52 77 - 53 77 54 57 55 57 56 57 57 57 58 57 59 57 - 5a 77 - 5b 77 + 5a 57 + 5b 57 5c 73 5d 73 5e 77 @@ -266,6 +367,23 @@ class 'pkg/TestEclipseSwitchString' { 4 81 5 81 6 81 + 7 81 + 8 81 + 9 81 + a 81 + b 81 + c 81 + d 81 + e 81 + f 81 + 10 81 + 11 81 + 12 81 + 13 81 + 14 81 + 15 81 + 16 81 + 17 81 18 83 19 83 1a 83 @@ -273,6 +391,8 @@ class 'pkg/TestEclipseSwitchString' { 1c 83 1d 83 1e 83 + 1f 83 + 20 83 21 85 22 85 23 85 @@ -280,6 +400,8 @@ class 'pkg/TestEclipseSwitchString' { 25 85 26 85 27 85 + 28 85 + 29 85 2a 89 2b 89 2c 89 @@ -289,8 +411,6 @@ class 'pkg/TestEclipseSwitchString' { 30 89 31 89 32 90 - 33 90 - 34 90 35 84 36 84 37 86 @@ -304,6 +424,23 @@ class 'pkg/TestEclipseSwitchString' { 4 95 5 95 6 95 + 7 95 + 8 95 + 9 95 + a 95 + b 95 + c 95 + d 95 + e 95 + f 95 + 10 95 + 11 95 + 12 95 + 13 95 + 14 95 + 15 95 + 16 95 + 17 95 18 97 19 97 1a 97 @@ -311,6 +448,8 @@ class 'pkg/TestEclipseSwitchString' { 1c 97 1d 97 1e 97 + 1f 97 + 20 97 21 97 22 97 23 97 @@ -318,6 +457,8 @@ class 'pkg/TestEclipseSwitchString' { 25 97 26 97 27 97 + 28 97 + 29 97 2a 102 2b 102 2c 102 @@ -327,8 +468,6 @@ class 'pkg/TestEclipseSwitchString' { 30 102 31 102 32 103 - 33 103 - 34 103 35 98 36 98 37 103 @@ -340,6 +479,23 @@ class 'pkg/TestEclipseSwitchString' { 4 107 5 107 6 107 + 7 107 + 8 107 + 9 107 + a 107 + b 107 + c 107 + d 107 + e 107 + f 107 + 10 107 + 11 107 + 12 107 + 13 107 + 14 107 + 15 107 + 16 107 + 17 107 18 110 19 110 1a 110 @@ -347,6 +503,8 @@ class 'pkg/TestEclipseSwitchString' { 1c 110 1d 110 1e 110 + 1f 110 + 20 110 21 111 22 111 23 111 @@ -354,6 +512,8 @@ class 'pkg/TestEclipseSwitchString' { 25 111 26 111 27 111 + 28 111 + 29 111 2a 122 2b 122 2c 122 @@ -363,16 +523,14 @@ class 'pkg/TestEclipseSwitchString' { 30 122 31 122 32 123 - 33 123 - 34 123 35 115 36 115 37 115 38 115 39 115 3a 115 - 3b 123 - 3c 123 + 3b 115 + 3c 115 3d 118 3e 118 3f 123 diff --git a/testData/results/TestHotjava.dec b/testData/results/TestHotjava.dec index 46da14e491..4bb87a2799 100644 --- a/testData/results/TestHotjava.dec +++ b/testData/results/TestHotjava.dec @@ -81,11 +81,11 @@ class 'TestHotjava' { 3 7 4 7 5 7 + 6 7 + 7 7 d 9 e 9 f 9 - 10 9 - 11 9 12 9 13 9 14 9 @@ -103,6 +103,8 @@ class 'TestHotjava' { 7 19 8 19 9 19 + a 19 + b 19 d 25 e 26 10 21 @@ -119,6 +121,8 @@ class 'TestHotjava' { 7 34 8 34 9 34 + a 34 + b 34 d 40 e 41 10 36 @@ -135,11 +139,11 @@ class 'TestHotjava' { 7 50 8 50 9 50 + a 50 + b 50 13 52 14 52 15 52 - 16 52 - 17 52 18 52 19 52 1a 52 diff --git a/testData/results/TestIdeaNotNull.dec b/testData/results/TestIdeaNotNull.dec index 10a8919507..1a44a52ed7 100644 --- a/testData/results/TestIdeaNotNull.dec +++ b/testData/results/TestIdeaNotNull.dec @@ -120,16 +120,24 @@ class 'pkg/TestIdeaNotNull' { f 9 10 10 11 10 + 12 10 + 13 10 14 11 16 11 + 17 11 + 18 11 19 12 1a 12 + 1b 12 + 1c 12 1d 15 1e 17 1f 17 20 17 21 17 22 17 + 23 17 + 24 17 2c 18 30 18 34 18 @@ -141,16 +149,24 @@ class 'pkg/TestIdeaNotNull' { 3a 17 3e 21 40 21 + 41 21 + 42 21 43 22 44 22 + 45 22 + 46 22 47 25 } method 'test1 (Ljava/lang/String;)V' { 0 30 1 30 + 2 30 + 3 30 4 31 5 31 + 6 31 + 7 31 8 34 9 34 a 34 @@ -164,12 +180,20 @@ class 'pkg/TestIdeaNotNull' { method 'test2 (Ljava/lang/String;Ljava/lang/Integer;)V' { 0 38 1 38 + 2 38 + 3 38 4 39 5 39 + 6 39 + 7 39 8 42 9 42 + a 42 + b 42 c 43 d 43 + e 43 + f 43 10 46 11 46 12 46 @@ -190,18 +214,30 @@ class 'pkg/TestIdeaNotNull' { method 'test3 (Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Float;)V' { 0 51 1 51 + 2 51 + 3 51 4 52 5 52 + 6 52 + 7 52 8 55 9 55 + a 55 + b 55 c 56 d 56 e 56 + f 56 + 10 56 11 59 12 59 + 13 59 + 14 59 15 60 16 60 17 60 + 18 60 + 19 60 1a 63 1b 63 1c 63 @@ -221,11 +257,15 @@ class 'pkg/TestIdeaNotNull' { 2a 65 2b 65 2c 65 + 2d 65 + 2e 65 2f 66 30 66 31 66 32 66 33 66 + 34 66 + 35 66 36 68 } @@ -244,6 +284,8 @@ class 'pkg/TestIdeaNotNull' { 12 75 13 75 14 75 + 15 75 + 16 75 1e 76 22 76 26 76 @@ -260,9 +302,13 @@ class 'pkg/TestIdeaNotNull' { method 'test5 (Ljava/lang/Integer;)Ljava/lang/String;' { 0 84 1 84 + 2 84 + 3 84 4 85 5 85 6 85 + 7 85 + 8 85 9 88 a 88 b 88 @@ -271,11 +317,17 @@ class 'pkg/TestIdeaNotNull' { e 89 f 89 10 89 + 11 89 + 12 89 13 90 15 90 + 16 90 + 17 90 18 91 19 91 1a 91 + 1b 91 + 1c 91 1d 94 1e 96 1f 96 @@ -285,6 +337,8 @@ class 'pkg/TestIdeaNotNull' { 23 96 24 96 25 96 + 26 96 + 27 96 2f 97 33 97 37 97 @@ -296,9 +350,13 @@ class 'pkg/TestIdeaNotNull' { 3d 96 41 100 43 100 + 44 100 + 45 100 46 101 47 101 48 101 + 49 101 + 4a 101 4b 104 } } diff --git a/testData/results/TestJsr.dec b/testData/results/TestJsr.dec index 048ee69efd..671f9fd4f3 100644 --- a/testData/results/TestJsr.dec +++ b/testData/results/TestJsr.dec @@ -16,11 +16,11 @@ class 'TestJsr' { 3 3 4 3 5 3 + 6 3 + 7 3 d 5 e 5 f 5 - 10 5 - 11 5 12 5 13 5 14 5 diff --git a/testData/results/TestJsr2.dec b/testData/results/TestJsr2.dec index 4d37db61eb..bf8c8e4677 100644 --- a/testData/results/TestJsr2.dec +++ b/testData/results/TestJsr2.dec @@ -50,6 +50,8 @@ class 'TestJsr2' { 3 3 4 3 5 3 + 6 3 + 7 3 c 8 d 8 e 8 @@ -68,6 +70,8 @@ class 'TestJsr2' { 3 14 4 14 5 14 + 6 14 + 7 14 c 19 d 19 e 19 diff --git a/testData/results/TestSwitchOnEnumWithoutEnumJ21.dec b/testData/results/TestSwitchOnEnumWithoutEnumJ21.dec index 125643b359..4800e306db 100644 --- a/testData/results/TestSwitchOnEnumWithoutEnumJ21.dec +++ b/testData/results/TestSwitchOnEnumWithoutEnumJ21.dec @@ -19,6 +19,33 @@ class 'TestSwitchOnEnumWithoutEnumJ21' { 2 5 3 5 4 5 + 5 5 + 6 5 + 7 5 + 8 5 + 9 5 + a 5 + b 5 + c 5 + d 5 + e 5 + f 5 + 10 5 + 11 5 + 12 5 + 13 5 + 14 5 + 15 5 + 16 5 + 17 5 + 18 5 + 19 5 + 1a 5 + 1b 5 + 1c 5 + 1d 5 + 1e 5 + 1f 5 24 9 25 9 29 9 @@ -33,4 +60,4 @@ Lines mapping: 3 <-> 6 4 <-> 7 5 <-> 8 -6 <-> 9 +6 <-> 9 \ No newline at end of file diff --git a/testData/results/pkg/TestAccidentalSwitchExpression.dec b/testData/results/pkg/TestAccidentalSwitchExpression.dec index 690e0f167a..ea3fb465b8 100644 --- a/testData/results/pkg/TestAccidentalSwitchExpression.dec +++ b/testData/results/pkg/TestAccidentalSwitchExpression.dec @@ -26,16 +26,44 @@ class 'pkg/TestAccidentalSwitchExpression' { 1 4 2 4 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 8 1d 8 1e 10 1f 10 + 20 10 + 21 10 25 13 26 13 27 13 28 13 29 16 2a 16 + 2b 16 + 2c 16 2d 19 2e 17 2f 17 diff --git a/testData/results/pkg/TestAmbiguousArraylen.dec b/testData/results/pkg/TestAmbiguousArraylen.dec index a0baf63d68..69ff56792d 100644 --- a/testData/results/pkg/TestAmbiguousArraylen.dec +++ b/testData/results/pkg/TestAmbiguousArraylen.dec @@ -26,6 +26,8 @@ class 'pkg/TestAmbiguousArraylen' { 5 7 6 7 7 7 + 8 7 + 9 7 a 8 b 8 c 8 @@ -55,6 +57,8 @@ class 'pkg/TestAmbiguousArraylen' { 28 13 29 13 2a 13 + 2b 13 + 2c 13 2d 13 2e 13 2f 13 @@ -75,6 +79,8 @@ class 'pkg/TestAmbiguousArraylen' { 41 13 42 13 43 13 + 44 13 + 45 13 46 13 47 14 48 14 diff --git a/testData/results/pkg/TestAmbiguousCall.dec b/testData/results/pkg/TestAmbiguousCall.dec index 233d8c90b9..cf4eacf739 100644 --- a/testData/results/pkg/TestAmbiguousCall.dec +++ b/testData/results/pkg/TestAmbiguousCall.dec @@ -116,6 +116,8 @@ class 'pkg/TestAmbiguousCall' { 2 31 3 31 4 31 + 5 31 + 6 31 7 32 8 32 9 32 @@ -133,6 +135,8 @@ class 'pkg/TestAmbiguousCall' { 18 34 19 34 1a 34 + 1b 34 + 1c 34 1d 36 } @@ -142,6 +146,8 @@ class 'pkg/TestAmbiguousCall' { 2 39 3 39 4 39 + 5 39 + 6 39 7 40 8 40 9 40 @@ -159,6 +165,8 @@ class 'pkg/TestAmbiguousCall' { 18 42 19 42 1a 42 + 1b 42 + 1c 42 1d 44 } diff --git a/testData/results/pkg/TestAnonymousClass.dec b/testData/results/pkg/TestAnonymousClass.dec index e601852ee4..df70e506e0 100644 --- a/testData/results/pkg/TestAnonymousClass.dec +++ b/testData/results/pkg/TestAnonymousClass.dec @@ -213,6 +213,8 @@ class 'pkg/TestAnonymousClass' { method 'foo (I)V' { 0 54 1 54 + 2 54 + 3 54 c 55 d 62 e 62 @@ -227,6 +229,8 @@ class 'pkg/TestAnonymousClass' { 1a 65 1b 65 1c 65 + 1d 65 + 1e 65 1f 67 } @@ -416,4 +420,4 @@ Lines mapping: 169 <-> 114 Not mapped: 21 -115 \ No newline at end of file +115 diff --git a/testData/results/pkg/TestAnonymousClassNaming.dec b/testData/results/pkg/TestAnonymousClassNaming.dec index c76942ec31..4f348c7678 100644 --- a/testData/results/pkg/TestAnonymousClassNaming.dec +++ b/testData/results/pkg/TestAnonymousClassNaming.dec @@ -21,6 +21,8 @@ class 'pkg/TestAnonymousClassNaming' { method 'run (ILjava/lang/String;)V' { 9 5 a 5 + b 5 + c 5 16 6 17 12 } diff --git a/testData/results/pkg/TestArrayAssign.dec b/testData/results/pkg/TestArrayAssign.dec index 5598f63c4b..16cc93dbea 100644 --- a/testData/results/pkg/TestArrayAssign.dec +++ b/testData/results/pkg/TestArrayAssign.dec @@ -111,6 +111,8 @@ class 'pkg/TestArrayAssign' { 4 4 5 4 6 4 + 7 4 + 8 4 9 5 a 5 b 5 @@ -144,6 +146,8 @@ class 'pkg/TestArrayAssign' { 4 14 5 14 6 14 + 7 14 + 8 14 9 15 a 15 b 15 @@ -196,6 +200,8 @@ class 'pkg/TestArrayAssign' { 4 29 5 29 6 29 + 7 29 + 8 29 9 30 a 30 b 30 @@ -226,6 +232,8 @@ class 'pkg/TestArrayAssign' { 4 35 5 35 6 35 + 7 35 + 8 35 9 36 a 36 b 36 @@ -250,6 +258,8 @@ class 'pkg/TestArrayAssign' { 4 41 5 41 6 41 + 7 41 + 8 41 9 42 a 42 b 42 @@ -340,6 +350,8 @@ class 'pkg/TestArrayAssign' { 4 59 5 59 6 59 + 7 59 + 8 59 9 60 a 60 b 60 @@ -370,6 +382,8 @@ class 'pkg/TestArrayAssign' { 4 65 5 65 6 65 + 7 65 + 8 65 9 66 a 66 b 66 @@ -394,6 +408,8 @@ class 'pkg/TestArrayAssign' { 4 71 5 71 6 71 + 7 71 + 8 71 9 72 a 72 b 72 diff --git a/testData/results/pkg/TestArrayAssign2.dec b/testData/results/pkg/TestArrayAssign2.dec index 2e28086cb9..7000480094 100644 --- a/testData/results/pkg/TestArrayAssign2.dec +++ b/testData/results/pkg/TestArrayAssign2.dec @@ -26,6 +26,8 @@ class 'pkg/TestArrayAssign2' { method 'test (Z[Ljava/lang/Object;)Ljava/lang/Object;' { 0 4 1 4 + 2 4 + 3 4 4 5 5 5 6 5 @@ -45,6 +47,8 @@ class 'pkg/TestArrayAssign2' { method 'test1 (Z[Ljava/lang/String;)Ljava/lang/Object;' { 0 12 1 12 + 2 12 + 3 12 4 13 5 13 6 13 diff --git a/testData/results/pkg/TestArrayCopy.dec b/testData/results/pkg/TestArrayCopy.dec index 34b465e5f6..3d91646ec3 100644 --- a/testData/results/pkg/TestArrayCopy.dec +++ b/testData/results/pkg/TestArrayCopy.dec @@ -32,6 +32,8 @@ class 'pkg/TestArrayCopy' { 17 8 18 8 19 8 + 1a 8 + 1b 8 1c 9 1d 9 1e 9 diff --git a/testData/results/pkg/TestArrayDoWhile.dec b/testData/results/pkg/TestArrayDoWhile.dec index d3bdb25bc4..cd0fed2271 100644 --- a/testData/results/pkg/TestArrayDoWhile.dec +++ b/testData/results/pkg/TestArrayDoWhile.dec @@ -43,6 +43,8 @@ class 'pkg/TestArrayDoWhile' { 1a 10 1b 10 1c 10 + 1d 10 + 1e 10 1f 12 20 12 } diff --git a/testData/results/pkg/TestArrayFieldAccess.dec b/testData/results/pkg/TestArrayFieldAccess.dec index 5d9f9e030a..ca4f7a0005 100644 --- a/testData/results/pkg/TestArrayFieldAccess.dec +++ b/testData/results/pkg/TestArrayFieldAccess.dec @@ -101,6 +101,8 @@ class 'pkg/TestArrayFieldAccess' { 15 17 16 17 17 17 + 18 17 + 19 17 1a 20 1b 18 1c 18 @@ -167,6 +169,8 @@ class 'pkg/TestArrayFieldAccess' { c 32 e 32 f 32 + 10 32 + 11 32 12 33 13 33 14 33 @@ -180,6 +184,8 @@ class 'pkg/TestArrayFieldAccess' { 1c 33 1d 33 1e 33 + 1f 33 + 20 33 21 35 } @@ -197,6 +203,8 @@ class 'pkg/TestArrayFieldAccess' { d 38 e 38 f 38 + 10 38 + 11 38 12 39 13 39 14 39 @@ -210,6 +218,8 @@ class 'pkg/TestArrayFieldAccess' { 1c 39 1d 39 1e 39 + 1f 39 + 20 39 21 41 } } diff --git a/testData/results/pkg/TestArrayFieldAccess1.dec b/testData/results/pkg/TestArrayFieldAccess1.dec index c8a1884974..2fe980fd06 100644 --- a/testData/results/pkg/TestArrayFieldAccess1.dec +++ b/testData/results/pkg/TestArrayFieldAccess1.dec @@ -111,6 +111,8 @@ class 'pkg/TestArrayFieldAccess1' { 17 17 18 17 19 17 + 1a 17 + 1b 17 1c 20 1d 18 1e 18 @@ -183,6 +185,8 @@ class 'pkg/TestArrayFieldAccess1' { e 32 10 32 11 32 + 12 32 + 13 32 14 33 15 33 16 33 @@ -198,6 +202,8 @@ class 'pkg/TestArrayFieldAccess1' { 20 33 21 33 22 33 + 23 33 + 24 33 25 35 } @@ -217,6 +223,8 @@ class 'pkg/TestArrayFieldAccess1' { f 38 10 38 11 38 + 12 38 + 13 38 14 39 15 39 16 39 @@ -232,6 +240,8 @@ class 'pkg/TestArrayFieldAccess1' { 20 39 21 39 22 39 + 23 39 + 24 39 25 41 } diff --git a/testData/results/pkg/TestArrayTernary.dec b/testData/results/pkg/TestArrayTernary.dec index e85bdc4b55..0cef91ddb7 100644 --- a/testData/results/pkg/TestArrayTernary.dec +++ b/testData/results/pkg/TestArrayTernary.dec @@ -23,16 +23,22 @@ class 'pkg/TestArrayTernary' { 27 5 28 6 29 6 + 2a 6 + 2b 6 2c 6 30 6 31 6 32 6 33 6 + 34 6 + 35 6 36 6 37 6 3b 6 3c 6 3d 6 + 3e 6 + 3f 6 40 6 44 6 45 6 @@ -40,22 +46,30 @@ class 'pkg/TestArrayTernary' { 47 6 48 6 49 6 + 4a 6 + 4b 6 4c 6 50 6 51 6 52 7 53 7 + 54 7 + 55 7 56 7 5a 7 5b 7 5c 7 5d 7 + 5e 7 + 5f 7 60 7 64 7 65 7 66 7 67 7 68 7 + 69 7 + 6a 7 6b 7 6f 7 70 7 diff --git a/testData/results/pkg/TestAssertJ16.dec b/testData/results/pkg/TestAssertJ16.dec index a3c62672a9..4e57cd44af 100644 --- a/testData/results/pkg/TestAssertJ16.dec +++ b/testData/results/pkg/TestAssertJ16.dec @@ -10,6 +10,8 @@ class 'pkg/TestAssertJ16' { method 'test (I)V' { 6 4 7 4 + 8 4 + 9 4 12 5 } } diff --git a/testData/results/pkg/TestAssertMerge.dec b/testData/results/pkg/TestAssertMerge.dec index 5c787827d6..9e5c7878b9 100644 --- a/testData/results/pkg/TestAssertMerge.dec +++ b/testData/results/pkg/TestAssertMerge.dec @@ -20,12 +20,18 @@ class 'pkg/TestAssertMerge' { 1 4 2 4 3 4 + 4 4 + 5 4 6 4 7 4 + 8 4 + 9 4 11 12 12 5 13 5 14 5 + 15 5 + 16 5 1a 9 1b 9 1c 9 diff --git a/testData/results/pkg/TestAssertSwitchExpression.dec b/testData/results/pkg/TestAssertSwitchExpression.dec index 3aeb19c9ac..1a59f34d69 100644 --- a/testData/results/pkg/TestAssertSwitchExpression.dec +++ b/testData/results/pkg/TestAssertSwitchExpression.dec @@ -15,11 +15,39 @@ class 'pkg/TestAssertSwitchExpression' { 6 4 7 4 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 24 5 25 5 29 6 2a 6 2e 7 + 2f 7 30 4 31 4 32 4 diff --git a/testData/results/pkg/TestAsserts.dec b/testData/results/pkg/TestAsserts.dec index d2b5aa719a..17dda0bf64 100644 --- a/testData/results/pkg/TestAsserts.dec +++ b/testData/results/pkg/TestAsserts.dec @@ -19,12 +19,18 @@ class 'pkg/TestAsserts' { 8 6 9 6 a 6 + b 6 + c 6 1b 8 1c 8 1d 8 + 1e 8 + 1f 8 20 8 21 8 22 8 + 23 8 + 24 8 2d 10 2e 10 } diff --git a/testData/results/pkg/TestAssignmentInDoWhile.dec b/testData/results/pkg/TestAssignmentInDoWhile.dec index c2834b800f..e4ac66a659 100644 --- a/testData/results/pkg/TestAssignmentInDoWhile.dec +++ b/testData/results/pkg/TestAssignmentInDoWhile.dec @@ -72,12 +72,16 @@ class 'pkg/TestAssignmentInDoWhile' { 3 6 4 6 5 6 + 6 6 + 7 6 9 6 a 6 b 6 c 6 d 6 e 6 + f 6 + 10 6 11 9 12 9 13 9 @@ -96,6 +100,8 @@ class 'pkg/TestAssignmentInDoWhile' { 3 15 4 15 5 15 + 6 15 + 7 15 8 16 9 16 a 16 @@ -103,6 +109,8 @@ class 'pkg/TestAssignmentInDoWhile' { c 17 d 17 e 17 + f 17 + 10 17 11 22 12 22 13 22 @@ -124,6 +132,8 @@ class 'pkg/TestAssignmentInDoWhile' { 8 29 9 29 a 29 + b 29 + c 29 d 29 e 29 f 29 @@ -133,6 +143,8 @@ class 'pkg/TestAssignmentInDoWhile' { 14 29 15 29 16 29 + 17 29 + 18 29 19 32 1a 32 1b 32 @@ -154,6 +166,8 @@ class 'pkg/TestAssignmentInDoWhile' { 8 39 9 39 a 39 + b 39 + c 39 d 39 e 39 f 39 @@ -166,6 +180,8 @@ class 'pkg/TestAssignmentInDoWhile' { 17 39 18 39 19 39 + 1a 39 + 1b 39 1c 42 1d 42 1e 42 @@ -187,6 +203,8 @@ class 'pkg/TestAssignmentInDoWhile' { 8 49 9 49 a 49 + b 49 + c 49 d 49 e 49 f 49 @@ -196,10 +214,14 @@ class 'pkg/TestAssignmentInDoWhile' { 14 49 15 49 16 49 + 17 49 + 18 49 19 49 1a 49 1b 49 1c 49 + 1d 49 + 1e 49 1f 52 20 52 21 52 @@ -221,6 +243,8 @@ class 'pkg/TestAssignmentInDoWhile' { 8 59 9 59 a 59 + b 59 + c 59 d 59 e 59 f 59 @@ -230,10 +254,14 @@ class 'pkg/TestAssignmentInDoWhile' { 14 59 15 59 16 59 + 17 59 + 18 59 19 59 1a 59 1b 59 1c 59 + 1d 59 + 1e 59 1f 62 20 62 21 62 diff --git a/testData/results/pkg/TestAssignmentInLoop.dec b/testData/results/pkg/TestAssignmentInLoop.dec index b31a2b6c0b..1bf6c82a5e 100644 --- a/testData/results/pkg/TestAssignmentInLoop.dec +++ b/testData/results/pkg/TestAssignmentInLoop.dec @@ -40,6 +40,8 @@ class 'pkg/TestAssignmentInLoop' { 6 10 9 10 a 10 + b 10 + c 10 d 11 e 11 f 11 @@ -53,6 +55,8 @@ class 'pkg/TestAssignmentInLoop' { 1a 14 1b 14 1c 14 + 1d 14 + 1e 14 1f 15 20 15 21 15 @@ -73,6 +77,8 @@ class 'pkg/TestAssignmentInLoop' { 34 18 36 18 37 18 + 38 18 + 39 18 3a 19 3b 19 3c 19 @@ -85,6 +91,8 @@ class 'pkg/TestAssignmentInLoop' { 46 22 47 22 48 22 + 49 22 + 4a 22 4b 23 4c 23 4d 23 diff --git a/testData/results/pkg/TestAssignmentSwitchExpression1.dec b/testData/results/pkg/TestAssignmentSwitchExpression1.dec index 57b85e3a63..0709773def 100644 --- a/testData/results/pkg/TestAssignmentSwitchExpression1.dec +++ b/testData/results/pkg/TestAssignmentSwitchExpression1.dec @@ -25,6 +25,68 @@ class 'pkg/TestAssignmentSwitchExpression1' { method 'test (I)V' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 + 24 4 + 25 4 + 26 4 + 27 4 + 28 4 + 29 4 + 2a 4 + 2b 4 + 2c 4 + 2d 4 + 2e 4 + 2f 4 + 30 4 + 31 4 + 32 4 + 33 4 + 34 4 + 35 4 + 36 4 + 37 4 + 38 4 + 39 4 + 3a 4 + 3b 4 + 3c 4 + 3d 4 + 3e 4 + 3f 4 40 5 41 5 45 6 diff --git a/testData/results/pkg/TestAssignmentSwitchExpression2.dec b/testData/results/pkg/TestAssignmentSwitchExpression2.dec index 3a15a1feed..c2b914fa18 100644 --- a/testData/results/pkg/TestAssignmentSwitchExpression2.dec +++ b/testData/results/pkg/TestAssignmentSwitchExpression2.dec @@ -15,6 +15,68 @@ class 'pkg/TestAssignmentSwitchExpression2' { method 'test (I)V' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 + 24 4 + 25 4 + 26 4 + 27 4 + 28 4 + 29 4 + 2a 4 + 2b 4 + 2c 4 + 2d 4 + 2e 4 + 2f 4 + 30 4 + 31 4 + 32 4 + 33 4 + 34 4 + 35 4 + 36 4 + 37 4 + 38 4 + 39 4 + 3a 4 + 3b 4 + 3c 4 + 3d 4 + 3e 4 + 3f 4 40 5 41 5 45 6 diff --git a/testData/results/pkg/TestAssignmentSwitchExpression3.dec b/testData/results/pkg/TestAssignmentSwitchExpression3.dec index 72f0c7bd5f..dc7957669d 100644 --- a/testData/results/pkg/TestAssignmentSwitchExpression3.dec +++ b/testData/results/pkg/TestAssignmentSwitchExpression3.dec @@ -24,6 +24,84 @@ class 'pkg/TestAssignmentSwitchExpression3' { method 'test (I)V' { 0 6 1 6 + 2 6 + 3 6 + 4 6 + 5 6 + 6 6 + 7 6 + 8 6 + 9 6 + a 6 + b 6 + c 6 + d 6 + e 6 + f 6 + 10 6 + 11 6 + 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 + 24 6 + 25 6 + 26 6 + 27 6 + 28 6 + 29 6 + 2a 6 + 2b 6 + 2c 6 + 2d 6 + 2e 6 + 2f 6 + 30 6 + 31 6 + 32 6 + 33 6 + 34 6 + 35 6 + 36 6 + 37 6 + 38 6 + 39 6 + 3a 6 + 3b 6 + 3c 6 + 3d 6 + 3e 6 + 3f 6 + 40 6 + 41 6 + 42 6 + 43 6 + 44 6 + 45 6 + 46 6 + 47 6 + 48 6 + 49 6 + 4a 6 + 4b 6 + 4c 6 + 4d 6 + 4e 6 + 4f 6 50 13 51 13 52 13 diff --git a/testData/results/pkg/TestAssignmentSwitchExpression4.dec b/testData/results/pkg/TestAssignmentSwitchExpression4.dec index 7e51e0ada4..1bfeb10644 100644 --- a/testData/results/pkg/TestAssignmentSwitchExpression4.dec +++ b/testData/results/pkg/TestAssignmentSwitchExpression4.dec @@ -35,6 +35,44 @@ class 'pkg/TestAssignmentSwitchExpression4' { 94 9 95 9 a1 6 + a2 6 + a3 6 + a4 6 + a5 6 + a6 6 + a7 6 + a8 6 + a9 6 + aa 6 + ab 6 + ac 6 + ad 6 + ae 6 + af 6 + b0 6 + b1 6 + b2 6 + b3 6 + b4 6 + b5 6 + b6 6 + b7 6 + b8 6 + b9 6 + ba 6 + bb 6 + bc 6 + bd 6 + be 6 + bf 6 + c0 6 + c1 6 + c2 6 + c3 6 + c4 6 + c5 6 + c6 6 + c7 6 c8 7 c9 7 cd 8 diff --git a/testData/results/pkg/TestAssignmentSwitchExpression5.dec b/testData/results/pkg/TestAssignmentSwitchExpression5.dec index 876a4ef908..4e0abf0cc9 100644 --- a/testData/results/pkg/TestAssignmentSwitchExpression5.dec +++ b/testData/results/pkg/TestAssignmentSwitchExpression5.dec @@ -26,6 +26,8 @@ class 'pkg/TestAssignmentSwitchExpression5' { 1 4 2 6 3 6 + 4 6 + 5 6 6 7 7 7 8 7 @@ -47,6 +49,42 @@ class 'pkg/TestAssignmentSwitchExpression5' { a2 12 a3 12 af 9 + b0 9 + b1 9 + b2 9 + b3 9 + b4 9 + b5 9 + b6 9 + b7 9 + b8 9 + b9 9 + ba 9 + bb 9 + bc 9 + bd 9 + be 9 + bf 9 + c0 9 + c1 9 + c2 9 + c3 9 + c4 9 + c5 9 + c6 9 + c7 9 + c8 9 + c9 9 + ca 9 + cb 9 + cc 9 + cd 9 + ce 9 + cf 9 + d0 9 + d1 9 + d2 9 + d3 9 d4 10 d5 10 d9 11 @@ -85,4 +123,4 @@ Lines mapping: 18 <-> 14 20 <-> 16 22 <-> 19 -23 <-> 20 \ No newline at end of file +23 <-> 20 diff --git a/testData/results/pkg/TestAssignmentSwitchExpression6.dec b/testData/results/pkg/TestAssignmentSwitchExpression6.dec index 2d6ec2828a..b52ca2d3f3 100644 --- a/testData/results/pkg/TestAssignmentSwitchExpression6.dec +++ b/testData/results/pkg/TestAssignmentSwitchExpression6.dec @@ -26,6 +26,8 @@ class 'pkg/TestAssignmentSwitchExpression6' { 1 4 2 6 3 6 + 4 6 + 5 6 6 7 7 7 8 7 @@ -50,6 +52,42 @@ class 'pkg/TestAssignmentSwitchExpression6' { a2 13 a3 13 af 10 + b0 10 + b1 10 + b2 10 + b3 10 + b4 10 + b5 10 + b6 10 + b7 10 + b8 10 + b9 10 + ba 10 + bb 10 + bc 10 + bd 10 + be 10 + bf 10 + c0 10 + c1 10 + c2 10 + c3 10 + c4 10 + c5 10 + c6 10 + c7 10 + c8 10 + c9 10 + ca 10 + cb 10 + cc 10 + cd 10 + ce 10 + cf 10 + d0 10 + d1 10 + d2 10 + d3 10 d4 11 d5 11 d9 12 @@ -85,4 +123,4 @@ Lines mapping: 17 <-> 14 19 <-> 15 23 <-> 19 -24 <-> 20 \ No newline at end of file +24 <-> 20 diff --git a/testData/results/pkg/TestAssignmentSwitchExpression7.dec b/testData/results/pkg/TestAssignmentSwitchExpression7.dec index 852b7c28aa..a5a7c3ac21 100644 --- a/testData/results/pkg/TestAssignmentSwitchExpression7.dec +++ b/testData/results/pkg/TestAssignmentSwitchExpression7.dec @@ -15,11 +15,38 @@ class 'pkg/TestAssignmentSwitchExpression7' { method 'test (I)V' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 5 1d 5 21 6 22 6 26 7 + 27 7 28 4 29 9 2a 9 diff --git a/testData/results/pkg/TestAssignmentTernaryConstantSimplification.dec b/testData/results/pkg/TestAssignmentTernaryConstantSimplification.dec index 75c9446069..44784a6153 100644 --- a/testData/results/pkg/TestAssignmentTernaryConstantSimplification.dec +++ b/testData/results/pkg/TestAssignmentTernaryConstantSimplification.dec @@ -84,6 +84,8 @@ class 'pkg/TestAssignmentTernaryConstantSimplification' { method 'ternaryNotAnd (ZZ)V' { 0 4 1 4 + 2 4 + 3 4 8 4 9 4 a 5 @@ -99,6 +101,8 @@ class 'pkg/TestAssignmentTernaryConstantSimplification' { method 'ifOr (ZZ)V' { 0 10 1 10 + 2 10 + 3 10 4 11 5 11 9 13 @@ -116,6 +120,8 @@ class 'pkg/TestAssignmentTernaryConstantSimplification' { method 'ternaryNotOr (ZZ)V' { 0 20 1 20 + 2 20 + 3 20 4 20 9 20 a 21 @@ -131,6 +137,8 @@ class 'pkg/TestAssignmentTernaryConstantSimplification' { method 'ternaryAnd (ZZ)V' { 0 25 1 25 + 2 25 + 3 25 4 25 9 25 a 26 @@ -146,6 +154,8 @@ class 'pkg/TestAssignmentTernaryConstantSimplification' { method 'redundantIf (Z)V' { 0 31 1 31 + 2 31 + 3 31 4 32 5 32 9 34 @@ -163,6 +173,8 @@ class 'pkg/TestAssignmentTernaryConstantSimplification' { method 'redundantTernary (Z)V' { 0 41 1 41 + 2 41 + 3 41 a 41 b 41 c 41 @@ -176,8 +188,12 @@ class 'pkg/TestAssignmentTernaryConstantSimplification' { method 'nestedIf (ZZ)V' { 0 46 1 46 + 2 46 + 3 46 4 47 5 47 + 6 47 + 7 47 8 48 9 48 d 50 @@ -197,8 +213,12 @@ class 'pkg/TestAssignmentTernaryConstantSimplification' { method 'nestedTernary (ZZ)V' { 0 60 1 60 + 2 60 + 3 60 4 60 5 60 + 6 60 + 7 60 11 60 12 61 13 61 @@ -213,8 +233,12 @@ class 'pkg/TestAssignmentTernaryConstantSimplification' { method 'nestedIfs (ZZZ)V' { 0 66 1 66 + 2 66 + 3 66 4 67 5 67 + 6 67 + 7 67 8 68 9 68 a 68 @@ -223,6 +247,8 @@ class 'pkg/TestAssignmentTernaryConstantSimplification' { 10 70 14 72 15 72 + 16 72 + 17 72 18 73 19 73 1a 73 diff --git a/testData/results/pkg/TestBackwardsExceptionHandler.dec b/testData/results/pkg/TestBackwardsExceptionHandler.dec index 95f2b4c8e8..df94c66470 100644 --- a/testData/results/pkg/TestBackwardsExceptionHandler.dec +++ b/testData/results/pkg/TestBackwardsExceptionHandler.dec @@ -27,6 +27,8 @@ public class TestBackwardsExceptionHandler { class 'pkg/TestBackwardsExceptionHandler' { method 'testExtraReturn (I)V' { 3 9 + 4 9 + 5 9 6 6 7 6 8 6 @@ -38,6 +40,8 @@ class 'pkg/TestBackwardsExceptionHandler' { method 'test (I)V' { 3 20 + 4 20 + 5 20 6 17 7 17 8 17 diff --git a/testData/results/pkg/TestBinaryOperationWrapping.dec b/testData/results/pkg/TestBinaryOperationWrapping.dec index dfc7c6c336..05ff334d14 100644 --- a/testData/results/pkg/TestBinaryOperationWrapping.dec +++ b/testData/results/pkg/TestBinaryOperationWrapping.dec @@ -93,91 +93,151 @@ class 'pkg/TestBinaryOperationWrapping' { 2 47 3 49 4 49 + 5 49 + 6 49 7 49 8 49 + 9 49 + a 49 b 50 c 49 + d 49 + e 49 f 50 10 50 11 49 + 12 49 + 13 49 14 51 15 51 16 49 + 17 49 + 18 49 19 51 1a 51 1b 49 + 1c 49 + 1d 49 1e 52 1f 52 20 49 + 21 49 + 22 49 23 52 24 52 25 49 + 26 49 + 27 49 28 53 29 53 2a 49 + 2b 49 + 2c 49 2d 53 2e 53 2f 49 + 30 49 + 31 49 32 54 33 54 34 49 + 35 49 + 36 49 37 54 38 54 39 49 + 3a 49 + 3b 49 3c 55 3d 55 3e 49 + 3f 49 + 40 49 41 55 42 55 43 49 + 44 49 + 45 49 46 56 47 56 48 49 + 49 49 + 4a 49 4b 56 4c 56 4d 49 + 4e 49 + 4f 49 50 57 51 57 52 49 + 53 49 + 54 49 55 57 56 57 57 49 + 58 49 + 59 49 5a 58 5b 58 5c 49 + 5d 49 + 5e 49 5f 58 60 58 61 49 + 62 49 + 63 49 64 59 65 59 66 49 + 67 49 + 68 49 69 59 6a 59 6b 49 + 6c 49 + 6d 49 6e 60 6f 60 70 49 + 71 49 + 72 49 73 60 74 60 75 49 + 76 49 + 77 49 78 61 79 61 7a 49 + 7b 49 + 7c 49 7d 61 7e 61 7f 49 + 80 49 + 81 49 82 62 83 62 84 49 + 85 49 + 86 49 87 62 88 62 89 49 + 8a 49 + 8b 49 8c 63 8d 63 8e 49 + 8f 49 + 90 49 91 63 92 63 93 49 + 94 49 + 95 49 9b 48 9c 48 9d 48 diff --git a/testData/results/pkg/TestBlankLinesSpaces.dec b/testData/results/pkg/TestBlankLinesSpaces.dec index c716ca4bc9..979d65fd24 100644 --- a/testData/results/pkg/TestBlankLinesSpaces.dec +++ b/testData/results/pkg/TestBlankLinesSpaces.dec @@ -53,6 +53,8 @@ class 'pkg/TestBlankLinesSpaces' { 3 19 4 19 5 19 + 6 19 + 7 19 8 20 9 20 a 20 @@ -67,11 +69,15 @@ class 'pkg/TestBlankLinesSpaces' { 1d 23 1e 23 1f 23 + 20 23 + 21 23 22 24 23 24 24 24 25 24 26 24 + 27 24 + 28 24 29 26 } } diff --git a/testData/results/pkg/TestBooleanAssignment.dec b/testData/results/pkg/TestBooleanAssignment.dec index d24cedef99..7739c7eed7 100644 --- a/testData/results/pkg/TestBooleanAssignment.dec +++ b/testData/results/pkg/TestBooleanAssignment.dec @@ -14,11 +14,15 @@ class 'pkg/TestBooleanAssignment' { method 'test (ZZZ)Z' { 0 4 3 4 + 4 4 + 5 4 6 5 7 5 8 5 9 5 a 5 + b 5 + c 5 d 8 e 8 } diff --git a/testData/results/pkg/TestBooleanExpressions.dec b/testData/results/pkg/TestBooleanExpressions.dec index a8f127c78e..0ca7c27849 100644 --- a/testData/results/pkg/TestBooleanExpressions.dec +++ b/testData/results/pkg/TestBooleanExpressions.dec @@ -25,10 +25,14 @@ class 'pkg/TestBooleanExpressions' { method 'test (I)I' { 0 7 1 7 + 2 7 + 3 7 4 7 5 7 6 7 7 7 + 8 7 + 9 7 a 7 b 7 c 7 @@ -39,6 +43,8 @@ class 'pkg/TestBooleanExpressions' { 11 7 12 7 13 7 + 14 7 + 15 7 16 7 17 7 18 7 diff --git a/testData/results/pkg/TestBooleanSwitchExpression1.dec b/testData/results/pkg/TestBooleanSwitchExpression1.dec index 94d1ca42b2..14f900ec43 100644 --- a/testData/results/pkg/TestBooleanSwitchExpression1.dec +++ b/testData/results/pkg/TestBooleanSwitchExpression1.dec @@ -57,30 +57,96 @@ class 'pkg/TestBooleanSwitchExpression1' { method 'test (II)V' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 6 1d 6 + 1e 6 + 1f 6 23 11 24 11 + 25 11 + 26 11 2a 16 2b 16 + 2c 16 + 2d 16 2e 21 2f 21 30 21 31 21 32 21 33 21 + 34 21 + 35 21 36 7 } method 'test1 (II)V' { 0 27 1 27 + 2 27 + 3 27 + 4 27 + 5 27 + 6 27 + 7 27 + 8 27 + 9 27 + a 27 + b 27 + c 27 + d 27 + e 27 + f 27 + 10 27 + 11 27 + 12 27 + 13 27 + 14 27 + 15 27 + 16 27 + 17 27 + 18 27 + 19 27 + 1a 27 + 1b 27 1c 29 1d 29 + 1e 29 + 1f 29 23 34 24 34 + 25 34 + 26 34 2a 39 2b 39 + 2c 39 + 2d 39 2e 48 2f 48 30 48 @@ -95,6 +161,8 @@ class 'pkg/TestBooleanSwitchExpression1' { 3c 44 3d 44 3e 44 + 3f 44 + 40 44 41 51 42 51 43 51 diff --git a/testData/results/pkg/TestBooleanSwitchExpression2.dec b/testData/results/pkg/TestBooleanSwitchExpression2.dec index f50a34063a..39d4f68db9 100644 --- a/testData/results/pkg/TestBooleanSwitchExpression2.dec +++ b/testData/results/pkg/TestBooleanSwitchExpression2.dec @@ -75,18 +75,52 @@ class 'pkg/TestBooleanSwitchExpression2' { 34 10 35 10 41 4 + 42 4 + 43 4 + 44 4 + 45 4 + 46 4 + 47 4 + 48 4 + 49 4 + 4a 4 + 4b 4 + 4c 4 + 4d 4 + 4e 4 + 4f 4 + 50 4 + 51 4 + 52 4 + 53 4 + 54 4 + 55 4 + 56 4 + 57 4 + 58 4 + 59 4 + 5a 4 + 5b 4 5c 6 5d 6 + 5e 6 + 5f 6 63 11 64 11 + 65 11 + 66 11 6a 16 6b 16 + 6c 16 + 6d 16 71 21 72 21 73 21 74 21 75 21 76 21 + 77 21 + 78 21 79 7 } @@ -100,6 +134,32 @@ class 'pkg/TestBooleanSwitchExpression2' { 7 26 8 26 9 26 + a 26 + b 26 + c 26 + d 26 + e 26 + f 26 + 10 26 + 11 26 + 12 26 + 13 26 + 14 26 + 15 26 + 16 26 + 17 26 + 18 26 + 19 26 + 1a 26 + 1b 26 + 1c 26 + 1d 26 + 1e 26 + 1f 26 + 20 26 + 21 26 + 22 26 + 23 26 24 28 25 28 26 28 @@ -107,6 +167,8 @@ class 'pkg/TestBooleanSwitchExpression2' { 28 28 29 28 2a 28 + 2b 28 + 2c 28 2d 29 2e 29 2f 29 @@ -117,18 +179,52 @@ class 'pkg/TestBooleanSwitchExpression2' { 37 33 38 33 39 33 + 3a 33 + 3b 33 3c 34 3d 34 3e 34 3f 40 40 40 41 40 + 42 40 + 43 40 + 44 40 + 45 40 + 46 40 + 47 40 + 48 40 + 49 40 + 4a 40 + 4b 40 + 4c 40 + 4d 40 + 4e 40 + 4f 40 + 50 40 + 51 40 + 52 40 + 53 40 + 54 40 + 55 40 + 56 40 + 57 40 + 58 40 + 59 40 + 5a 40 + 5b 40 5c 42 5d 42 + 5e 42 + 5f 42 63 47 64 47 + 65 47 + 66 47 6a 52 6b 52 + 6c 52 + 6d 52 71 61 72 61 73 61 @@ -143,6 +239,8 @@ class 'pkg/TestBooleanSwitchExpression2' { 7f 57 80 57 81 57 + 82 57 + 83 57 84 64 85 64 86 64 diff --git a/testData/results/pkg/TestBooleanSwitchExpression3.dec b/testData/results/pkg/TestBooleanSwitchExpression3.dec index a6ebe0edfb..795bc0410b 100644 --- a/testData/results/pkg/TestBooleanSwitchExpression3.dec +++ b/testData/results/pkg/TestBooleanSwitchExpression3.dec @@ -72,18 +72,52 @@ class 'pkg/TestBooleanSwitchExpression3' { 2c 5 2d 5 39 4 + 3a 4 + 3b 4 + 3c 4 + 3d 4 + 3e 4 + 3f 4 + 40 4 + 41 4 + 42 4 + 43 4 + 44 4 + 45 4 + 46 4 + 47 4 + 48 4 + 49 4 + 4a 4 + 4b 4 + 4c 4 + 4d 4 + 4e 4 + 4f 4 + 50 4 + 51 4 + 52 4 + 53 4 54 6 55 6 + 56 6 + 57 6 5b 11 5c 11 + 5d 11 + 5e 11 62 16 63 16 + 64 16 + 65 16 69 21 6a 21 6b 21 6c 21 6d 21 6e 21 + 6f 21 + 70 21 71 7 } @@ -97,6 +131,24 @@ class 'pkg/TestBooleanSwitchExpression3' { 7 26 8 26 9 26 + a 26 + b 26 + c 26 + d 26 + e 26 + f 26 + 10 26 + 11 26 + 12 26 + 13 26 + 14 26 + 15 26 + 16 26 + 17 26 + 18 26 + 19 26 + 1a 26 + 1b 26 1c 28 1d 28 1e 28 @@ -104,6 +156,8 @@ class 'pkg/TestBooleanSwitchExpression3' { 20 28 21 28 22 28 + 23 28 + 24 28 25 29 26 29 27 29 @@ -114,18 +168,52 @@ class 'pkg/TestBooleanSwitchExpression3' { 2f 30 30 30 31 30 + 32 30 + 33 30 34 31 35 31 36 31 37 37 38 37 39 37 + 3a 37 + 3b 37 + 3c 37 + 3d 37 + 3e 37 + 3f 37 + 40 37 + 41 37 + 42 37 + 43 37 + 44 37 + 45 37 + 46 37 + 47 37 + 48 37 + 49 37 + 4a 37 + 4b 37 + 4c 37 + 4d 37 + 4e 37 + 4f 37 + 50 37 + 51 37 + 52 37 + 53 37 54 39 55 39 + 56 39 + 57 39 5b 44 5c 44 + 5d 44 + 5e 44 62 49 63 49 + 64 49 + 65 49 69 58 6a 58 6b 58 @@ -140,6 +228,8 @@ class 'pkg/TestBooleanSwitchExpression3' { 77 54 78 54 79 54 + 7a 54 + 7b 54 7c 61 7d 61 7e 61 diff --git a/testData/results/pkg/TestBooleanSwitchExpression4.dec b/testData/results/pkg/TestBooleanSwitchExpression4.dec index f14dee5802..f946185352 100644 --- a/testData/results/pkg/TestBooleanSwitchExpression4.dec +++ b/testData/results/pkg/TestBooleanSwitchExpression4.dec @@ -109,12 +109,69 @@ class 'pkg/TestBooleanSwitchExpression4' { method 'test (III)V' { 0 5 1 5 + 2 5 + 3 5 + 4 5 + 5 5 + 6 5 + 7 5 + 8 5 + 9 5 + a 5 + b 5 + c 5 + d 5 + e 5 + f 5 + 10 5 + 11 5 + 12 5 + 13 5 + 14 5 + 15 5 + 16 5 + 17 5 + 18 5 + 19 5 + 1a 5 + 1b 5 1c 7 1d 7 + 1e 7 + 1f 7 23 12 24 12 + 25 12 + 26 12 + 27 12 + 28 12 + 29 12 + 2a 12 + 2b 12 + 2c 12 + 2d 12 + 2e 12 + 2f 12 + 30 12 + 31 12 + 32 12 + 33 12 + 34 12 + 35 12 + 36 12 + 37 12 + 38 12 + 39 12 + 3a 12 + 3b 12 + 3c 12 + 3d 12 + 3e 12 + 3f 12 46 18 47 18 + 48 18 + 49 18 4b 20 4c 20 4d 20 @@ -130,35 +187,104 @@ class 'pkg/TestBooleanSwitchExpression4' { 5b 23 5c 23 5d 23 + 5e 23 + 5f 23 60 24 61 24 62 24 63 24 + 64 24 + 65 24 69 31 6a 31 + 6b 31 + 6c 31 70 36 71 36 72 36 + 73 36 + 74 36 78 42 79 42 + 7a 42 + 7b 42 7c 47 7d 47 7e 47 7f 47 80 47 81 47 + 82 47 + 83 47 84 8 } method 'test1 (III)V' { 0 54 1 54 + 2 54 + 3 54 + 4 54 + 5 54 + 6 54 + 7 54 + 8 54 + 9 54 + a 54 + b 54 + c 54 + d 54 + e 54 + f 54 + 10 54 + 11 54 + 12 54 + 13 54 + 14 54 + 15 54 + 16 54 + 17 54 + 18 54 + 19 54 + 1a 54 + 1b 54 1c 56 1d 56 + 1e 56 + 1f 56 23 61 24 61 + 25 61 + 26 61 + 27 61 + 28 61 + 29 61 + 2a 61 + 2b 61 + 2c 61 + 2d 61 + 2e 61 + 2f 61 + 30 61 + 31 61 + 32 61 + 33 61 + 34 61 + 35 61 + 36 61 + 37 61 + 38 61 + 39 61 + 3a 61 + 3b 61 + 3c 61 + 3d 61 + 3e 61 + 3f 61 46 67 47 67 + 48 67 + 49 67 4b 69 4c 69 4d 69 @@ -174,17 +300,27 @@ class 'pkg/TestBooleanSwitchExpression4' { 5b 72 5c 72 5d 72 + 5e 72 + 5f 72 60 73 61 73 62 73 63 73 + 64 73 + 65 73 69 80 6a 80 + 6b 80 + 6c 80 70 85 71 85 72 85 + 73 85 + 74 85 78 91 79 91 + 7a 91 + 7b 91 7c 100 7d 100 7e 100 @@ -199,6 +335,8 @@ class 'pkg/TestBooleanSwitchExpression4' { 8a 96 8b 96 8c 96 + 8d 96 + 8e 96 8f 103 90 103 91 103 diff --git a/testData/results/pkg/TestBooleanSwitchExpression5.dec b/testData/results/pkg/TestBooleanSwitchExpression5.dec index e446dd90eb..b00bad30d9 100644 --- a/testData/results/pkg/TestBooleanSwitchExpression5.dec +++ b/testData/results/pkg/TestBooleanSwitchExpression5.dec @@ -99,15 +99,47 @@ class 'pkg/TestBooleanSwitchExpression5' { method 'test (III)V' { 0 5 1 5 + 2 5 + 3 5 + 4 5 + 5 5 + 6 5 + 7 5 + 8 5 + 9 5 + a 5 + b 5 + c 5 + d 5 + e 5 + f 5 + 10 5 + 11 5 + 12 5 + 13 5 + 14 5 + 15 5 + 16 5 + 17 5 + 18 5 + 19 5 + 1a 5 + 1b 5 1c 7 1d 7 + 1e 7 + 1f 7 20 11 22 11 23 11 24 12 25 12 + 26 12 + 27 12 2b 17 2c 17 + 2d 17 + 2e 17 2f 17 30 17 32 17 @@ -117,52 +149,100 @@ class 'pkg/TestBooleanSwitchExpression5' { 3a 17 3b 17 3c 17 + 3d 17 + 3e 17 42 22 43 22 + 44 22 + 45 22 46 23 47 23 49 23 4a 23 4b 24 4c 24 + 4d 24 + 4e 24 4f 24 50 24 51 24 52 24 + 53 24 + 54 24 58 28 59 28 5a 28 + 5b 28 + 5c 28 5d 32 5f 32 60 32 61 33 62 33 63 33 + 64 33 + 65 33 69 39 6b 39 6c 39 6d 40 + 6e 40 + 6f 40 70 45 71 45 72 45 73 45 74 45 75 45 + 76 45 + 77 45 78 8 } method 'test1 (III)V' { 0 52 1 52 + 2 52 + 3 52 + 4 52 + 5 52 + 6 52 + 7 52 + 8 52 + 9 52 + a 52 + b 52 + c 52 + d 52 + e 52 + f 52 + 10 52 + 11 52 + 12 52 + 13 52 + 14 52 + 15 52 + 16 52 + 17 52 + 18 52 + 19 52 + 1a 52 + 1b 52 1c 54 1d 54 + 1e 54 + 1f 54 20 55 22 55 23 55 24 56 25 56 + 26 56 + 27 56 2b 62 2c 62 + 2d 62 + 2e 62 2f 62 30 62 32 62 @@ -172,31 +252,45 @@ class 'pkg/TestBooleanSwitchExpression5' { 3a 62 3b 62 3c 62 + 3d 62 + 3e 62 42 67 43 67 + 44 67 + 45 67 46 68 47 68 49 68 4a 68 4b 69 4c 69 + 4d 69 + 4e 69 4f 69 50 69 51 69 52 69 + 53 69 + 54 69 58 72 59 72 5a 72 + 5b 72 + 5c 72 5d 73 5f 73 60 73 61 74 62 74 63 74 + 64 74 + 65 74 69 80 6b 80 6c 80 6d 81 + 6e 81 + 6f 81 70 90 71 90 72 90 @@ -211,6 +305,8 @@ class 'pkg/TestBooleanSwitchExpression5' { 7e 86 7f 86 80 86 + 81 86 + 82 86 83 93 84 93 85 93 diff --git a/testData/results/pkg/TestCaseClasses.dec b/testData/results/pkg/TestCaseClasses.dec index dd969f55a3..729cde2cd6 100644 --- a/testData/results/pkg/TestCaseClasses.dec +++ b/testData/results/pkg/TestCaseClasses.dec @@ -171,12 +171,16 @@ class 'pkg/Option1' { 0 35 1 35 2 35 + 3 35 + 4 35 5 35 7 35 8 35 9 35 a 35 b 35 + c 35 + d 35 12 35 13 35 14 35 @@ -187,13 +191,19 @@ class 'pkg/Option1' { 19 35 1a 35 1b 35 + 1c 35 + 1d 35 1e 35 1f 35 20 35 21 35 22 35 23 35 + 24 35 + 25 35 32 35 + 33 35 + 34 35 3a 35 } @@ -232,6 +242,8 @@ class 'pkg/Option1' { 2 55 3 55 4 55 + 5 55 + 6 55 7 56 8 56 9 56 @@ -239,24 +251,15 @@ class 'pkg/Option1' { b 56 c 56 d 56 - e 56 - f 56 - 10 56 - 11 56 - 12 56 - 13 56 - 14 56 - 15 56 - 16 56 - 17 56 - 18 56 - 19 56 - 1a 56 - 1b 56 - 1c 56 + 12 58 + 13 58 + 14 58 + 15 58 + 16 58 + 17 58 + 18 58 + 1c 58 1d 56 - 1e 56 - 1f 56 } method 'productElementName (I)Ljava/lang/String;' { @@ -264,6 +267,8 @@ class 'pkg/Option1' { 2 63 3 63 4 63 + 5 63 + 6 63 7 64 8 64 9 64 @@ -635,12 +640,16 @@ class 'pkg/Option2' { 0 41 1 41 2 41 + 3 41 + 4 41 5 41 7 41 8 41 9 41 a 41 b 41 + c 41 + d 41 12 41 13 41 14 41 @@ -652,6 +661,8 @@ class 'pkg/Option2' { 1a 41 1b 41 1c 41 + 1d 41 + 1e 41 1f 41 20 41 21 41 @@ -662,6 +673,8 @@ class 'pkg/Option2' { 26 41 27 41 28 41 + 29 41 + 2a 41 2b 41 2c 41 2d 41 @@ -672,13 +685,19 @@ class 'pkg/Option2' { 32 41 33 41 34 41 + 35 41 + 36 41 37 41 38 41 39 41 3a 41 3b 41 3c 41 + 3d 41 + 3e 41 4b 41 + 4c 41 + 4d 41 53 41 } @@ -716,6 +735,30 @@ class 'pkg/Option2' { 0 61 2 61 3 61 + 4 61 + 5 61 + 6 61 + 7 61 + 8 61 + 9 61 + a 61 + b 61 + c 61 + d 61 + e 61 + f 61 + 10 61 + 11 61 + 12 61 + 13 61 + 14 61 + 15 61 + 16 61 + 17 61 + 18 61 + 19 61 + 1a 61 + 1b 61 1c 62 1d 62 1e 62 @@ -746,6 +789,30 @@ class 'pkg/Option2' { 0 70 2 70 3 70 + 4 70 + 5 70 + 6 70 + 7 70 + 8 70 + 9 70 + a 70 + b 70 + c 70 + d 70 + e 70 + f 70 + 10 70 + 11 70 + 12 70 + 13 70 + 14 70 + 15 70 + 16 70 + 17 70 + 18 70 + 19 70 + 1a 70 + 1b 70 1c 72 1d 72 1e 72 @@ -1114,12 +1181,16 @@ class 'pkg/Option3' { 0 32 1 32 2 32 + 3 32 + 4 32 5 34 7 34 8 34 9 34 a 34 b 34 + c 34 + d 34 12 34 13 37 14 37 @@ -1132,23 +1203,33 @@ class 'pkg/Option3' { 1b 38 1c 38 1e 39 + 1f 39 + 20 39 22 39 23 39 24 39 + 25 39 + 26 39 2a 39 2b 39 2c 39 2d 39 2e 39 2f 39 + 30 39 + 31 39 32 39 33 39 34 39 35 39 36 39 37 39 + 38 39 + 39 39 42 35 46 42 + 47 42 + 48 42 49 47 4d 43 4e 43 @@ -1189,6 +1270,8 @@ class 'pkg/Option3' { 2 67 3 67 4 67 + 5 67 + 6 67 7 68 8 68 9 68 @@ -1209,6 +1292,8 @@ class 'pkg/Option3' { 2 75 3 75 4 75 + 5 75 + 6 75 7 76 8 76 9 76 diff --git a/testData/results/pkg/TestCastObjectToPrimitive.dec b/testData/results/pkg/TestCastObjectToPrimitive.dec index 324064c561..95c3e8e222 100644 --- a/testData/results/pkg/TestCastObjectToPrimitive.dec +++ b/testData/results/pkg/TestCastObjectToPrimitive.dec @@ -63,12 +63,16 @@ class 'pkg/TestCastObjectToPrimitive' { 7 17 8 17 9 17 + a 17 + b 17 c 18 d 18 e 18 f 18 10 18 11 18 + 12 18 + 13 18 14 21 15 21 16 21 @@ -79,6 +83,8 @@ class 'pkg/TestCastObjectToPrimitive' { 1b 21 1c 21 1d 21 + 1e 21 + 1f 21 20 22 21 22 22 22 @@ -113,6 +119,8 @@ class 'pkg/TestCastObjectToPrimitive' { 2 31 3 31 4 31 + 5 31 + 6 31 7 31 8 31 9 31 @@ -124,6 +132,8 @@ class 'pkg/TestCastObjectToPrimitive' { f 31 10 31 11 31 + 12 31 + 13 31 14 34 15 34 } @@ -134,6 +144,8 @@ class 'pkg/TestCastObjectToPrimitive' { 2 37 3 37 4 37 + 5 37 + 6 37 7 37 8 37 9 37 @@ -145,6 +157,8 @@ class 'pkg/TestCastObjectToPrimitive' { f 37 10 37 11 37 + 12 37 + 13 37 14 40 15 40 } @@ -161,6 +175,8 @@ class 'pkg/TestCastObjectToPrimitive' { 8 43 9 43 a 43 + b 43 + c 43 d 46 e 46 } diff --git a/testData/results/pkg/TestChainedCFG.dec b/testData/results/pkg/TestChainedCFG.dec index b62b8be766..4951aba880 100644 --- a/testData/results/pkg/TestChainedCFG.dec +++ b/testData/results/pkg/TestChainedCFG.dec @@ -35,34 +35,52 @@ class 'pkg/TestChainedCFG' { 3 6 4 6 5 6 + 6 6 + 7 6 9 8 a 8 b 8 c 8 + d 8 + e 8 13 9 14 9 15 9 16 9 + 17 9 + 18 9 1d 10 1e 10 1f 10 20 10 + 21 10 + 22 10 27 11 28 11 29 11 2a 11 + 2b 11 + 2c 11 31 12 34 12 35 12 + 36 12 + 37 12 3c 13 3f 13 40 13 + 41 13 + 42 13 47 14 4a 14 4b 14 + 4c 14 + 4d 14 52 15 55 15 56 15 + 57 15 + 58 15 } } diff --git a/testData/results/pkg/TestClassCast.dec b/testData/results/pkg/TestClassCast.dec index 80cb51ff2e..db5bb44f21 100644 --- a/testData/results/pkg/TestClassCast.dec +++ b/testData/results/pkg/TestClassCast.dec @@ -20,6 +20,8 @@ class 'pkg/TestClassCast' { 1 7 2 8 3 8 + 4 8 + 5 8 a 9 f 9 10 9 diff --git a/testData/results/pkg/TestClassLambda.dec b/testData/results/pkg/TestClassLambda.dec index c48799b2f5..e3baa6da85 100644 --- a/testData/results/pkg/TestClassLambda.dec +++ b/testData/results/pkg/TestClassLambda.dec @@ -270,12 +270,16 @@ class 'pkg/TestClassLambda' { 3 49 4 49 5 49 + 6 49 + 7 49 8 49 9 49 a 49 b 49 c 49 d 49 + e 49 + f 49 15 49 } diff --git a/testData/results/pkg/TestClassLoop.dec b/testData/results/pkg/TestClassLoop.dec index 480b4d0146..46e73282e5 100644 --- a/testData/results/pkg/TestClassLoop.dec +++ b/testData/results/pkg/TestClassLoop.dec @@ -120,9 +120,13 @@ class 'pkg/TestClassLoop' { 3 10 4 10 5 10 + 6 10 + 7 10 d 10 e 14 f 14 + 10 14 + 11 14 1a 15 27 18 28 18 @@ -130,6 +134,8 @@ class 'pkg/TestClassLoop' { 2a 18 2b 18 2c 18 + 2d 18 + 2e 18 } method 'testCatch ()V' { @@ -139,9 +145,13 @@ class 'pkg/TestClassLoop' { 3 24 4 24 5 24 + 6 24 + 7 24 d 24 e 28 f 28 + 10 28 + 11 28 12 29 16 31 17 32 @@ -161,6 +171,8 @@ class 'pkg/TestClassLoop' { 3 38 4 38 5 38 + 6 38 + 7 38 d 38 e 43 f 43 @@ -168,8 +180,12 @@ class 'pkg/TestClassLoop' { 11 43 12 43 13 43 + 14 43 + 15 43 26 46 27 46 + 28 46 + 29 46 2a 47 2b 47 2c 47 @@ -185,6 +201,8 @@ class 'pkg/TestClassLoop' { 3a 53 3b 53 3c 53 + 3d 53 + 3e 53 } method 'testWhileCombined (Ljava/lang/String;)I' { @@ -212,6 +230,8 @@ class 'pkg/TestClassLoop' { 15 65 16 65 17 65 + 18 65 + 19 65 1a 66 1b 66 1c 66 @@ -224,6 +244,8 @@ class 'pkg/TestClassLoop' { 23 67 24 67 25 67 + 26 67 + 27 67 28 68 29 68 2a 68 @@ -232,8 +254,12 @@ class 'pkg/TestClassLoop' { 30 70 31 70 32 70 + 33 70 + 34 70 35 74 36 74 + 37 74 + 38 74 3d 75 3e 75 42 75 @@ -243,7 +269,11 @@ class 'pkg/TestClassLoop' { 46 79 47 79 48 79 + 49 79 + 4a 79 4b 80 + 4c 80 + 4d 80 4e 83 4f 83 50 65 @@ -258,6 +288,8 @@ class 'pkg/TestClassLoop' { 0 93 1 93 2 93 + 3 93 + 4 93 6 97 7 97 8 97 diff --git a/testData/results/pkg/TestClassSimpleBytecodeMapping.dec b/testData/results/pkg/TestClassSimpleBytecodeMapping.dec index 67ebc91954..b161bef6c5 100644 --- a/testData/results/pkg/TestClassSimpleBytecodeMapping.dec +++ b/testData/results/pkg/TestClassSimpleBytecodeMapping.dec @@ -72,6 +72,8 @@ class 'pkg/TestClassSimpleBytecodeMapping' { 1d 12 1e 12 1f 12 + 20 12 + 21 12 22 13 23 13 24 13 @@ -105,12 +107,16 @@ class 'pkg/TestClassSimpleBytecodeMapping' { 13 25 14 25 15 25 + 16 25 + 17 25 24 27 25 27 26 27 27 27 28 27 29 27 + 2a 27 + 2b 27 2e 29 } diff --git a/testData/results/pkg/TestClassSwitch.dec b/testData/results/pkg/TestClassSwitch.dec index 67a6be2673..b92b481822 100644 --- a/testData/results/pkg/TestClassSwitch.dec +++ b/testData/results/pkg/TestClassSwitch.dec @@ -53,6 +53,32 @@ class 'pkg/TestClassSwitch' { method 'testCaseOrder (I)V' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 10 1d 10 1e 10 @@ -67,6 +93,8 @@ class 'pkg/TestClassSwitch' { 27 6 28 6 29 6 + 2a 6 + 2b 6 2c 8 } @@ -76,12 +104,93 @@ class 'pkg/TestClassSwitch' { 2 15 3 16 4 16 + 5 16 + 6 16 + 7 16 + 8 16 + 9 16 + a 16 + b 16 + c 16 + d 16 + e 16 + f 16 + 10 16 + 11 16 + 12 16 + 13 16 + 14 16 + 15 16 + 16 16 + 17 16 + 18 16 + 19 16 + 1a 16 + 1b 16 + 1c 16 + 1d 16 + 1e 16 + 1f 16 + 20 16 + 21 16 + 22 16 + 23 16 + 24 16 + 25 16 + 26 16 + 27 16 + 28 16 + 29 16 + 2a 16 + 2b 16 + 2c 16 + 2d 16 + 2e 16 + 2f 16 + 30 16 + 31 16 + 32 16 + 33 16 + 34 16 + 35 16 + 36 16 + 37 16 + 38 16 + 39 16 + 3a 16 + 3b 16 + 3c 16 + 3d 16 + 3e 16 + 3f 16 + 40 16 + 41 16 + 42 16 + 43 16 + 44 16 + 45 16 + 46 16 + 47 16 + 48 16 + 49 16 + 4a 16 + 4b 16 + 4c 16 + 4d 16 + 4e 16 + 4f 16 + 50 16 + 51 16 + 52 16 + 53 16 54 30 55 30 56 30 57 30 58 30 59 30 + 5a 30 + 5b 30 5c 32 5d 32 5e 32 @@ -103,6 +212,8 @@ class 'pkg/TestClassSwitch' { 70 36 71 37 72 37 + 73 37 + 74 37 75 38 76 38 77 38 diff --git a/testData/results/pkg/TestClassTypes.dec b/testData/results/pkg/TestClassTypes.dec index cb55909627..272c03863a 100644 --- a/testData/results/pkg/TestClassTypes.dec +++ b/testData/results/pkg/TestClassTypes.dec @@ -62,6 +62,8 @@ class 'pkg/TestClassTypes' { b 9 c 9 d 9 + e 9 + f 9 10 10 11 10 15 11 @@ -72,15 +74,21 @@ class 'pkg/TestClassTypes' { 1a 11 1b 11 1c 11 + 1d 11 + 1e 11 1f 12 20 12 21 15 22 15 23 15 + 24 15 + 25 15 26 16 27 16 28 16 29 16 + 2a 16 + 2b 16 2c 18 } @@ -90,12 +98,56 @@ class 'pkg/TestClassTypes' { 2 21 3 21 4 21 + 5 21 + 6 21 c 21 } method 'testSwitchConsts (I)V' { 0 25 1 25 + 2 25 + 3 25 + 4 25 + 5 25 + 6 25 + 7 25 + 8 25 + 9 25 + a 25 + b 25 + c 25 + d 25 + e 25 + f 25 + 10 25 + 11 25 + 12 25 + 13 25 + 14 25 + 15 25 + 16 25 + 17 25 + 18 25 + 19 25 + 1a 25 + 1b 25 + 1c 25 + 1d 25 + 1e 25 + 1f 25 + 20 25 + 21 25 + 22 25 + 23 25 + 24 25 + 25 25 + 26 25 + 27 25 + 28 25 + 29 25 + 2a 25 + 2b 25 2c 27 2d 27 2e 27 @@ -120,6 +172,8 @@ class 'pkg/TestClassTypes' { 45 34 46 34 47 34 + 48 34 + 49 34 4a 36 } @@ -128,6 +182,8 @@ class 'pkg/TestClassTypes' { 1 39 2 40 3 40 + 4 40 + 5 40 a 41 f 41 10 41 diff --git a/testData/results/pkg/TestClassVar.dec b/testData/results/pkg/TestClassVar.dec index 475c7228c4..d025e3cf55 100644 --- a/testData/results/pkg/TestClassVar.dec +++ b/testData/results/pkg/TestClassVar.dec @@ -45,20 +45,30 @@ class 'pkg/TestClassVar' { 3 7 4 7 5 7 + 6 7 + 7 7 8 9 9 9 a 9 b 9 + c 9 + d 9 1f 11 20 11 21 11 22 11 23 11 + 24 11 + 25 11 26 12 27 12 28 12 29 12 + 2a 12 + 2b 12 2e 7 + 2f 7 + 30 7 34 16 } @@ -79,24 +89,34 @@ class 'pkg/TestClassVar' { 3 25 4 25 5 25 + 6 25 + 7 25 8 26 9 26 a 28 b 28 c 28 d 28 + e 28 + f 28 10 28 11 28 + 12 28 + 13 28 14 29 15 29 16 29 1a 32 1b 32 1c 32 + 1d 32 + 1e 32 1f 33 20 33 21 33 22 33 + 23 33 + 24 33 28 36 } } diff --git a/testData/results/pkg/TestCollectionItr.dec b/testData/results/pkg/TestCollectionItr.dec index bfb471a240..b6406c7052 100644 --- a/testData/results/pkg/TestCollectionItr.dec +++ b/testData/results/pkg/TestCollectionItr.dec @@ -29,4 +29,4 @@ class 'pkg/TestCollectionItr' { Lines mapping: 8 <-> 8 -12 <-> 12 \ No newline at end of file +12 <-> 12 diff --git a/testData/results/pkg/TestComplexIfElseChain.dec b/testData/results/pkg/TestComplexIfElseChain.dec index e53c1678bd..05b8b0b8d3 100644 --- a/testData/results/pkg/TestComplexIfElseChain.dec +++ b/testData/results/pkg/TestComplexIfElseChain.dec @@ -52,7 +52,7 @@ public class TestComplexIfElseChain { } else if (result != 6 && result != 7) {// 52 if (result == 8 || result == 9) {// 54 System.out.println("e");// 55 - return;// 56 58 + return;// 56 } } else { System.out.println("d");// 53 @@ -302,9 +302,13 @@ class 'pkg/TestComplexIfElseChain' { e 7 f 8 10 8 + 11 8 + 12 8 13 8 14 8 15 8 + 16 8 + 17 8 18 9 19 9 1a 9 @@ -316,9 +320,13 @@ class 'pkg/TestComplexIfElseChain' { 23 10 24 10 25 10 + 26 10 + 27 10 28 10 29 10 2a 10 + 2b 10 + 2c 10 2d 11 2e 11 2f 11 @@ -330,9 +338,13 @@ class 'pkg/TestComplexIfElseChain' { 38 12 39 12 3a 12 + 3b 12 + 3c 12 3d 12 3e 12 3f 12 + 40 12 + 41 12 42 13 43 13 44 13 @@ -345,10 +357,14 @@ class 'pkg/TestComplexIfElseChain' { 4e 14 4f 14 50 14 + 51 14 + 52 14 53 14 54 14 55 14 56 14 + 57 14 + 58 14 59 15 5a 15 5b 15 @@ -361,16 +377,22 @@ class 'pkg/TestComplexIfElseChain' { 65 16 66 16 67 16 + 68 16 + 69 16 6a 16 6b 16 6c 16 6d 16 + 6e 16 + 6f 16 70 17 71 17 72 17 73 17 74 17 75 17 + 76 17 + 77 17 78 19 } @@ -389,11 +411,17 @@ class 'pkg/TestComplexIfElseChain' { 12 25 13 25 14 25 + 15 25 + 16 25 17 26 18 26 + 19 26 + 1a 26 1b 26 1c 26 1d 26 + 1e 26 + 1f 26 20 27 21 27 22 27 @@ -405,9 +433,13 @@ class 'pkg/TestComplexIfElseChain' { 2b 28 2c 28 2d 28 + 2e 28 + 2f 28 30 28 31 28 32 28 + 33 28 + 34 28 35 29 36 29 37 29 @@ -419,9 +451,13 @@ class 'pkg/TestComplexIfElseChain' { 40 30 41 30 42 30 + 43 30 + 44 30 45 30 46 30 47 30 + 48 30 + 49 30 4a 31 4b 31 4c 31 @@ -434,10 +470,14 @@ class 'pkg/TestComplexIfElseChain' { 56 32 57 32 58 32 + 59 32 + 5a 32 5b 32 5c 32 5d 32 5e 32 + 5f 32 + 60 32 61 33 62 33 63 33 @@ -450,16 +490,22 @@ class 'pkg/TestComplexIfElseChain' { 6d 34 6e 34 6f 34 + 70 34 + 71 34 72 34 73 34 74 34 75 34 + 76 34 + 77 34 78 35 79 35 7a 35 7b 35 7c 35 7d 35 + 7e 35 + 7f 35 80 25 81 25 82 25 @@ -477,9 +523,13 @@ class 'pkg/TestComplexIfElseChain' { e 44 f 45 10 45 + 11 45 + 12 45 13 45 14 45 15 45 + 16 45 + 17 45 18 46 19 46 1a 46 @@ -491,9 +541,13 @@ class 'pkg/TestComplexIfElseChain' { 23 47 24 47 25 47 + 26 47 + 27 47 28 47 29 47 2a 47 + 2b 47 + 2c 47 2d 48 2e 48 2f 48 @@ -505,9 +559,13 @@ class 'pkg/TestComplexIfElseChain' { 38 49 39 49 3a 49 + 3b 49 + 3c 49 3d 49 3e 49 3f 49 + 40 49 + 41 49 42 50 43 50 44 50 @@ -520,10 +578,14 @@ class 'pkg/TestComplexIfElseChain' { 4e 51 4f 51 50 51 + 51 51 + 52 51 53 51 54 51 55 51 56 51 + 57 51 + 58 51 59 57 5a 57 5b 57 @@ -536,10 +598,14 @@ class 'pkg/TestComplexIfElseChain' { 65 52 66 52 67 52 + 68 52 + 69 52 6a 52 6b 52 6c 52 6d 52 + 6e 52 + 6f 52 70 53 71 53 72 53 @@ -549,11 +615,6 @@ class 'pkg/TestComplexIfElseChain' { 76 53 77 53 78 54 - 79 54 - 7a 54 - 7b 54 - 7c 54 - 7d 54 } method 'testInLoop2 ()V' { @@ -567,9 +628,13 @@ class 'pkg/TestComplexIfElseChain' { e 66 f 67 10 67 + 11 67 + 12 67 13 67 14 67 15 67 + 16 67 + 17 67 18 89 19 89 1a 89 @@ -581,9 +646,13 @@ class 'pkg/TestComplexIfElseChain' { 23 68 24 68 25 68 + 26 68 + 27 68 28 68 29 68 2a 68 + 2b 68 + 2c 68 2d 86 2e 86 2f 86 @@ -595,9 +664,13 @@ class 'pkg/TestComplexIfElseChain' { 38 69 39 69 3a 69 + 3b 69 + 3c 69 3d 69 3e 69 3f 69 + 40 69 + 41 69 42 83 43 83 44 83 @@ -611,10 +684,14 @@ class 'pkg/TestComplexIfElseChain' { 4e 70 4f 70 50 70 + 51 70 + 52 70 53 70 54 70 55 70 56 70 + 57 70 + 58 70 59 79 5a 79 5b 79 @@ -628,10 +705,14 @@ class 'pkg/TestComplexIfElseChain' { 65 71 66 71 67 71 + 68 71 + 69 71 6a 71 6b 71 6c 71 6d 71 + 6e 71 + 6f 71 70 75 71 75 72 75 @@ -655,9 +736,13 @@ class 'pkg/TestComplexIfElseChain' { e 98 f 99 10 99 + 11 99 + 12 99 13 99 14 99 15 99 + 16 99 + 17 99 18 100 19 100 1a 100 @@ -669,9 +754,13 @@ class 'pkg/TestComplexIfElseChain' { 23 101 24 101 25 101 + 26 101 + 27 101 28 101 29 101 2a 101 + 2b 101 + 2c 101 2d 106 2e 106 2f 106 @@ -683,25 +772,37 @@ class 'pkg/TestComplexIfElseChain' { 38 102 39 102 3a 102 + 3b 102 + 3c 102 3d 102 3e 102 3f 102 + 40 102 + 41 102 45 102 46 102 47 102 48 102 + 49 102 + 4a 102 4b 102 4c 102 4d 102 4e 102 + 4f 102 + 50 102 54 102 55 102 56 102 57 102 + 58 102 + 59 102 5a 102 5b 102 5c 102 5d 102 + 5e 102 + 5f 102 66 103 } @@ -719,9 +820,13 @@ class 'pkg/TestComplexIfElseChain' { 11 116 12 117 13 117 + 14 117 + 15 117 16 117 17 117 18 117 + 19 117 + 1a 117 1b 118 1c 118 1d 118 @@ -733,9 +838,13 @@ class 'pkg/TestComplexIfElseChain' { 26 119 27 119 28 119 + 29 119 + 2a 119 2b 119 2c 119 2d 119 + 2e 119 + 2f 119 30 120 31 120 32 120 @@ -747,9 +856,13 @@ class 'pkg/TestComplexIfElseChain' { 3b 121 3c 121 3d 121 + 3e 121 + 3f 121 40 121 41 121 42 121 + 43 121 + 44 121 45 122 46 122 47 122 @@ -762,10 +875,14 @@ class 'pkg/TestComplexIfElseChain' { 51 123 52 123 53 123 + 54 123 + 55 123 56 123 57 123 58 123 59 123 + 5a 123 + 5b 123 5c 124 5d 124 5e 124 @@ -778,19 +895,27 @@ class 'pkg/TestComplexIfElseChain' { 68 125 69 125 6a 125 + 6b 125 + 6c 125 6d 125 6e 125 6f 125 70 125 + 71 125 + 72 125 73 126 74 126 75 126 76 126 77 126 78 126 + 79 126 + 7a 126 7b 128 7c 128 7d 128 + 7e 128 + 7f 128 80 129 } @@ -805,6 +930,33 @@ class 'pkg/TestComplexIfElseChain' { e 133 f 134 10 134 + 11 134 + 12 134 + 13 134 + 14 134 + 15 134 + 16 134 + 17 134 + 18 134 + 19 134 + 1a 134 + 1b 134 + 1c 134 + 1d 134 + 1e 134 + 1f 134 + 20 134 + 21 134 + 22 134 + 23 134 + 24 134 + 25 134 + 26 134 + 27 134 + 28 134 + 29 134 + 2a 134 + 2b 134 2c 136 2d 136 2e 136 @@ -815,9 +967,13 @@ class 'pkg/TestComplexIfElseChain' { 33 137 36 139 37 139 + 38 139 + 39 139 3a 139 3b 139 3c 139 + 3d 139 + 3e 139 3f 140 40 140 41 140 @@ -829,9 +985,13 @@ class 'pkg/TestComplexIfElseChain' { 4a 141 4b 141 4c 141 + 4d 141 + 4e 141 4f 141 50 141 51 141 + 52 141 + 53 141 54 142 55 142 56 142 @@ -843,9 +1003,13 @@ class 'pkg/TestComplexIfElseChain' { 5f 143 60 143 61 143 + 62 143 + 63 143 64 143 65 143 66 143 + 67 143 + 68 143 69 144 6a 144 6b 144 @@ -858,10 +1022,14 @@ class 'pkg/TestComplexIfElseChain' { 75 145 76 145 77 145 + 78 145 + 79 145 7a 145 7b 145 7c 145 7d 145 + 7e 145 + 7f 145 80 146 81 146 82 146 @@ -874,10 +1042,14 @@ class 'pkg/TestComplexIfElseChain' { 8c 147 8d 147 8e 147 + 8f 147 + 90 147 91 147 92 147 93 147 94 147 + 95 147 + 96 147 97 148 98 148 99 148 @@ -891,6 +1063,8 @@ class 'pkg/TestComplexIfElseChain' { a4 152 a5 152 a6 152 + a7 152 + a8 152 a9 155 aa 155 ab 155 @@ -913,6 +1087,33 @@ class 'pkg/TestComplexIfElseChain' { e 160 f 161 10 161 + 11 161 + 12 161 + 13 161 + 14 161 + 15 161 + 16 161 + 17 161 + 18 161 + 19 161 + 1a 161 + 1b 161 + 1c 161 + 1d 161 + 1e 161 + 1f 161 + 20 161 + 21 161 + 22 161 + 23 161 + 24 161 + 25 161 + 26 161 + 27 161 + 28 161 + 29 161 + 2a 161 + 2b 161 2c 163 2d 163 2e 163 @@ -923,9 +1124,13 @@ class 'pkg/TestComplexIfElseChain' { 33 164 36 166 37 166 + 38 166 + 39 166 3a 166 3b 166 3c 166 + 3d 166 + 3e 166 3f 167 40 167 41 167 @@ -937,9 +1142,13 @@ class 'pkg/TestComplexIfElseChain' { 4a 168 4b 168 4c 168 + 4d 168 + 4e 168 4f 168 50 168 51 168 + 52 168 + 53 168 54 184 55 184 56 184 @@ -951,9 +1160,13 @@ class 'pkg/TestComplexIfElseChain' { 5f 169 60 169 61 169 + 62 169 + 63 169 64 169 65 169 66 169 + 67 169 + 68 169 69 170 6a 170 6b 170 @@ -967,10 +1180,14 @@ class 'pkg/TestComplexIfElseChain' { 75 174 76 174 77 174 + 78 174 + 79 174 7a 174 7b 174 7c 174 7d 174 + 7e 174 + 7f 174 80 175 81 175 82 175 @@ -984,10 +1201,14 @@ class 'pkg/TestComplexIfElseChain' { 8c 179 8d 179 8e 179 + 8f 179 + 90 179 91 179 92 179 93 179 94 179 + 95 179 + 96 179 97 180 98 180 99 180 @@ -1010,6 +1231,8 @@ class 'pkg/TestComplexIfElseChain' { ae 190 af 190 b0 190 + b1 190 + b2 190 b3 193 b4 193 b5 193 @@ -1036,11 +1259,17 @@ class 'pkg/TestComplexIfElseChain' { 12 201 13 201 14 201 + 15 201 + 16 201 84 203 85 203 + 86 203 + 87 203 88 203 89 203 8a 203 + 8b 203 + 8c 203 8d 204 8e 204 8f 204 @@ -1052,9 +1281,13 @@ class 'pkg/TestComplexIfElseChain' { 98 205 99 205 9a 205 + 9b 205 + 9c 205 9d 205 9e 205 9f 205 + a0 205 + a1 205 a2 206 a3 206 a4 206 @@ -1066,9 +1299,13 @@ class 'pkg/TestComplexIfElseChain' { ad 207 ae 207 af 207 + b0 207 + b1 207 b2 207 b3 207 b4 207 + b5 207 + b6 207 b7 208 b8 208 b9 208 @@ -1081,10 +1318,14 @@ class 'pkg/TestComplexIfElseChain' { c3 209 c4 209 c5 209 + c6 209 + c7 209 c8 209 c9 209 ca 209 cb 209 + cc 209 + cd 209 ce 210 cf 210 d0 210 @@ -1097,16 +1338,22 @@ class 'pkg/TestComplexIfElseChain' { da 211 db 211 dc 211 + dd 211 + de 211 df 211 e0 211 e1 211 e2 211 + e3 211 + e4 211 e5 212 e6 212 e7 212 e8 212 e9 212 ea 212 + eb 212 + ec 212 ef 215 } @@ -1125,11 +1372,17 @@ class 'pkg/TestComplexIfElseChain' { 12 222 13 222 14 222 + 15 222 + 16 222 84 224 85 224 + 86 224 + 87 224 88 224 89 224 8a 224 + 8b 224 + 8c 224 8d 225 8e 225 8f 225 @@ -1141,9 +1394,13 @@ class 'pkg/TestComplexIfElseChain' { 98 226 99 226 9a 226 + 9b 226 + 9c 226 9d 226 9e 226 9f 226 + a0 226 + a1 226 a2 227 a3 227 a4 227 @@ -1155,9 +1412,13 @@ class 'pkg/TestComplexIfElseChain' { ad 228 ae 228 af 228 + b0 228 + b1 228 b2 228 b3 228 b4 228 + b5 228 + b6 228 b7 229 b8 229 b9 229 @@ -1170,10 +1431,14 @@ class 'pkg/TestComplexIfElseChain' { c3 230 c4 230 c5 230 + c6 230 + c7 230 c8 230 c9 230 ca 230 cb 230 + cc 230 + cd 230 ce 231 cf 231 d0 231 @@ -1186,21 +1451,31 @@ class 'pkg/TestComplexIfElseChain' { da 232 db 232 dc 232 + dd 232 + de 232 df 232 e0 232 e1 232 e2 232 + e3 232 + e4 232 e5 233 e6 233 e7 233 e8 233 e9 233 ea 233 + eb 233 + ec 233 ef 237 f0 237 + f1 237 + f2 237 f3 237 f4 237 f5 237 + f6 237 + f7 237 f8 238 f9 238 fa 238 @@ -1212,9 +1487,13 @@ class 'pkg/TestComplexIfElseChain' { 103 239 104 239 105 239 + 106 239 + 107 239 108 239 109 239 10a 239 + 10b 239 + 10c 239 10d 240 10e 240 10f 240 @@ -1226,9 +1505,13 @@ class 'pkg/TestComplexIfElseChain' { 118 241 119 241 11a 241 + 11b 241 + 11c 241 11d 241 11e 241 11f 241 + 120 241 + 121 241 122 242 123 242 124 242 @@ -1241,10 +1524,14 @@ class 'pkg/TestComplexIfElseChain' { 12e 243 12f 243 130 243 + 131 243 + 132 243 133 243 134 243 135 243 136 243 + 137 243 + 138 243 139 244 13a 244 13b 244 @@ -1257,16 +1544,22 @@ class 'pkg/TestComplexIfElseChain' { 145 245 146 245 147 245 + 148 245 + 149 245 14a 245 14b 245 14c 245 14d 245 + 14e 245 + 14f 245 150 246 151 246 152 246 153 246 154 246 155 246 + 156 246 + 157 246 158 248 } @@ -1285,99 +1578,141 @@ class 'pkg/TestComplexIfElseChain' { 12 255 13 255 14 255 + 15 255 + 16 255 fb 257 fc 257 + fd 257 + fe 257 ff 257 100 257 101 257 + 102 257 + 103 257 104 259 105 259 106 259 107 259 108 259 109 259 + 10a 259 + 10b 259 119 261 11a 261 11b 261 11c 261 11d 261 11e 261 + 11f 261 + 120 261 127 263 128 263 129 263 + 12a 263 + 12b 263 12c 263 12d 263 12e 263 + 12f 263 + 130 263 131 265 132 265 133 265 134 265 135 265 136 265 + 137 265 + 138 265 146 267 147 267 148 267 149 267 14a 267 14b 267 + 14c 267 + 14d 267 154 269 155 269 156 269 + 157 269 + 158 269 159 269 15a 269 15b 269 + 15c 269 + 15d 269 15e 271 15f 271 160 271 161 271 162 271 163 271 + 164 271 + 165 271 173 273 174 273 175 273 176 273 177 273 178 273 + 179 273 + 17a 273 181 275 182 275 183 275 184 275 + 185 275 + 186 275 187 275 188 275 189 275 18a 275 + 18b 275 + 18c 275 18d 277 18e 277 18f 277 190 277 191 277 192 277 + 193 277 + 194 277 1a2 279 1a3 279 1a4 279 1a5 279 1a6 279 1a7 279 + 1a8 279 + 1a9 279 1b0 281 1b1 281 1b2 281 1b3 281 + 1b4 281 + 1b5 281 1b6 281 1b7 281 1b8 281 1b9 281 + 1ba 281 + 1bb 281 1bc 283 1bd 283 1be 283 1bf 283 1c0 283 1c1 283 + 1c2 283 + 1c3 283 1d1 285 1d2 285 1d3 285 1d4 285 1d5 285 1d6 285 + 1d7 285 + 1d8 285 1df 289 } } @@ -1423,7 +1758,6 @@ Lines mapping: 54 <-> 53 55 <-> 54 56 <-> 55 -58 <-> 55 62 <-> 64 65 <-> 67 67 <-> 68 @@ -1564,6 +1898,7 @@ Lines mapping: 277 <-> 286 281 <-> 290 Not mapped: +58 59 81 95 diff --git a/testData/results/pkg/TestCompoundAssignment.dec b/testData/results/pkg/TestCompoundAssignment.dec index c2241787b2..9e5646b778 100644 --- a/testData/results/pkg/TestCompoundAssignment.dec +++ b/testData/results/pkg/TestCompoundAssignment.dec @@ -217,6 +217,8 @@ class 'pkg/TestCompoundAssignment' { 1 43 2 43 3 43 + 4 43 + 5 43 6 43 a 43 b 43 @@ -226,6 +228,8 @@ class 'pkg/TestCompoundAssignment' { 11 44 12 44 13 44 + 14 44 + 15 44 16 44 1a 44 1b 44 @@ -235,6 +239,8 @@ class 'pkg/TestCompoundAssignment' { 21 45 22 45 23 45 + 24 45 + 25 45 26 45 2a 45 2b 45 @@ -244,6 +250,8 @@ class 'pkg/TestCompoundAssignment' { 31 46 32 46 33 46 + 34 46 + 35 46 36 46 3a 46 3b 46 @@ -253,6 +261,8 @@ class 'pkg/TestCompoundAssignment' { 41 47 42 47 43 47 + 44 47 + 45 47 46 47 4a 47 4b 47 @@ -262,6 +272,8 @@ class 'pkg/TestCompoundAssignment' { 51 48 52 48 53 48 + 54 48 + 55 48 56 48 5a 48 5b 48 @@ -271,6 +283,8 @@ class 'pkg/TestCompoundAssignment' { 61 49 62 49 63 49 + 64 49 + 65 49 66 49 6a 49 6b 49 @@ -280,6 +294,8 @@ class 'pkg/TestCompoundAssignment' { 71 50 72 50 73 50 + 74 50 + 75 50 76 50 7a 50 7b 50 @@ -289,6 +305,8 @@ class 'pkg/TestCompoundAssignment' { 81 51 82 51 83 51 + 84 51 + 85 51 86 51 8a 51 8b 51 @@ -299,6 +317,8 @@ class 'pkg/TestCompoundAssignment' { 91 52 92 52 93 52 + 94 52 + 95 52 96 52 9a 52 9b 52 diff --git a/testData/results/pkg/TestCompoundAssignmentReplace.dec b/testData/results/pkg/TestCompoundAssignmentReplace.dec index a13f5b9fc3..17e2d6d1ba 100644 --- a/testData/results/pkg/TestCompoundAssignmentReplace.dec +++ b/testData/results/pkg/TestCompoundAssignmentReplace.dec @@ -35,6 +35,8 @@ class 'pkg/TestCompoundAssignmentReplace' { f 12 10 13 11 13 + 12 13 + 13 13 15 14 17 14 18 17 diff --git a/testData/results/pkg/TestConstType.dec b/testData/results/pkg/TestConstType.dec index 0517a96cb6..4c6c1d0448 100644 --- a/testData/results/pkg/TestConstType.dec +++ b/testData/results/pkg/TestConstType.dec @@ -101,6 +101,32 @@ class 'pkg/TestConstType' { method 'setLineBreak (C)V' { 0 7 1 7 + 2 7 + 3 7 + 4 7 + 5 7 + 6 7 + 7 7 + 8 7 + 9 7 + a 7 + b 7 + c 7 + d 7 + e 7 + f 7 + 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 1c 9 1d 9 1e 9 @@ -112,6 +138,8 @@ class 'pkg/TestConstType' { 26 12 27 12 28 12 + 29 12 + 2a 12 2b 14 } @@ -134,6 +162,8 @@ class 'pkg/TestConstType' { 5 21 6 21 7 21 + 8 21 + 9 21 a 22 b 22 c 22 @@ -380,10 +410,14 @@ class 'pkg/TestConstType' { 0 60 1 60 2 60 + 3 60 + 4 60 5 60 6 60 7 60 8 60 + 9 60 + a 60 b 61 c 61 d 61 @@ -391,10 +425,14 @@ class 'pkg/TestConstType' { f 62 10 62 11 62 + 12 62 + 13 62 14 62 15 62 16 62 17 62 + 18 62 + 19 62 1a 63 1b 63 1c 63 @@ -403,11 +441,15 @@ class 'pkg/TestConstType' { 1f 64 20 64 21 64 + 22 64 + 23 64 24 64 25 64 26 64 27 64 28 64 + 29 64 + 2a 64 2b 65 2c 65 2d 65 @@ -416,11 +458,15 @@ class 'pkg/TestConstType' { 30 66 31 66 32 66 + 33 66 + 34 66 35 66 36 66 37 66 38 66 39 66 + 3a 66 + 3b 66 3c 67 3d 67 3e 67 @@ -428,10 +474,14 @@ class 'pkg/TestConstType' { 40 69 41 69 42 69 + 43 69 + 44 69 45 69 46 69 47 69 48 69 + 49 69 + 4a 69 4b 69 4c 69 4e 69 @@ -441,6 +491,56 @@ class 'pkg/TestConstType' { method 'getTypeMaxValue (C)I' { 0 75 1 75 + 2 75 + 3 75 + 4 75 + 5 75 + 6 75 + 7 75 + 8 75 + 9 75 + a 75 + b 75 + c 75 + d 75 + e 75 + f 75 + 10 75 + 11 75 + 12 75 + 13 75 + 14 75 + 15 75 + 16 75 + 17 75 + 18 75 + 19 75 + 1a 75 + 1b 75 + 1c 75 + 1d 75 + 1e 75 + 1f 75 + 20 75 + 21 75 + 22 75 + 23 75 + 24 75 + 25 75 + 26 75 + 27 75 + 28 75 + 29 75 + 2a 75 + 2b 75 + 2c 75 + 2d 75 + 2e 75 + 2f 75 + 30 75 + 31 75 + 32 75 + 33 75 34 86 35 86 36 86 diff --git a/testData/results/pkg/TestConstructorSwitchExpression1.dec b/testData/results/pkg/TestConstructorSwitchExpression1.dec index f15f804f19..112d0d4fc3 100644 --- a/testData/results/pkg/TestConstructorSwitchExpression1.dec +++ b/testData/results/pkg/TestConstructorSwitchExpression1.dec @@ -19,6 +19,35 @@ class 'pkg/TestConstructorSwitchExpression1' { method ' (I)V' { 1 4 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 20 5 21 5 25 6 @@ -26,6 +55,7 @@ class 'pkg/TestConstructorSwitchExpression1' { 2a 8 2b 8 2f 7 + 30 7 31 4 32 4 33 4 diff --git a/testData/results/pkg/TestConstructorSwitchExpression2.dec b/testData/results/pkg/TestConstructorSwitchExpression2.dec index 8dd1105671..10afb25d34 100644 --- a/testData/results/pkg/TestConstructorSwitchExpression2.dec +++ b/testData/results/pkg/TestConstructorSwitchExpression2.dec @@ -17,6 +17,15 @@ class 'pkg/TestConstructorSwitchExpression2' { method ' (I)V' { 1 4 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 c 6 d 6 e 6 diff --git a/testData/results/pkg/TestConstructorSwitchExpression3.dec b/testData/results/pkg/TestConstructorSwitchExpression3.dec index e3d9933d45..a78d292890 100644 --- a/testData/results/pkg/TestConstructorSwitchExpression3.dec +++ b/testData/results/pkg/TestConstructorSwitchExpression3.dec @@ -55,6 +55,31 @@ class 'pkg/TestConstructorSwitchExpression3' { 8 18 9 18 a 18 + b 18 + c 18 + d 18 + e 18 + f 18 + 10 18 + 11 18 + 12 18 + 13 18 + 14 18 + 15 18 + 16 18 + 17 18 + 18 18 + 19 18 + 1a 18 + 1b 18 + 1c 18 + 1d 18 + 1e 18 + 1f 18 + 20 18 + 21 18 + 22 18 + 23 18 24 19 28 20 2c 21 @@ -65,6 +90,32 @@ class 'pkg/TestConstructorSwitchExpression3' { 3b 24 3c 24 3d 24 + 3e 24 + 3f 24 + 40 24 + 41 24 + 42 24 + 43 24 + 44 24 + 45 24 + 46 24 + 47 24 + 48 24 + 49 24 + 4a 24 + 4b 24 + 4c 24 + 4d 24 + 4e 24 + 4f 24 + 50 24 + 51 24 + 52 24 + 53 24 + 54 24 + 55 24 + 56 24 + 57 24 58 25 5c 26 60 27 diff --git a/testData/results/pkg/TestDanglingBoxingCall.dec b/testData/results/pkg/TestDanglingBoxingCall.dec index ea6feb86ef..4be49c9c9e 100644 --- a/testData/results/pkg/TestDanglingBoxingCall.dec +++ b/testData/results/pkg/TestDanglingBoxingCall.dec @@ -21,6 +21,8 @@ class 'pkg/TestDanglingBoxingCall' { 4 4 5 4 6 4 + 7 4 + 8 4 9 5 a 5 b 5 diff --git a/testData/results/pkg/TestDefiniteAssignment.dec b/testData/results/pkg/TestDefiniteAssignment.dec index 02fc48d261..b70363ce68 100644 --- a/testData/results/pkg/TestDefiniteAssignment.dec +++ b/testData/results/pkg/TestDefiniteAssignment.dec @@ -156,6 +156,8 @@ class 'pkg/TestDefiniteAssignment' { method 'testExample16$1$$1 (I)V' { 0 7 1 7 + 2 7 + 3 7 4 7 5 7 6 7 @@ -164,11 +166,15 @@ class 'pkg/TestDefiniteAssignment' { 9 7 b 7 c 7 + d 7 + e 7 f 8 10 8 11 8 12 8 13 8 + 14 8 + 15 8 16 10 } @@ -177,6 +183,8 @@ class 'pkg/TestDefiniteAssignment' { 2 13 3 13 4 13 + 5 13 + 6 13 a 14 b 14 c 14 @@ -194,15 +202,21 @@ class 'pkg/TestDefiniteAssignment' { 0 23 1 23 2 23 + 3 23 + 4 23 5 24 7 24 8 25 9 25 + a 25 + b 25 c 30 d 30 e 31 f 31 10 31 + 11 31 + 12 31 16 35 17 35 18 35 @@ -219,22 +233,32 @@ class 'pkg/TestDefiniteAssignment' { method 'testAssignments (IZ)V' { 0 42 1 42 + 2 42 + 3 42 4 43 6 43 7 44 + 8 44 + 9 44 a 44 b 44 d 44 e 44 f 44 10 44 + 11 44 + 12 44 13 45 14 45 15 45 16 45 17 45 + 18 45 + 19 45 1a 50 1b 50 + 1c 50 + 1d 50 1e 50 22 50 23 50 @@ -242,6 +266,8 @@ class 'pkg/TestDefiniteAssignment' { 26 50 27 50 28 50 + 29 50 + 2a 50 2b 53 2c 53 2d 53 @@ -256,6 +282,8 @@ class 'pkg/TestDefiniteAssignment' { 39 51 3a 51 3b 51 + 3c 51 + 3d 51 3e 56 3f 56 40 56 @@ -277,6 +305,8 @@ class 'pkg/TestDefiniteAssignment' { 50 58 51 58 52 58 + 53 58 + 54 58 55 58 56 58 57 58 @@ -297,6 +327,8 @@ class 'pkg/TestDefiniteAssignment' { 67 58 68 58 69 58 + 6a 58 + 6b 58 6c 58 6d 58 6e 58 @@ -309,12 +341,16 @@ class 'pkg/TestDefiniteAssignment' { 76 58 77 58 78 58 + 79 58 + 7a 58 7e 58 7f 58 80 58 81 58 82 58 83 58 + 84 58 + 85 58 86 61 87 61 88 61 @@ -348,13 +384,19 @@ class 'pkg/TestDefiniteAssignment' { ae 67 af 67 b0 67 + b1 67 + b2 67 bb 67 + bc 67 + bd 67 be 68 bf 68 c0 68 c1 68 c2 68 c3 68 + c4 68 + c5 68 c6 70 } @@ -366,20 +408,28 @@ class 'pkg/TestDefiniteAssignment' { 4 75 5 75 6 75 + 7 75 + 8 75 9 75 a 75 b 75 d 75 e 75 + f 75 + 10 75 12 75 15 75 16 75 + 17 75 + 18 75 19 76 1a 76 1b 76 1c 76 1d 76 1e 76 + 1f 76 + 20 76 21 79 22 79 23 79 @@ -401,14 +451,20 @@ class 'pkg/TestDefiniteAssignment' { 4 86 5 86 6 86 + 7 86 + 8 86 9 86 a 86 b 86 d 86 e 86 + f 86 + 10 86 12 86 15 86 16 86 + 17 86 + 18 86 1e 86 1f 86 20 86 @@ -428,47 +484,71 @@ class 'pkg/TestDefiniteAssignment' { method 'nestedTernaries (III)V' { 0 94 1 94 + 2 94 + 3 94 4 95 5 95 6 95 + 7 95 + 8 95 9 99 b 99 c 99 d 100 + e 100 + f 100 13 104 15 104 16 104 17 105 + 18 105 + 19 105 1a 105 1b 105 1c 105 + 1d 105 + 1e 105 1f 110 20 110 21 110 22 110 23 110 24 110 + 25 110 + 26 110 27 118 28 118 + 29 118 + 2a 118 2b 119 2c 119 2d 119 + 2e 119 + 2f 119 30 123 32 123 33 123 34 124 + 35 124 + 36 124 3a 128 3c 128 3d 128 3e 129 + 3f 129 + 40 129 41 129 42 129 43 129 + 44 129 + 45 129 46 134 47 134 48 134 49 134 4a 134 + 4b 134 + 4c 134 4d 134 4e 134 4f 134 @@ -476,6 +556,8 @@ class 'pkg/TestDefiniteAssignment' { 52 134 53 134 54 134 + 55 134 + 56 134 5a 140 5c 140 5d 140 @@ -483,12 +565,16 @@ class 'pkg/TestDefiniteAssignment' { 60 141 61 141 62 142 + 63 142 + 64 142 65 147 66 147 67 147 68 147 69 147 6a 147 + 6b 147 + 6c 147 6d 150 6e 150 6f 150 diff --git a/testData/results/pkg/TestDoWhileMerge.dec b/testData/results/pkg/TestDoWhileMerge.dec index 219c079ddc..7a832054db 100644 --- a/testData/results/pkg/TestDoWhileMerge.dec +++ b/testData/results/pkg/TestDoWhileMerge.dec @@ -58,6 +58,8 @@ class 'pkg/TestDoWhileMerge' { 2 4 3 4 4 4 + 5 4 + 6 4 7 6 8 6 9 6 @@ -72,12 +74,16 @@ class 'pkg/TestDoWhileMerge' { 12 7 13 7 14 7 + 15 7 + 16 7 17 8 18 10 1c 10 1d 10 1e 10 1f 10 + 20 10 + 21 10 22 12 23 12 24 12 @@ -106,11 +112,15 @@ class 'pkg/TestDoWhileMerge' { 2 19 3 19 4 19 + 5 19 + 6 19 7 20 8 20 9 20 a 20 b 20 + c 20 + d 20 e 23 f 23 10 23 @@ -125,13 +135,19 @@ class 'pkg/TestDoWhileMerge' { 19 24 1a 24 1b 24 + 1c 24 + 1d 24 1e 25 1f 27 20 27 + 21 27 + 22 27 23 27 24 27 25 27 26 27 + 27 27 + 28 27 29 19 2a 19 2b 19 @@ -152,11 +168,15 @@ class 'pkg/TestDoWhileMerge' { 2 34 3 34 4 34 + 5 34 + 6 34 7 35 8 35 9 35 a 35 b 35 + c 35 + d 35 e 38 f 38 10 38 @@ -171,13 +191,19 @@ class 'pkg/TestDoWhileMerge' { 19 39 1a 39 1b 39 + 1c 39 + 1d 39 1e 40 1f 43 20 43 + 21 43 + 22 43 23 43 24 43 25 43 26 43 + 27 43 + 28 43 2c 47 2d 47 2e 47 diff --git a/testData/results/pkg/TestDoWhileTrue.dec b/testData/results/pkg/TestDoWhileTrue.dec index 417c49afa3..9c6dafb891 100644 --- a/testData/results/pkg/TestDoWhileTrue.dec +++ b/testData/results/pkg/TestDoWhileTrue.dec @@ -20,6 +20,8 @@ class 'pkg/TestDoWhileTrue' { 6 6 7 6 8 6 + 9 6 + a 6 e 8 } } diff --git a/testData/results/pkg/TestDoubleForeach.dec b/testData/results/pkg/TestDoubleForeach.dec index eea7c6a62b..757cec1a68 100644 --- a/testData/results/pkg/TestDoubleForeach.dec +++ b/testData/results/pkg/TestDoubleForeach.dec @@ -147,6 +147,8 @@ class 'pkg/TestDoubleForeach' { 39 31 3a 31 3b 31 + 3c 31 + 3d 31 3e 32 3f 32 40 32 @@ -164,6 +166,8 @@ class 'pkg/TestDoubleForeach' { 4f 35 50 35 51 35 + 52 35 + 53 35 54 36 55 36 56 36 diff --git a/testData/results/pkg/TestDoublePopAfterJump.dec b/testData/results/pkg/TestDoublePopAfterJump.dec index f08d915cdc..884c1af9fb 100644 --- a/testData/results/pkg/TestDoublePopAfterJump.dec +++ b/testData/results/pkg/TestDoublePopAfterJump.dec @@ -64,6 +64,8 @@ class 'pkg/TestDoublePopAfterJump' { 2 8 3 10 5 10 + 6 10 + 7 10 b 11 e 10 15 16 @@ -81,10 +83,14 @@ class 'pkg/TestDoublePopAfterJump' { 6 23 7 23 8 23 + 9 23 + a 23 b 24 e 25 f 25 10 25 + 11 25 + 12 25 15 26 16 26 17 26 @@ -92,10 +98,14 @@ class 'pkg/TestDoublePopAfterJump' { 19 26 1b 27 1d 30 + 1e 30 + 1f 30 20 31 22 34 23 34 24 34 + 25 34 + 26 34 29 35 2a 35 2b 35 @@ -103,6 +113,8 @@ class 'pkg/TestDoublePopAfterJump' { 2d 35 2f 36 31 39 + 32 39 + 33 39 34 40 37 41 38 41 @@ -123,6 +135,8 @@ class 'pkg/TestDoublePopAfterJump' { 0 51 1 52 3 54 + 4 54 + 5 54 b 56 } } diff --git a/testData/results/pkg/TestDuplicateAssignmentInSwitchExpr.dec b/testData/results/pkg/TestDuplicateAssignmentInSwitchExpr.dec index 2a8726f52b..e47c3bf709 100644 --- a/testData/results/pkg/TestDuplicateAssignmentInSwitchExpr.dec +++ b/testData/results/pkg/TestDuplicateAssignmentInSwitchExpr.dec @@ -17,6 +17,24 @@ class 'pkg/TestDuplicateAssignmentInSwitchExpr' { method 'foo (I)V' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 14 7 16 7 1a 9 diff --git a/testData/results/pkg/TestDuplicateSwitchLocals.dec b/testData/results/pkg/TestDuplicateSwitchLocals.dec index 419ce7084c..a93015f1dd 100644 --- a/testData/results/pkg/TestDuplicateSwitchLocals.dec +++ b/testData/results/pkg/TestDuplicateSwitchLocals.dec @@ -33,6 +33,36 @@ class 'pkg/TestDuplicateSwitchLocals' { method 'test (I)V' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 20 6 21 6 22 6 @@ -41,6 +71,8 @@ class 'pkg/TestDuplicateSwitchLocals' { 25 8 26 8 27 8 + 28 8 + 29 8 2a 9 2b 9 2c 9 @@ -61,6 +93,8 @@ class 'pkg/TestDuplicateSwitchLocals' { 41 15 42 15 43 15 + 44 15 + 45 15 46 16 47 16 48 16 @@ -81,6 +115,8 @@ class 'pkg/TestDuplicateSwitchLocals' { 5d 21 5e 21 5f 21 + 60 21 + 61 21 62 24 63 24 64 24 @@ -90,6 +126,8 @@ class 'pkg/TestDuplicateSwitchLocals' { 68 25 69 25 6a 25 + 6b 25 + 6c 25 6d 28 } } diff --git a/testData/results/pkg/TestEmptyBlocks.dec b/testData/results/pkg/TestEmptyBlocks.dec index 7a3a45ff44..1117f8db04 100644 --- a/testData/results/pkg/TestEmptyBlocks.dec +++ b/testData/results/pkg/TestEmptyBlocks.dec @@ -33,6 +33,8 @@ class 'pkg/TestEmptyBlocks' { 8 13 9 13 a 13 + b 13 + c 13 d 14 e 14 f 14 @@ -43,6 +45,8 @@ class 'pkg/TestEmptyBlocks' { 2b 20 2c 20 2d 20 + 2e 20 + 2f 20 30 22 } } diff --git a/testData/results/pkg/TestEnum.dec b/testData/results/pkg/TestEnum.dec index 04665013f7..adc0629f70 100644 --- a/testData/results/pkg/TestEnum.dec +++ b/testData/results/pkg/TestEnum.dec @@ -94,6 +94,37 @@ class 'pkg/TestEnum' { 3 30 7 30 8 30 + 9 30 + a 30 + b 30 + c 30 + d 30 + e 30 + f 30 + 10 30 + 11 30 + 12 30 + 13 30 + 14 30 + 15 30 + 16 30 + 17 30 + 18 30 + 19 30 + 1a 30 + 1b 30 + 1c 30 + 1d 30 + 1e 30 + 1f 30 + 20 30 + 21 30 + 22 30 + 23 30 + 24 30 + 25 30 + 26 30 + 27 30 28 32 29 32 2a 32 @@ -127,17 +158,37 @@ class 'pkg/TestEnum' { 4c 41 4d 41 4e 41 + 4f 41 + 50 41 54 44 55 44 56 44 5a 44 5b 44 + 5c 44 + 5d 44 + 5e 44 + 5f 44 + 60 44 + 61 44 + 62 44 + 63 44 + 64 44 + 65 44 + 66 44 + 67 44 + 68 44 + 69 44 + 6a 44 + 6b 44 6c 46 6d 46 6e 46 6f 46 70 46 71 46 + 72 46 + 73 46 74 48 } } diff --git a/testData/results/pkg/TestExceptionElse.dec b/testData/results/pkg/TestExceptionElse.dec index 85d7b652a6..aeaa118536 100644 --- a/testData/results/pkg/TestExceptionElse.dec +++ b/testData/results/pkg/TestExceptionElse.dec @@ -33,6 +33,8 @@ class 'pkg/TestExceptionElse' { 3 6 4 6 5 6 + 6 6 + 7 6 8 8 9 8 a 8 @@ -40,6 +42,8 @@ class 'pkg/TestExceptionElse' { c 8 d 8 e 8 + f 8 + 10 8 11 9 12 9 13 9 @@ -55,6 +59,8 @@ class 'pkg/TestExceptionElse' { 1d 10 1e 10 1f 10 + 20 10 + 21 10 22 11 23 11 24 11 @@ -70,11 +76,15 @@ class 'pkg/TestExceptionElse' { 31 12 32 12 33 12 + 34 12 + 35 12 36 12 37 12 38 12 39 12 3a 12 + 3b 12 + 3c 12 3d 13 3e 13 3f 13 @@ -87,6 +97,8 @@ class 'pkg/TestExceptionElse' { 49 14 4a 14 4b 14 + 4c 14 + 4d 14 4e 21 4f 21 50 21 @@ -102,11 +114,15 @@ class 'pkg/TestExceptionElse' { 5d 15 5e 15 5f 15 + 60 15 + 61 15 62 15 63 15 64 15 65 15 66 15 + 67 15 + 68 15 69 19 6a 19 6b 19 diff --git a/testData/results/pkg/TestFieldSingleAccess.dec b/testData/results/pkg/TestFieldSingleAccess.dec index 5baf35ee5e..e6a7dd206f 100644 --- a/testData/results/pkg/TestFieldSingleAccess.dec +++ b/testData/results/pkg/TestFieldSingleAccess.dec @@ -28,6 +28,8 @@ class 'pkg/TestFieldSingleAccess' { 2 7 3 7 5 7 + 6 7 + 7 7 8 8 9 8 a 8 @@ -48,6 +50,8 @@ class 'pkg/TestFieldSingleAccess' { 7 13 8 13 a 13 + b 13 + c 13 } method 'test1 ()V' { diff --git a/testData/results/pkg/TestFinallyBlockVariableUse.dec b/testData/results/pkg/TestFinallyBlockVariableUse.dec index c93d4449ee..b4c749ff90 100644 --- a/testData/results/pkg/TestFinallyBlockVariableUse.dec +++ b/testData/results/pkg/TestFinallyBlockVariableUse.dec @@ -41,12 +41,16 @@ class 'pkg/TestFinallyBlockVariableUse' { 3 4 4 4 5 4 + 6 4 + 7 4 8 8 9 8 a 8 b 8 c 8 d 8 + e 8 + f 8 10 11 11 11 12 11 @@ -74,6 +78,8 @@ class 'pkg/TestFinallyBlockVariableUse' { 57 19 58 19 59 19 + 5a 19 + 5b 19 5c 20 63 20 64 20 @@ -90,6 +96,8 @@ class 'pkg/TestFinallyBlockVariableUse' { 78 20 79 20 7b 20 + 7c 20 + 7d 20 } method 'condition (I)Z' { @@ -97,6 +105,8 @@ class 'pkg/TestFinallyBlockVariableUse' { 2 28 3 28 4 28 + 5 28 + 6 28 c 28 } diff --git a/testData/results/pkg/TestFinallyThrow.dec b/testData/results/pkg/TestFinallyThrow.dec index 364820d090..e837b28081 100644 --- a/testData/results/pkg/TestFinallyThrow.dec +++ b/testData/results/pkg/TestFinallyThrow.dec @@ -53,8 +53,12 @@ class 'pkg/TestFinallyThrow' { 2 6 3 6 4 6 + 5 6 + 6 6 2f 9 30 9 + 31 9 + 32 9 3a 10 45 12 47 13 @@ -65,6 +69,8 @@ class 'pkg/TestFinallyThrow' { 4e 15 4f 15 50 15 + 51 15 + 52 15 } method 'test1 (Ljava/lang/RuntimeException;)V' { @@ -73,11 +79,15 @@ class 'pkg/TestFinallyThrow' { 2 23 3 23 4 23 + 5 23 + 6 23 7 24 8 24 9 25 a 26 b 26 + c 26 + d 26 e 31 f 31 } @@ -95,6 +105,8 @@ class 'pkg/TestFinallyThrow' { 9 38 a 39 b 39 + c 39 + d 39 14 44 15 44 } diff --git a/testData/results/pkg/TestFloatInvertedIfConditionEarlyExit.dec b/testData/results/pkg/TestFloatInvertedIfConditionEarlyExit.dec index 7221ba92a2..bd1a736ca8 100644 --- a/testData/results/pkg/TestFloatInvertedIfConditionEarlyExit.dec +++ b/testData/results/pkg/TestFloatInvertedIfConditionEarlyExit.dec @@ -22,6 +22,8 @@ class 'pkg/TestFloatInvertedIfConditionEarlyExit' { 1 4 2 4 3 4 + 4 4 + 5 4 6 7 7 5 8 5 @@ -45,6 +47,8 @@ class 'pkg/TestFloatInvertedIfConditionEarlyExit' { a 11 b 11 c 11 + d 11 + e 11 12 12 13 12 14 12 @@ -55,6 +59,8 @@ class 'pkg/TestFloatInvertedIfConditionEarlyExit' { 26 12 27 12 28 12 + 29 12 + 2a 12 2b 10 2d 10 32 15 diff --git a/testData/results/pkg/TestForContinue.dec b/testData/results/pkg/TestForContinue.dec index 29d0304e52..3bc54df408 100644 --- a/testData/results/pkg/TestForContinue.dec +++ b/testData/results/pkg/TestForContinue.dec @@ -17,14 +17,20 @@ class 'pkg/TestForContinue' { 2 4 3 4 4 4 + 5 4 + 6 4 7 5 8 5 9 5 + a 5 + b 5 f 6 10 6 11 6 12 6 13 6 + 14 6 + 15 6 16 4 17 4 18 4 diff --git a/testData/results/pkg/TestForCyclicVarDef.dec b/testData/results/pkg/TestForCyclicVarDef.dec index 5a511c9645..2f17b7645a 100644 --- a/testData/results/pkg/TestForCyclicVarDef.dec +++ b/testData/results/pkg/TestForCyclicVarDef.dec @@ -47,6 +47,8 @@ class 'pkg/TestForCyclicVarDef' { 6 5 7 5 8 5 + 9 5 + a 5 b 14 c 6 d 6 diff --git a/testData/results/pkg/TestForeachMultiDimensionalArray.dec b/testData/results/pkg/TestForeachMultiDimensionalArray.dec index abc80cbc3c..efff5d42bf 100644 --- a/testData/results/pkg/TestForeachMultiDimensionalArray.dec +++ b/testData/results/pkg/TestForeachMultiDimensionalArray.dec @@ -37,6 +37,23 @@ class 'pkg/TestForeachMultiDimensionalArray' { 18 8 19 9 1a 9 + 1b 9 + 1c 9 + 1d 9 + 1e 9 + 1f 9 + 20 9 + 21 9 + 22 9 + 23 9 + 24 9 + 25 9 + 26 9 + 27 9 + 28 9 + 29 9 + 2a 9 + 2b 9 2c 12 2d 12 2e 12 diff --git a/testData/results/pkg/TestForeachMultipleLoops.dec b/testData/results/pkg/TestForeachMultipleLoops.dec index 8c7ed64b43..68fcbf8011 100644 --- a/testData/results/pkg/TestForeachMultipleLoops.dec +++ b/testData/results/pkg/TestForeachMultipleLoops.dec @@ -102,6 +102,8 @@ class 'pkg/TestForeachMultipleLoops' { method 'test (Ljava/lang/Object;Ljava/util/Map;I)V' { 0 8 1 8 + 2 8 + 3 8 4 9 5 9 6 9 @@ -149,6 +151,8 @@ class 'pkg/TestForeachMultipleLoops' { 3a 12 3b 13 3c 13 + 3d 13 + 3e 13 46 14 47 14 4b 14 @@ -161,6 +165,8 @@ class 'pkg/TestForeachMultipleLoops' { 58 16 59 16 5a 16 + 5b 16 + 5c 16 60 20 61 20 62 20 @@ -177,9 +183,13 @@ class 'pkg/TestForeachMultipleLoops' { 6d 24 6e 24 6f 24 + 70 24 + 71 24 72 25 73 25 74 25 + 75 25 + 76 25 7a 29 7b 29 7c 29 @@ -194,21 +204,29 @@ class 'pkg/TestForeachMultipleLoops' { 88 31 89 31 8a 31 + 8b 31 + 8c 31 8d 35 8e 35 8f 35 90 35 91 35 + 92 35 + 93 35 97 36 99 37 9a 37 9b 37 + 9c 37 + 9d 37 a1 41 } method 'test1 (Ljava/lang/Object;Ljava/util/Map;I)V' { 0 44 1 44 + 2 44 + 3 44 4 45 5 45 6 45 @@ -238,6 +256,8 @@ class 'pkg/TestForeachMultipleLoops' { 1e 53 1f 53 20 53 + 21 53 + 22 53 23 57 24 57 25 57 @@ -264,6 +284,8 @@ class 'pkg/TestForeachMultipleLoops' { 3a 58 3b 59 3c 59 + 3d 59 + 3e 59 46 60 47 60 4b 60 @@ -277,6 +299,8 @@ class 'pkg/TestForeachMultipleLoops' { 58 64 59 64 5a 64 + 5b 64 + 5c 64 60 65 61 65 62 65 @@ -293,9 +317,13 @@ class 'pkg/TestForeachMultipleLoops' { 6d 71 6e 71 6f 71 + 70 71 + 71 71 72 72 73 72 74 72 + 75 72 + 76 72 7a 76 7b 76 7c 76 @@ -311,6 +339,8 @@ class 'pkg/TestForeachMultipleLoops' { 88 80 89 80 8a 80 + 8b 80 + 8c 80 8d 84 8e 84 8f 84 @@ -339,6 +369,8 @@ class 'pkg/TestForeachMultipleLoops' { b0 85 b1 85 b2 85 + b3 85 + b4 85 b8 86 b9 86 ba 86 @@ -352,10 +384,14 @@ class 'pkg/TestForeachMultipleLoops' { c5 91 c6 91 c7 91 + c8 91 + c9 91 cd 92 cf 93 d0 93 d1 93 + d2 93 + d3 93 d7 54 } } @@ -410,4 +446,4 @@ Not mapped: 71 74 80 -81 \ No newline at end of file +81 diff --git a/testData/results/pkg/TestForeachVardef.dec b/testData/results/pkg/TestForeachVardef.dec index 90f3b39a23..9a2086dcdb 100644 --- a/testData/results/pkg/TestForeachVardef.dec +++ b/testData/results/pkg/TestForeachVardef.dec @@ -50,6 +50,8 @@ class 'pkg/TestForeachVardef' { 8 8 9 8 a 8 + b 8 + c 8 d 9 e 9 f 9 @@ -96,6 +98,8 @@ class 'pkg/TestForeachVardef' { 41 16 42 16 43 16 + 44 16 + 45 16 46 16 47 16 4b 16 @@ -112,6 +116,8 @@ class 'pkg/TestForeachVardef' { 4 24 5 24 6 24 + 7 24 + 8 24 9 25 a 25 b 25 @@ -122,6 +128,8 @@ class 'pkg/TestForeachVardef' { 10 27 11 27 12 27 + 13 27 + 14 27 15 28 16 28 17 28 diff --git a/testData/results/pkg/TestGenericArrays.dec b/testData/results/pkg/TestGenericArrays.dec index 599978f7ba..000745b9cf 100644 --- a/testData/results/pkg/TestGenericArrays.dec +++ b/testData/results/pkg/TestGenericArrays.dec @@ -37,4 +37,4 @@ Lines mapping: 9 <-> 9 10 <-> 10 Not mapped: -7 \ No newline at end of file +7 diff --git a/testData/results/pkg/TestGenericCastCall.dec b/testData/results/pkg/TestGenericCastCall.dec index 8c9addc3fd..e326b6dd4a 100644 --- a/testData/results/pkg/TestGenericCastCall.dec +++ b/testData/results/pkg/TestGenericCastCall.dec @@ -59,8 +59,12 @@ class 'pkg/TestGenericCastCall' { e 10 f 10 10 10 + 11 10 + 12 10 13 10 14 10 + 15 10 + 16 10 17 11 18 11 19 13 @@ -89,8 +93,12 @@ class 'pkg/TestGenericCastCall' { e 19 f 19 10 19 + 11 19 + 12 19 13 19 14 19 + 15 19 + 16 19 17 20 18 20 19 22 diff --git a/testData/results/pkg/TestGenericCasts.dec b/testData/results/pkg/TestGenericCasts.dec index 5b7f509ead..6f8296bb0d 100644 --- a/testData/results/pkg/TestGenericCasts.dec +++ b/testData/results/pkg/TestGenericCasts.dec @@ -134,6 +134,8 @@ class 'pkg/TestGenericCasts' { 8 21 9 21 a 21 + b 21 + c 21 d 22 e 22 f 22 @@ -181,11 +183,17 @@ class 'pkg/TestGenericCasts' { 2 29 3 29 4 29 + 5 29 + 6 29 7 30 8 30 9 30 a 30 10 30 + 11 30 + 12 30 + 13 30 + 14 30 15 33 16 33 17 33 @@ -315,4 +323,4 @@ Lines mapping: 68 <-> 71 73 <-> 42 Not mapped: -23 \ No newline at end of file +23 diff --git a/testData/results/pkg/TestGenericComparison.dec b/testData/results/pkg/TestGenericComparison.dec index 8611a6d70d..3bcc422d2d 100644 --- a/testData/results/pkg/TestGenericComparison.dec +++ b/testData/results/pkg/TestGenericComparison.dec @@ -35,6 +35,8 @@ class 'pkg/TestGenericComparison' { e 6 f 6 10 6 + 11 6 + 12 6 13 8 } @@ -47,4 +49,4 @@ class 'pkg/TestGenericComparison' { Lines mapping: 7 <-> 7 10 <-> 9 -13 <-> 12 \ No newline at end of file +13 <-> 12 diff --git a/testData/results/pkg/TestGenericObjectType.dec b/testData/results/pkg/TestGenericObjectType.dec index f51325ae96..fbf0f5259b 100644 --- a/testData/results/pkg/TestGenericObjectType.dec +++ b/testData/results/pkg/TestGenericObjectType.dec @@ -46,4 +46,4 @@ class 'pkg/TestGenericObjectType' { Lines mapping: 11 <-> 11 15 <-> 15 -19 <-> 19 \ No newline at end of file +19 <-> 19 diff --git a/testData/results/pkg/TestGenericSubclassTypes.dec b/testData/results/pkg/TestGenericSubclassTypes.dec index 9e2cf8a729..d74a351c17 100644 --- a/testData/results/pkg/TestGenericSubclassTypes.dec +++ b/testData/results/pkg/TestGenericSubclassTypes.dec @@ -73,4 +73,4 @@ class 'pkg/TestGenericSubclassTypes$Constant' { Lines mapping: 16 <-> 21 23 <-> 11 -27 <-> 15 \ No newline at end of file +27 <-> 15 diff --git a/testData/results/pkg/TestGenericSuper.dec b/testData/results/pkg/TestGenericSuper.dec index 873193f0d0..03be249ac9 100644 --- a/testData/results/pkg/TestGenericSuper.dec +++ b/testData/results/pkg/TestGenericSuper.dec @@ -126,4 +126,4 @@ Lines mapping: 26 <-> 21 27 <-> 22 28 <-> 23 -29 <-> 24 \ No newline at end of file +29 <-> 24 diff --git a/testData/results/pkg/TestGenericWildcard.dec b/testData/results/pkg/TestGenericWildcard.dec index 359c3f748f..c3d45400c4 100644 --- a/testData/results/pkg/TestGenericWildcard.dec +++ b/testData/results/pkg/TestGenericWildcard.dec @@ -108,11 +108,15 @@ class 'pkg/TestGenericWildcard' { method 'castOptional (ZLpkg/TestGenericWildcard;)Ljava/util/Optional;' { 0 26 1 26 + 2 26 + 3 26 4 26 5 26 6 26 7 26 b 26 + c 26 + d 26 e 26 } @@ -217,4 +221,4 @@ Lines mapping: 66 <-> 79 76 <-> 60 Not mapped: -43 \ No newline at end of file +43 diff --git a/testData/results/pkg/TestGenerics.dec b/testData/results/pkg/TestGenerics.dec index c63632f67b..9edafcdcbf 100644 --- a/testData/results/pkg/TestGenerics.dec +++ b/testData/results/pkg/TestGenerics.dec @@ -283,4 +283,4 @@ Lines mapping: Not mapped: 50 56 -63 \ No newline at end of file +63 diff --git a/testData/results/pkg/TestGenericsHierarchy.dec b/testData/results/pkg/TestGenericsHierarchy.dec index b8ea512dae..5c32a689eb 100644 --- a/testData/results/pkg/TestGenericsHierarchy.dec +++ b/testData/results/pkg/TestGenericsHierarchy.dec @@ -34,6 +34,8 @@ class 'pkg/TestGenericsHierarchy' { 18 11 19 12 1a 12 + 1b 12 + 1c 12 1d 13 1e 13 1f 16 @@ -110,4 +112,4 @@ Lines mapping: 24 <-> 21 25 <-> 22 39 <-> 25 -40 <-> 26 \ No newline at end of file +40 <-> 26 diff --git a/testData/results/pkg/TestGenericsInvocUnchecked.dec b/testData/results/pkg/TestGenericsInvocUnchecked.dec index 029d780922..e262e87fae 100644 --- a/testData/results/pkg/TestGenericsInvocUnchecked.dec +++ b/testData/results/pkg/TestGenericsInvocUnchecked.dec @@ -47,4 +47,4 @@ Lines mapping: 11 <-> 5 12 <-> 6 15 <-> 9 -16 <-> 10 \ No newline at end of file +16 <-> 10 diff --git a/testData/results/pkg/TestGenericsTernary.dec b/testData/results/pkg/TestGenericsTernary.dec index 643ebdfe53..182608deb2 100644 --- a/testData/results/pkg/TestGenericsTernary.dec +++ b/testData/results/pkg/TestGenericsTernary.dec @@ -35,6 +35,8 @@ class 'pkg/TestGenericsTernary' { e 10 f 10 10 10 + 11 10 + 12 10 13 10 17 10 18 10 @@ -43,6 +45,8 @@ class 'pkg/TestGenericsTernary' { method 'accept (Ljava/lang/Object;)Z' { 0 14 1 14 + 2 14 + 3 14 9 14 } } diff --git a/testData/results/pkg/TestGroovyClass.dec b/testData/results/pkg/TestGroovyClass.dec index bfae933e69..d6a62f29e6 100644 --- a/testData/results/pkg/TestGroovyClass.dec +++ b/testData/results/pkg/TestGroovyClass.dec @@ -265,6 +265,8 @@ class 'pkg/TestGroovyClass' { 2 39 3 39 5 39 + 6 39 + 7 39 8 40 a 42 c 42 @@ -352,6 +354,8 @@ class 'pkg/TestGroovyClass$Inner' { 2 86 3 86 5 86 + 6 86 + 7 86 8 87 a 89 c 89 @@ -405,6 +409,8 @@ class 'pkg/TestGroovyClass$Nested' { 2 114 3 114 5 114 + 6 114 + 7 114 8 115 a 117 c 117 diff --git a/testData/results/pkg/TestGroovyTryCatch.dec b/testData/results/pkg/TestGroovyTryCatch.dec index b212688564..92f263e3db 100644 --- a/testData/results/pkg/TestGroovyTryCatch.dec +++ b/testData/results/pkg/TestGroovyTryCatch.dec @@ -222,6 +222,8 @@ class 'pkg/TestGroovyTryCatch' { 2 52 3 52 5 52 + 6 52 + 7 52 8 53 a 55 c 55 diff --git a/testData/results/pkg/TestIfElseSwitch.dec b/testData/results/pkg/TestIfElseSwitch.dec index e706411f01..44c2c4b661 100644 --- a/testData/results/pkg/TestIfElseSwitch.dec +++ b/testData/results/pkg/TestIfElseSwitch.dec @@ -38,14 +38,20 @@ class 'pkg/TestIfElseSwitch' { 1 4 2 4 3 4 + 4 4 + 5 4 6 4 7 4 8 4 9 4 + a 4 + b 4 c 5 d 5 e 6 f 6 + 10 6 + 11 6 12 7 13 7 14 8 @@ -54,39 +60,80 @@ class 'pkg/TestIfElseSwitch' { 17 8 18 8 19 8 + 1a 8 + 1b 8 1c 8 1d 8 1e 8 1f 8 20 8 21 8 + 22 8 + 23 8 24 9 25 9 26 10 27 10 + 28 10 + 29 10 2a 10 2b 10 + 2c 10 + 2d 10 2e 11 2f 11 30 12 31 12 32 12 + 33 12 + 34 12 35 12 36 12 37 12 38 12 39 12 + 3a 12 + 3b 12 3c 13 3d 13 3e 13 3f 13 40 13 41 13 + 42 13 + 43 13 44 14 45 14 46 16 47 16 48 16 + 49 16 + 4a 16 + 4b 16 + 4c 16 + 4d 16 + 4e 16 + 4f 16 + 50 16 + 51 16 + 52 16 + 53 16 + 54 16 + 55 16 + 56 16 + 57 16 + 58 16 + 59 16 + 5a 16 + 5b 16 + 5c 16 + 5d 16 + 5e 16 + 5f 16 + 60 16 + 61 16 + 62 16 + 63 16 64 18 65 18 66 20 @@ -96,12 +143,16 @@ class 'pkg/TestIfElseSwitch' { 6a 22 6b 22 6c 22 + 6d 22 + 6e 22 74 22 75 25 76 25 77 25 78 25 79 25 + 7a 25 + 7b 25 7c 26 7d 26 7e 26 diff --git a/testData/results/pkg/TestIfElseTernary1.dec b/testData/results/pkg/TestIfElseTernary1.dec index ac2f546aa1..4c245897aa 100644 --- a/testData/results/pkg/TestIfElseTernary1.dec +++ b/testData/results/pkg/TestIfElseTernary1.dec @@ -123,13 +123,19 @@ class 'pkg/TestIfElseTernary1' { method 'test0 (ZIII)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 c 4 d 4 e 4 f 4 + 10 4 + 11 4 12 7 13 7 14 7 @@ -142,23 +148,35 @@ class 'pkg/TestIfElseTernary1' { 1e 5 1f 5 20 5 + 21 5 + 22 5 23 9 } method 'test1 (ZIII)V' { 0 12 1 12 + 2 12 + 3 12 4 12 5 12 6 12 + 7 12 + 8 12 9 12 a 12 + b 12 + c 12 10 12 11 12 + 12 12 + 13 12 17 12 18 12 19 12 1a 12 + 1b 12 + 1c 12 1d 15 1e 15 1f 15 @@ -171,27 +189,39 @@ class 'pkg/TestIfElseTernary1' { 29 13 2a 13 2b 13 + 2c 13 + 2d 13 2e 17 } method 'test2 (ZIII)V' { 0 20 1 20 + 2 20 + 3 20 4 20 5 20 6 20 + 7 20 + 8 20 c 20 d 20 e 20 f 20 + 10 20 + 11 20 12 20 13 20 14 20 15 20 + 16 20 + 17 20 1b 20 1c 20 1d 20 1e 20 + 1f 20 + 20 20 21 23 22 23 23 23 @@ -204,31 +234,47 @@ class 'pkg/TestIfElseTernary1' { 2d 21 2e 21 2f 21 + 30 21 + 31 21 32 25 } method 'test3 (ZIII)V' { 0 28 1 28 + 2 28 + 3 28 4 28 5 28 6 28 + 7 28 + 8 28 9 28 a 28 + b 28 + c 28 10 28 11 28 + 12 28 + 13 28 17 28 18 28 19 28 1a 28 + 1b 28 + 1c 28 1d 28 1e 28 1f 28 20 28 + 21 28 + 22 28 26 28 27 28 28 28 29 28 + 2a 28 + 2b 28 2c 31 2d 31 2e 31 @@ -241,31 +287,43 @@ class 'pkg/TestIfElseTernary1' { 38 29 39 29 3a 29 + 3b 29 + 3c 29 3d 33 } method 'test4 (ZIII)V' { 0 36 1 36 + 2 36 + 3 36 4 36 5 36 6 36 7 36 8 36 9 36 + a 36 + b 36 f 36 10 36 11 36 12 36 13 36 14 36 + 15 36 + 16 36 17 36 18 36 19 36 + 1a 36 + 1b 36 1f 36 20 36 21 36 22 36 + 23 36 + 24 36 25 39 26 39 27 39 @@ -278,35 +336,51 @@ class 'pkg/TestIfElseTernary1' { 31 37 32 37 33 37 + 34 37 + 35 37 36 41 } method 'test5 (ZIII)V' { 0 44 1 44 + 2 44 + 3 44 4 44 5 44 6 44 7 44 8 44 9 44 + a 44 + b 44 f 44 10 44 11 44 12 44 13 44 14 44 + 15 44 + 16 44 17 44 18 44 19 44 + 1a 44 + 1b 44 1c 44 1d 44 + 1e 44 + 1f 44 23 44 24 44 + 25 44 + 26 44 2a 44 2b 44 2c 44 2d 44 + 2e 44 + 2f 44 30 47 31 47 32 47 @@ -319,39 +393,55 @@ class 'pkg/TestIfElseTernary1' { 3c 45 3d 45 3e 45 + 3f 45 + 40 45 41 49 } method 'test6 (ZIII)V' { 0 52 1 52 + 2 52 + 3 52 4 52 5 52 6 52 7 52 8 52 9 52 + a 52 + b 52 f 52 10 52 11 52 12 52 13 52 14 52 + 15 52 + 16 52 17 52 18 52 19 52 + 1a 52 + 1b 52 1f 52 20 52 21 52 22 52 + 23 52 + 24 52 25 52 26 52 27 52 28 52 + 29 52 + 2a 52 2e 52 2f 52 30 52 31 52 + 32 52 + 33 52 34 55 35 55 36 55 @@ -364,43 +454,63 @@ class 'pkg/TestIfElseTernary1' { 40 53 41 53 42 53 + 43 53 + 44 53 45 57 } method 'test7 (ZIII)V' { 0 60 1 60 + 2 60 + 3 60 4 60 5 60 6 60 7 60 8 60 9 60 + a 60 + b 60 f 60 10 60 11 60 12 60 13 60 14 60 + 15 60 + 16 60 17 60 18 60 19 60 + 1a 60 + 1b 60 1c 60 1d 60 + 1e 60 + 1f 60 23 60 24 60 + 25 60 + 26 60 2a 60 2b 60 2c 60 2d 60 + 2e 60 + 2f 60 30 60 31 60 32 60 33 60 + 34 60 + 35 60 39 60 3a 60 3b 60 3c 60 + 3d 60 + 3e 60 3f 63 40 63 41 63 @@ -413,6 +523,8 @@ class 'pkg/TestIfElseTernary1' { 4b 61 4c 61 4d 61 + 4e 61 + 4f 61 50 65 } @@ -420,34 +532,50 @@ class 'pkg/TestIfElseTernary1' { 0 68 1 68 2 68 + 3 68 + 4 68 5 68 6 68 7 68 8 68 + 9 68 + a 68 b 68 c 68 d 68 + e 68 + f 68 13 68 14 68 15 68 + 16 68 + 17 68 18 68 19 68 1a 68 1b 68 + 1c 68 + 1d 68 1e 68 1f 68 20 68 21 68 22 68 23 68 + 24 68 + 25 68 26 68 27 68 28 68 29 68 2a 68 2b 68 + 2c 68 + 2d 68 31 68 32 68 + 33 68 + 34 68 35 71 36 71 37 71 @@ -460,6 +588,8 @@ class 'pkg/TestIfElseTernary1' { 41 69 42 69 43 69 + 44 69 + 45 69 46 73 } @@ -467,33 +597,49 @@ class 'pkg/TestIfElseTernary1' { 0 76 1 76 2 76 + 3 76 + 4 76 5 76 6 76 7 76 8 76 + 9 76 + a 76 b 76 c 76 + d 76 + e 76 12 76 13 76 14 76 + 15 76 + 16 76 17 76 18 76 19 76 1a 76 + 1b 76 + 1c 76 1d 76 1e 76 1f 76 20 76 21 76 22 76 + 23 76 + 24 76 25 76 26 76 27 76 28 76 29 76 2a 76 + 2b 76 + 2c 76 30 76 31 76 + 32 76 + 33 76 34 79 35 79 36 79 @@ -506,6 +652,8 @@ class 'pkg/TestIfElseTernary1' { 40 77 41 77 42 77 + 43 77 + 44 77 45 81 } @@ -518,20 +666,36 @@ class 'pkg/TestIfElseTernary1' { b 86 c 87 d 87 + e 87 + f 87 10 87 11 87 + 12 87 + 13 87 14 87 15 87 + 16 87 + 17 87 18 87 19 87 + 1a 87 + 1b 87 1f 87 20 87 + 21 87 + 22 87 23 87 24 87 + 25 87 + 26 87 2a 87 2b 87 + 2c 87 + 2d 87 2e 87 2f 87 + 30 87 + 31 87 32 88 36 88 37 89 diff --git a/testData/results/pkg/TestIfElseTernary1J17.dec b/testData/results/pkg/TestIfElseTernary1J17.dec index cb332de55a..285d655323 100644 --- a/testData/results/pkg/TestIfElseTernary1J17.dec +++ b/testData/results/pkg/TestIfElseTernary1J17.dec @@ -123,13 +123,19 @@ class 'pkg/TestIfElseTernary1J17' { method 'test0 (ZIII)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 c 4 d 4 e 4 f 4 + 10 4 + 11 4 12 7 13 7 14 7 @@ -142,23 +148,35 @@ class 'pkg/TestIfElseTernary1J17' { 1e 5 1f 5 20 5 + 21 5 + 22 5 23 9 } method 'test1 (ZIII)V' { 0 12 1 12 + 2 12 + 3 12 4 12 5 12 6 12 + 7 12 + 8 12 9 12 a 12 + b 12 + c 12 10 12 11 12 + 12 12 + 13 12 17 12 18 12 19 12 1a 12 + 1b 12 + 1c 12 1d 15 1e 15 1f 15 @@ -171,27 +189,39 @@ class 'pkg/TestIfElseTernary1J17' { 29 13 2a 13 2b 13 + 2c 13 + 2d 13 2e 17 } method 'test2 (ZIII)V' { 0 20 1 20 + 2 20 + 3 20 4 20 5 20 6 20 + 7 20 + 8 20 c 20 d 20 e 20 f 20 + 10 20 + 11 20 12 20 13 20 14 20 15 20 + 16 20 + 17 20 1b 20 1c 20 1d 20 1e 20 + 1f 20 + 20 20 21 23 22 23 23 23 @@ -204,31 +234,47 @@ class 'pkg/TestIfElseTernary1J17' { 2d 21 2e 21 2f 21 + 30 21 + 31 21 32 25 } method 'test3 (ZIII)V' { 0 28 1 28 + 2 28 + 3 28 4 28 5 28 6 28 + 7 28 + 8 28 9 28 a 28 + b 28 + c 28 10 28 11 28 + 12 28 + 13 28 17 28 18 28 19 28 1a 28 + 1b 28 + 1c 28 1d 28 1e 28 1f 28 20 28 + 21 28 + 22 28 26 28 27 28 28 28 29 28 + 2a 28 + 2b 28 2c 31 2d 31 2e 31 @@ -241,31 +287,43 @@ class 'pkg/TestIfElseTernary1J17' { 38 29 39 29 3a 29 + 3b 29 + 3c 29 3d 33 } method 'test4 (ZIII)V' { 0 36 1 36 + 2 36 + 3 36 4 36 5 36 6 36 7 36 8 36 9 36 + a 36 + b 36 f 36 10 36 11 36 12 36 13 36 14 36 + 15 36 + 16 36 17 36 18 36 19 36 + 1a 36 + 1b 36 1f 36 20 36 21 36 22 36 + 23 36 + 24 36 25 39 26 39 27 39 @@ -278,35 +336,51 @@ class 'pkg/TestIfElseTernary1J17' { 31 37 32 37 33 37 + 34 37 + 35 37 36 41 } method 'test5 (ZIII)V' { 0 44 1 44 + 2 44 + 3 44 4 44 5 44 6 44 7 44 8 44 9 44 + a 44 + b 44 f 44 10 44 11 44 12 44 13 44 14 44 + 15 44 + 16 44 17 44 18 44 19 44 + 1a 44 + 1b 44 1c 44 1d 44 + 1e 44 + 1f 44 23 44 24 44 + 25 44 + 26 44 2a 44 2b 44 2c 44 2d 44 + 2e 44 + 2f 44 30 47 31 47 32 47 @@ -319,39 +393,55 @@ class 'pkg/TestIfElseTernary1J17' { 3c 45 3d 45 3e 45 + 3f 45 + 40 45 41 49 } method 'test6 (ZIII)V' { 0 52 1 52 + 2 52 + 3 52 4 52 5 52 6 52 7 52 8 52 9 52 + a 52 + b 52 f 52 10 52 11 52 12 52 13 52 14 52 + 15 52 + 16 52 17 52 18 52 19 52 + 1a 52 + 1b 52 1f 52 20 52 21 52 22 52 + 23 52 + 24 52 25 52 26 52 27 52 28 52 + 29 52 + 2a 52 2e 52 2f 52 30 52 31 52 + 32 52 + 33 52 34 55 35 55 36 55 @@ -364,43 +454,63 @@ class 'pkg/TestIfElseTernary1J17' { 40 53 41 53 42 53 + 43 53 + 44 53 45 57 } method 'test7 (ZIII)V' { 0 60 1 60 + 2 60 + 3 60 4 60 5 60 6 60 7 60 8 60 9 60 + a 60 + b 60 f 60 10 60 11 60 12 60 13 60 14 60 + 15 60 + 16 60 17 60 18 60 19 60 + 1a 60 + 1b 60 1c 60 1d 60 + 1e 60 + 1f 60 23 60 24 60 + 25 60 + 26 60 2a 60 2b 60 2c 60 2d 60 + 2e 60 + 2f 60 30 60 31 60 32 60 33 60 + 34 60 + 35 60 39 60 3a 60 3b 60 3c 60 + 3d 60 + 3e 60 3f 63 40 63 41 63 @@ -413,6 +523,8 @@ class 'pkg/TestIfElseTernary1J17' { 4b 61 4c 61 4d 61 + 4e 61 + 4f 61 50 65 } @@ -420,34 +532,50 @@ class 'pkg/TestIfElseTernary1J17' { 0 68 1 68 2 68 + 3 68 + 4 68 5 68 6 68 7 68 8 68 + 9 68 + a 68 b 68 c 68 d 68 + e 68 + f 68 13 68 14 68 15 68 + 16 68 + 17 68 18 68 19 68 1a 68 1b 68 + 1c 68 + 1d 68 1e 68 1f 68 20 68 21 68 22 68 23 68 + 24 68 + 25 68 26 68 27 68 28 68 29 68 2a 68 2b 68 + 2c 68 + 2d 68 31 68 32 68 + 33 68 + 34 68 35 71 36 71 37 71 @@ -460,6 +588,8 @@ class 'pkg/TestIfElseTernary1J17' { 41 69 42 69 43 69 + 44 69 + 45 69 46 73 } @@ -467,33 +597,49 @@ class 'pkg/TestIfElseTernary1J17' { 0 76 1 76 2 76 + 3 76 + 4 76 5 76 6 76 7 76 8 76 + 9 76 + a 76 b 76 c 76 + d 76 + e 76 12 76 13 76 14 76 + 15 76 + 16 76 17 76 18 76 19 76 1a 76 + 1b 76 + 1c 76 1d 76 1e 76 1f 76 20 76 21 76 22 76 + 23 76 + 24 76 25 76 26 76 27 76 28 76 29 76 2a 76 + 2b 76 + 2c 76 30 76 31 76 + 32 76 + 33 76 34 79 35 79 36 79 @@ -506,6 +652,8 @@ class 'pkg/TestIfElseTernary1J17' { 40 77 41 77 42 77 + 43 77 + 44 77 45 81 } @@ -518,20 +666,36 @@ class 'pkg/TestIfElseTernary1J17' { b 86 c 87 d 87 + e 87 + f 87 10 87 11 87 + 12 87 + 13 87 14 87 15 87 + 16 87 + 17 87 18 87 19 87 + 1a 87 + 1b 87 1f 87 20 87 + 21 87 + 22 87 23 87 24 87 + 25 87 + 26 87 2a 87 2b 87 + 2c 87 + 2d 87 2e 87 2f 87 + 30 87 + 31 87 32 88 36 88 37 89 diff --git a/testData/results/pkg/TestIfLoop.dec b/testData/results/pkg/TestIfLoop.dec index 16106e20d1..c9cb49096b 100644 --- a/testData/results/pkg/TestIfLoop.dec +++ b/testData/results/pkg/TestIfLoop.dec @@ -67,27 +67,39 @@ class 'pkg/TestIfLoop' { method 'testCompoundCondition (II)I' { 0 7 1 7 + 2 7 + 3 7 4 7 5 7 6 7 + 7 7 + 8 7 9 8 a 8 + b 8 + c 8 d 9 e 9 f 9 10 9 11 9 12 9 + 13 9 + 14 9 15 9 16 9 17 9 18 9 + 19 9 + 1a 9 1b 10 1c 10 1d 14 1e 14 1f 14 20 14 + 21 14 + 22 14 23 15 24 15 25 15 @@ -104,6 +116,8 @@ class 'pkg/TestIfLoop' { 4 23 5 23 6 23 + 7 23 + 8 23 9 24 a 24 b 24 @@ -112,6 +126,8 @@ class 'pkg/TestIfLoop' { e 24 f 24 10 24 + 11 24 + 12 24 13 28 14 28 15 28 @@ -166,16 +182,24 @@ class 'pkg/TestIfLoop' { 1f 37 20 37 21 37 + 22 37 + 23 37 24 37 25 37 26 37 27 37 + 28 37 + 29 37 2a 37 2b 37 + 2c 37 + 2d 37 2e 37 2f 37 30 37 31 37 + 32 37 + 33 37 35 38 36 38 37 38 @@ -206,10 +230,14 @@ class 'pkg/TestIfLoop' { method 'testElseIf (I)I' { 0 43 1 43 + 2 43 + 3 43 4 44 5 44 6 44 7 44 + 8 44 + 9 44 a 45 b 45 c 45 @@ -217,6 +245,8 @@ class 'pkg/TestIfLoop' { 11 46 12 46 13 46 + 14 46 + 15 46 16 47 17 47 18 47 @@ -224,6 +254,8 @@ class 'pkg/TestIfLoop' { 1d 48 1e 48 1f 48 + 20 48 + 21 48 22 49 23 49 24 49 @@ -231,12 +263,16 @@ class 'pkg/TestIfLoop' { 29 50 2a 50 2b 50 + 2c 50 + 2d 50 2f 51 31 51 35 53 36 53 37 53 38 53 + 39 53 + 3a 53 3b 57 3c 57 3d 57 diff --git a/testData/results/pkg/TestIfPatternMatchMethod.dec b/testData/results/pkg/TestIfPatternMatchMethod.dec index f5cf156a4e..a8332520d4 100644 --- a/testData/results/pkg/TestIfPatternMatchMethod.dec +++ b/testData/results/pkg/TestIfPatternMatchMethod.dec @@ -29,6 +29,8 @@ class 'pkg/TestIfPatternMatchMethod' { 7 4 8 4 9 4 + a 4 + b 4 10 4 11 5 12 5 @@ -40,6 +42,8 @@ class 'pkg/TestIfPatternMatchMethod' { 18 5 19 5 1a 5 + 1b 5 + 1c 5 1d 7 } @@ -52,6 +56,8 @@ class 'pkg/TestIfPatternMatchMethod' { 5 10 6 10 7 10 + 8 10 + 9 10 a 11 b 11 c 11 @@ -70,6 +76,8 @@ class 'pkg/TestIfPatternMatchMethod' { 19 12 1a 12 1b 12 + 1c 12 + 1d 12 1e 14 } @@ -82,10 +90,14 @@ class 'pkg/TestIfPatternMatchMethod' { 5 17 6 17 7 17 + 8 17 + 9 17 a 17 b 17 f 17 10 17 + 11 17 + 12 17 13 17 } } diff --git a/testData/results/pkg/TestIfTernary1.dec b/testData/results/pkg/TestIfTernary1.dec index 1f6bfca8f9..cb40a65496 100644 --- a/testData/results/pkg/TestIfTernary1.dec +++ b/testData/results/pkg/TestIfTernary1.dec @@ -66,240 +66,352 @@ class 'pkg/TestIfTernary1' { method 'test0 (ZIII)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 c 4 d 4 e 4 f 4 + 10 4 + 11 4 12 5 13 5 14 5 15 5 16 5 + 17 5 + 18 5 19 7 } method 'test1 (ZIII)V' { 0 10 1 10 + 2 10 + 3 10 4 10 5 10 6 10 + 7 10 + 8 10 9 10 a 10 + b 10 + c 10 10 10 11 10 + 12 10 + 13 10 17 10 18 10 19 10 1a 10 + 1b 10 + 1c 10 1d 11 1e 11 1f 11 20 11 21 11 + 22 11 + 23 11 24 13 } method 'test2 (ZIII)V' { 0 16 1 16 + 2 16 + 3 16 4 16 5 16 6 16 + 7 16 + 8 16 c 16 d 16 e 16 f 16 + 10 16 + 11 16 12 16 13 16 14 16 15 16 + 16 16 + 17 16 1b 16 1c 16 1d 16 1e 16 + 1f 16 + 20 16 21 17 22 17 23 17 24 17 25 17 + 26 17 + 27 17 28 19 } method 'test3 (ZIII)V' { 0 22 1 22 + 2 22 + 3 22 4 22 5 22 6 22 + 7 22 + 8 22 9 22 a 22 + b 22 + c 22 10 22 11 22 + 12 22 + 13 22 17 22 18 22 19 22 1a 22 + 1b 22 + 1c 22 1d 22 1e 22 1f 22 20 22 + 21 22 + 22 22 26 22 27 22 28 22 29 22 + 2a 22 + 2b 22 2c 23 2d 23 2e 23 2f 23 30 23 + 31 23 + 32 23 33 25 } method 'test4 (ZIII)V' { 0 28 1 28 + 2 28 + 3 28 4 28 5 28 6 28 7 28 8 28 9 28 + a 28 + b 28 f 28 10 28 11 28 12 28 13 28 14 28 + 15 28 + 16 28 17 28 18 28 19 28 + 1a 28 + 1b 28 1f 28 20 28 21 28 22 28 + 23 28 + 24 28 25 29 26 29 27 29 28 29 29 29 + 2a 29 + 2b 29 2c 31 } method 'test5 (ZIII)V' { 0 34 1 34 + 2 34 + 3 34 4 34 5 34 6 34 7 34 8 34 9 34 + a 34 + b 34 f 34 10 34 11 34 12 34 13 34 14 34 + 15 34 + 16 34 17 34 18 34 19 34 + 1a 34 + 1b 34 1c 34 1d 34 + 1e 34 + 1f 34 23 34 24 34 + 25 34 + 26 34 2a 34 2b 34 2c 34 2d 34 + 2e 34 + 2f 34 30 35 31 35 32 35 33 35 34 35 + 35 35 + 36 35 37 37 } method 'test6 (ZIII)V' { 0 40 1 40 + 2 40 + 3 40 4 40 5 40 6 40 7 40 8 40 9 40 + a 40 + b 40 f 40 10 40 11 40 12 40 13 40 14 40 + 15 40 + 16 40 17 40 18 40 19 40 + 1a 40 + 1b 40 1f 40 20 40 21 40 22 40 + 23 40 + 24 40 25 40 26 40 27 40 28 40 + 29 40 + 2a 40 2e 40 2f 40 30 40 31 40 + 32 40 + 33 40 34 41 35 41 36 41 37 41 38 41 + 39 41 + 3a 41 3b 43 } method 'test7 (ZIII)V' { 0 46 1 46 + 2 46 + 3 46 4 46 5 46 6 46 7 46 8 46 9 46 + a 46 + b 46 f 46 10 46 11 46 12 46 13 46 14 46 + 15 46 + 16 46 17 46 18 46 19 46 + 1a 46 + 1b 46 1c 46 1d 46 + 1e 46 + 1f 46 23 46 24 46 + 25 46 + 26 46 2a 46 2b 46 2c 46 2d 46 + 2e 46 + 2f 46 30 46 31 46 32 46 33 46 + 34 46 + 35 46 39 46 3a 46 3b 46 3c 46 + 3d 46 + 3e 46 3f 47 40 47 41 47 42 47 43 47 + 44 47 + 45 47 46 49 } @@ -307,39 +419,57 @@ class 'pkg/TestIfTernary1' { 0 52 1 52 2 52 + 3 52 + 4 52 5 52 6 52 7 52 8 52 + 9 52 + a 52 b 52 c 52 d 52 + e 52 + f 52 13 52 14 52 15 52 + 16 52 + 17 52 18 52 19 52 1a 52 1b 52 + 1c 52 + 1d 52 1e 52 1f 52 20 52 21 52 22 52 23 52 + 24 52 + 25 52 26 52 27 52 28 52 29 52 2a 52 2b 52 + 2c 52 + 2d 52 31 52 32 52 + 33 52 + 34 52 35 53 36 53 37 53 38 53 39 53 + 3a 53 + 3b 53 3c 55 } @@ -347,38 +477,56 @@ class 'pkg/TestIfTernary1' { 0 58 1 58 2 58 + 3 58 + 4 58 5 58 6 58 7 58 8 58 + 9 58 + a 58 b 58 c 58 + d 58 + e 58 12 58 13 58 14 58 + 15 58 + 16 58 17 58 18 58 19 58 1a 58 + 1b 58 + 1c 58 1d 58 1e 58 1f 58 20 58 21 58 22 58 + 23 58 + 24 58 25 58 26 58 27 58 28 58 29 58 2a 58 + 2b 58 + 2c 58 30 58 31 58 + 32 58 + 33 58 34 59 35 59 36 59 37 59 38 59 + 39 59 + 3a 59 3b 61 } } diff --git a/testData/results/pkg/TestIfTernary1J17.dec b/testData/results/pkg/TestIfTernary1J17.dec index a83f34c950..959f87627d 100644 --- a/testData/results/pkg/TestIfTernary1J17.dec +++ b/testData/results/pkg/TestIfTernary1J17.dec @@ -66,240 +66,352 @@ class 'pkg/TestIfTernary1J17' { method 'test0 (ZIII)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 c 4 d 4 e 4 f 4 + 10 4 + 11 4 12 5 13 5 14 5 15 5 16 5 + 17 5 + 18 5 19 7 } method 'test1 (ZIII)V' { 0 10 1 10 + 2 10 + 3 10 4 10 5 10 6 10 + 7 10 + 8 10 9 10 a 10 + b 10 + c 10 10 10 11 10 + 12 10 + 13 10 17 10 18 10 19 10 1a 10 + 1b 10 + 1c 10 1d 11 1e 11 1f 11 20 11 21 11 + 22 11 + 23 11 24 13 } method 'test2 (ZIII)V' { 0 16 1 16 + 2 16 + 3 16 4 16 5 16 6 16 + 7 16 + 8 16 c 16 d 16 e 16 f 16 + 10 16 + 11 16 12 16 13 16 14 16 15 16 + 16 16 + 17 16 1b 16 1c 16 1d 16 1e 16 + 1f 16 + 20 16 21 17 22 17 23 17 24 17 25 17 + 26 17 + 27 17 28 19 } method 'test3 (ZIII)V' { 0 22 1 22 + 2 22 + 3 22 4 22 5 22 6 22 + 7 22 + 8 22 9 22 a 22 + b 22 + c 22 10 22 11 22 + 12 22 + 13 22 17 22 18 22 19 22 1a 22 + 1b 22 + 1c 22 1d 22 1e 22 1f 22 20 22 + 21 22 + 22 22 26 22 27 22 28 22 29 22 + 2a 22 + 2b 22 2c 23 2d 23 2e 23 2f 23 30 23 + 31 23 + 32 23 33 25 } method 'test4 (ZIII)V' { 0 28 1 28 + 2 28 + 3 28 4 28 5 28 6 28 7 28 8 28 9 28 + a 28 + b 28 f 28 10 28 11 28 12 28 13 28 14 28 + 15 28 + 16 28 17 28 18 28 19 28 + 1a 28 + 1b 28 1f 28 20 28 21 28 22 28 + 23 28 + 24 28 25 29 26 29 27 29 28 29 29 29 + 2a 29 + 2b 29 2c 31 } method 'test5 (ZIII)V' { 0 34 1 34 + 2 34 + 3 34 4 34 5 34 6 34 7 34 8 34 9 34 + a 34 + b 34 f 34 10 34 11 34 12 34 13 34 14 34 + 15 34 + 16 34 17 34 18 34 19 34 + 1a 34 + 1b 34 1c 34 1d 34 + 1e 34 + 1f 34 23 34 24 34 + 25 34 + 26 34 2a 34 2b 34 2c 34 2d 34 + 2e 34 + 2f 34 30 35 31 35 32 35 33 35 34 35 + 35 35 + 36 35 37 37 } method 'test6 (ZIII)V' { 0 40 1 40 + 2 40 + 3 40 4 40 5 40 6 40 7 40 8 40 9 40 + a 40 + b 40 f 40 10 40 11 40 12 40 13 40 14 40 + 15 40 + 16 40 17 40 18 40 19 40 + 1a 40 + 1b 40 1f 40 20 40 21 40 22 40 + 23 40 + 24 40 25 40 26 40 27 40 28 40 + 29 40 + 2a 40 2e 40 2f 40 30 40 31 40 + 32 40 + 33 40 34 41 35 41 36 41 37 41 38 41 + 39 41 + 3a 41 3b 43 } method 'test7 (ZIII)V' { 0 46 1 46 + 2 46 + 3 46 4 46 5 46 6 46 7 46 8 46 9 46 + a 46 + b 46 f 46 10 46 11 46 12 46 13 46 14 46 + 15 46 + 16 46 17 46 18 46 19 46 + 1a 46 + 1b 46 1c 46 1d 46 + 1e 46 + 1f 46 23 46 24 46 + 25 46 + 26 46 2a 46 2b 46 2c 46 2d 46 + 2e 46 + 2f 46 30 46 31 46 32 46 33 46 + 34 46 + 35 46 39 46 3a 46 3b 46 3c 46 + 3d 46 + 3e 46 3f 47 40 47 41 47 42 47 43 47 + 44 47 + 45 47 46 49 } @@ -307,39 +419,57 @@ class 'pkg/TestIfTernary1J17' { 0 52 1 52 2 52 + 3 52 + 4 52 5 52 6 52 7 52 8 52 + 9 52 + a 52 b 52 c 52 d 52 + e 52 + f 52 13 52 14 52 15 52 + 16 52 + 17 52 18 52 19 52 1a 52 1b 52 + 1c 52 + 1d 52 1e 52 1f 52 20 52 21 52 22 52 23 52 + 24 52 + 25 52 26 52 27 52 28 52 29 52 2a 52 2b 52 + 2c 52 + 2d 52 31 52 32 52 + 33 52 + 34 52 35 53 36 53 37 53 38 53 39 53 + 3a 53 + 3b 53 3c 55 } @@ -347,38 +477,56 @@ class 'pkg/TestIfTernary1J17' { 0 58 1 58 2 58 + 3 58 + 4 58 5 58 6 58 7 58 8 58 + 9 58 + a 58 b 58 c 58 + d 58 + e 58 12 58 13 58 14 58 + 15 58 + 16 58 17 58 18 58 19 58 1a 58 + 1b 58 + 1c 58 1d 58 1e 58 1f 58 20 58 21 58 22 58 + 23 58 + 24 58 25 58 26 58 27 58 28 58 29 58 2a 58 + 2b 58 + 2c 58 30 58 31 58 + 32 58 + 33 58 34 59 35 59 36 59 37 59 38 59 + 39 59 + 3a 59 3b 61 } } diff --git a/testData/results/pkg/TestIfTernary2.dec b/testData/results/pkg/TestIfTernary2.dec index ef4ec0865e..815013b3a8 100644 --- a/testData/results/pkg/TestIfTernary2.dec +++ b/testData/results/pkg/TestIfTernary2.dec @@ -46,8 +46,12 @@ class 'pkg/TestIfTernary2' { method 'test (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 + 6 4 + 7 4 b 4 c 4 d 4 @@ -56,9 +60,13 @@ class 'pkg/TestIfTernary2' { 10 4 14 4 15 4 + 16 4 + 17 4 18 4 19 4 1a 4 + 1b 4 + 1c 4 20 4 21 4 22 4 @@ -69,18 +77,30 @@ class 'pkg/TestIfTernary2' { method 'test1 (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;' { 0 8 1 8 + 2 8 + 3 8 4 8 5 8 + 6 8 + 7 8 b 8 c 8 d 8 + e 8 + f 8 10 9 11 9 + 12 9 + 13 9 14 9 15 9 16 9 + 17 9 + 18 9 1c 9 1d 9 + 1e 9 + 1f 9 20 9 21 9 23 9 @@ -93,28 +113,44 @@ class 'pkg/TestIfTernary2' { method 'test2 (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V' { 0 16 1 16 + 2 16 + 3 16 4 16 5 16 + 6 16 + 7 16 b 16 c 16 d 16 + e 16 + f 16 10 17 11 17 + 12 17 + 13 17 14 17 15 17 16 17 + 17 17 + 18 17 1c 17 1d 17 + 1e 17 + 1f 17 20 18 21 18 22 18 23 18 24 18 + 25 18 + 26 18 27 21 28 21 29 21 2a 21 2b 21 + 2c 21 + 2d 21 2e 24 2f 24 30 24 @@ -128,19 +164,29 @@ class 'pkg/TestIfTernary2' { method 'test3 (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;' { 0 28 1 28 + 2 28 + 3 28 4 28 5 28 + 6 28 + 7 28 b 28 c 28 d 28 + e 28 + f 28 10 29 11 29 12 29 13 29 14 29 + 15 29 + 16 29 17 31 18 31 19 31 + 1a 31 + 1b 31 1c 32 1d 32 1e 32 @@ -149,12 +195,16 @@ class 'pkg/TestIfTernary2' { 24 35 25 35 26 35 + 27 35 + 28 35 29 36 2a 36 2b 36 2c 36 2d 36 2e 36 + 2f 36 + 30 36 31 40 32 40 33 40 diff --git a/testData/results/pkg/TestIfTernary3.dec b/testData/results/pkg/TestIfTernary3.dec index d21264f36b..9de62280e3 100644 --- a/testData/results/pkg/TestIfTernary3.dec +++ b/testData/results/pkg/TestIfTernary3.dec @@ -14,6 +14,8 @@ class 'pkg/TestIfTernary3' { method 'test (ZII)V' { 0 4 1 4 + 2 4 + 3 4 b 4 c 4 10 4 @@ -23,6 +25,8 @@ class 'pkg/TestIfTernary3' { 17 4 18 4 19 4 + 1a 4 + 1b 4 26 4 27 4 2b 4 @@ -32,11 +36,15 @@ class 'pkg/TestIfTernary3' { 32 4 33 4 34 4 + 35 4 + 36 4 37 5 38 5 39 5 3a 5 3b 5 + 3c 5 + 3d 5 3e 8 3f 8 40 8 diff --git a/testData/results/pkg/TestIfTernaryReturn.dec b/testData/results/pkg/TestIfTernaryReturn.dec index 369d02123e..8c9538438b 100644 --- a/testData/results/pkg/TestIfTernaryReturn.dec +++ b/testData/results/pkg/TestIfTernaryReturn.dec @@ -24,12 +24,18 @@ class 'pkg/TestIfTernaryReturn' { method 'test (ZII)I' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 c 4 d 4 e 4 + f 4 + 10 4 11 4 13 4 } @@ -37,9 +43,13 @@ class 'pkg/TestIfTernaryReturn' { method 'test1 (ZII)I' { 0 8 1 8 + 2 8 + 3 8 4 9 5 9 6 9 + 7 9 + 8 9 9 10 a 10 b 10 @@ -52,6 +62,8 @@ class 'pkg/TestIfTernaryReturn' { 12 13 13 13 14 13 + 15 13 + 16 13 17 14 18 14 19 14 diff --git a/testData/results/pkg/TestIffSimplification.dec b/testData/results/pkg/TestIffSimplification.dec index 1598c23440..aa1020e975 100644 --- a/testData/results/pkg/TestIffSimplification.dec +++ b/testData/results/pkg/TestIffSimplification.dec @@ -34,6 +34,8 @@ class 'pkg/TestIffSimplification' { method 'simpleIff (Z[I)I' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 @@ -46,6 +48,8 @@ class 'pkg/TestIffSimplification' { method 'simpleIf (Z[I)I' { 0 8 1 8 + 2 8 + 3 8 4 8 5 8 6 8 @@ -57,8 +61,12 @@ class 'pkg/TestIffSimplification' { method 'nestedIf (ZZ[I)I' { 0 12 1 12 + 2 12 + 3 12 4 13 5 13 + 6 13 + 7 13 8 13 9 13 a 13 @@ -75,9 +83,13 @@ class 'pkg/TestIffSimplification' { 0 20 1 20 2 20 + 3 20 + 4 20 5 21 6 21 7 21 + 8 21 + 9 21 a 21 e 21 f 21 @@ -85,10 +97,14 @@ class 'pkg/TestIffSimplification' { 11 22 12 22 13 22 + 14 22 + 15 22 16 23 17 23 18 23 19 23 + 1a 23 + 1b 23 1c 23 20 23 21 23 @@ -105,11 +121,15 @@ class 'pkg/TestIffSimplification' { 2c 24 2d 24 2e 24 + 2f 24 + 30 24 31 25 32 25 33 25 34 25 35 25 + 36 25 + 37 25 38 25 3c 25 3d 25 @@ -119,6 +139,8 @@ class 'pkg/TestIffSimplification' { 41 27 42 27 43 27 + 44 27 + 45 27 46 27 4a 27 4b 27 diff --git a/testData/results/pkg/TestIllegalMethodNames.dec b/testData/results/pkg/TestIllegalMethodNames.dec index bc7a0671ea..72044a6801 100644 --- a/testData/results/pkg/TestIllegalMethodNames.dec +++ b/testData/results/pkg/TestIllegalMethodNames.dec @@ -69,6 +69,8 @@ class 'pkg/TestIllegalMethodNames' { 3 17 4 17 5 17 + 6 17 + 7 17 d 17 } diff --git a/testData/results/pkg/TestInUse.dec b/testData/results/pkg/TestInUse.dec index c053b2122a..682d09ebab 100644 --- a/testData/results/pkg/TestInUse.dec +++ b/testData/results/pkg/TestInUse.dec @@ -47,6 +47,8 @@ class 'pkg/TestInUse' { 13 15 14 15 15 15 + 16 15 + 17 15 18 17 19 17 } diff --git a/testData/results/pkg/TestInfiniteLoop.dec b/testData/results/pkg/TestInfiniteLoop.dec index 4bffbb4f2d..5ac2ac0f87 100644 --- a/testData/results/pkg/TestInfiniteLoop.dec +++ b/testData/results/pkg/TestInfiniteLoop.dec @@ -75,6 +75,8 @@ class 'pkg/TestInfiniteLoop' { 0 29 1 29 2 29 + 3 29 + 4 29 5 32 6 32 } @@ -89,6 +91,8 @@ class 'pkg/TestInfiniteLoop' { 1 43 2 44 3 44 + 4 44 + 5 44 6 45 7 45 } @@ -98,10 +102,14 @@ class 'pkg/TestInfiniteLoop' { 1 53 2 54 3 54 + 4 54 + 5 54 6 55 7 55 8 55 9 56 + a 56 + b 56 f 61 } @@ -110,6 +118,8 @@ class 'pkg/TestInfiniteLoop' { 1 64 2 64 3 65 + 4 65 + 5 65 } } diff --git a/testData/results/pkg/TestInlineAssignments.dec b/testData/results/pkg/TestInlineAssignments.dec index d6bc2bdbb8..7a5d514260 100644 --- a/testData/results/pkg/TestInlineAssignments.dec +++ b/testData/results/pkg/TestInlineAssignments.dec @@ -40,6 +40,8 @@ class 'pkg/TestInlineAssignments' { a 8 b 8 c 8 + d 8 + e 8 14 8 15 8 16 8 @@ -54,6 +56,8 @@ class 'pkg/TestInlineAssignments' { e 13 f 13 10 13 + 11 13 + 12 13 18 13 19 13 1a 13 @@ -69,6 +73,8 @@ class 'pkg/TestInlineAssignments' { 9 18 a 18 b 18 + c 18 + d 18 13 18 14 18 15 18 diff --git a/testData/results/pkg/TestInlineNoSuccessor.dec b/testData/results/pkg/TestInlineNoSuccessor.dec index f3f8927679..e6cbc1d870 100644 --- a/testData/results/pkg/TestInlineNoSuccessor.dec +++ b/testData/results/pkg/TestInlineNoSuccessor.dec @@ -38,6 +38,8 @@ class 'pkg/TestInlineNoSuccessor' { 3 4 4 4 5 4 + 6 4 + 7 4 8 5 9 5 a 5 @@ -47,6 +49,8 @@ class 'pkg/TestInlineNoSuccessor' { e 6 f 6 10 6 + 11 6 + 12 6 13 7 14 7 15 10 @@ -56,6 +60,8 @@ class 'pkg/TestInlineNoSuccessor' { 19 10 1a 10 1b 10 + 1c 10 + 1d 10 1e 14 1f 14 20 14 @@ -63,6 +69,8 @@ class 'pkg/TestInlineNoSuccessor' { 22 14 23 14 24 14 + 25 14 + 26 14 27 15 28 15 29 15 @@ -77,6 +85,8 @@ class 'pkg/TestInlineNoSuccessor' { 32 16 33 16 34 16 + 35 16 + 36 16 37 17 38 17 39 17 @@ -84,11 +94,15 @@ class 'pkg/TestInlineNoSuccessor' { 3b 17 3c 17 3d 17 + 3e 17 + 3f 17 40 21 41 21 42 21 43 21 44 21 + 45 21 + 46 21 47 24 48 24 49 24 diff --git a/testData/results/pkg/TestInlineSwitchExpression1.dec b/testData/results/pkg/TestInlineSwitchExpression1.dec index 5850edc377..9c241b52c2 100644 --- a/testData/results/pkg/TestInlineSwitchExpression1.dec +++ b/testData/results/pkg/TestInlineSwitchExpression1.dec @@ -23,6 +23,42 @@ class 'pkg/TestInlineSwitchExpression1' { 6 6 a 6 b 6 + c 6 + d 6 + e 6 + f 6 + 10 6 + 11 6 + 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 + 24 6 + 25 6 + 26 6 + 27 6 + 28 6 + 29 6 + 2a 6 + 2b 6 + 2c 6 + 2d 6 + 2e 6 + 2f 6 30 7 31 7 32 7 diff --git a/testData/results/pkg/TestInlineSwitchExpression2.dec b/testData/results/pkg/TestInlineSwitchExpression2.dec index b7f1830cf4..8bfd18f66f 100644 --- a/testData/results/pkg/TestInlineSwitchExpression2.dec +++ b/testData/results/pkg/TestInlineSwitchExpression2.dec @@ -30,12 +30,47 @@ class 'pkg/TestInlineSwitchExpression2' { 5 7 9 7 a 7 + b 7 + c 7 + d 7 + e 7 + f 7 + 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 + 20 7 + 21 7 + 22 7 + 23 7 + 24 7 + 25 7 + 26 7 + 27 7 + 28 7 + 29 7 + 2a 7 + 2b 7 2d 9 2e 9 2f 9 30 9 32 9 33 11 + 34 11 + 35 11 37 13 38 13 3a 13 diff --git a/testData/results/pkg/TestInlineSwitchExpression3.dec b/testData/results/pkg/TestInlineSwitchExpression3.dec index 1ca443c7b1..60ae7b3a41 100644 --- a/testData/results/pkg/TestInlineSwitchExpression3.dec +++ b/testData/results/pkg/TestInlineSwitchExpression3.dec @@ -19,6 +19,42 @@ class 'pkg/TestInlineSwitchExpression3' { 6 6 a 6 b 6 + c 6 + d 6 + e 6 + f 6 + 10 6 + 11 6 + 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 + 24 6 + 25 6 + 26 6 + 27 6 + 28 6 + 29 6 + 2a 6 + 2b 6 + 2c 6 + 2d 6 + 2e 6 + 2f 6 30 7 34 8 40 6 diff --git a/testData/results/pkg/TestInlineSwitchExpression4.dec b/testData/results/pkg/TestInlineSwitchExpression4.dec index 556422deef..4dc660ac76 100644 --- a/testData/results/pkg/TestInlineSwitchExpression4.dec +++ b/testData/results/pkg/TestInlineSwitchExpression4.dec @@ -23,13 +23,35 @@ class 'pkg/TestInlineSwitchExpression4' { method 'test (I)Ljava/lang/String;' { 0 5 1 5 + 2 5 + 3 5 4 6 5 6 + 6 6 + 7 6 + 8 6 + 9 6 + a 6 + b 6 + c 6 + d 6 + e 6 + f 6 10 8 11 8 15 11 16 11 + 17 11 + 18 11 + 19 11 + 1a 11 + 1b 11 + 1c 11 + 1d 11 + 1e 11 + 1f 11 20 13 + 21 13 22 17 } } diff --git a/testData/results/pkg/TestInlineSwitchExpression5.dec b/testData/results/pkg/TestInlineSwitchExpression5.dec index 04c211bae5..a6ff27ea4a 100644 --- a/testData/results/pkg/TestInlineSwitchExpression5.dec +++ b/testData/results/pkg/TestInlineSwitchExpression5.dec @@ -26,11 +26,40 @@ class 'pkg/TestInlineSwitchExpression5' { 2 7 3 7 4 7 + 5 7 + 6 7 + 7 7 + 8 7 + 9 7 + a 7 + b 7 + c 7 + d 7 + e 7 + f 7 + 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 20 8 24 9 25 9 29 10 2a 7 + 2b 7 + 2c 7 2d 15 2e 15 2f 15 diff --git a/testData/results/pkg/TestInlineSwitchExpression6.dec b/testData/results/pkg/TestInlineSwitchExpression6.dec index 3e6c61b35f..fb37dd5448 100644 --- a/testData/results/pkg/TestInlineSwitchExpression6.dec +++ b/testData/results/pkg/TestInlineSwitchExpression6.dec @@ -27,15 +27,35 @@ class 'pkg/TestInlineSwitchExpression6' { 2 6 3 6 4 6 + 5 6 + 6 6 7 7 8 7 9 7 a 9 b 9 + c 9 + d 9 + e 9 + f 9 + 10 9 + 11 9 + 12 9 + 13 9 + 14 9 + 15 9 + 16 9 + 17 9 + 18 9 + 19 9 + 1a 9 + 1b 9 1c 10 20 12 21 12 22 12 + 23 12 + 24 12 25 15 26 9 2a 19 @@ -50,4 +70,4 @@ Lines mapping: 10 <-> 11 13 <-> 13 17 <-> 16 -21 <-> 20 \ No newline at end of file +21 <-> 20 diff --git a/testData/results/pkg/TestInnerClasses2J21.dec b/testData/results/pkg/TestInnerClasses2J21.dec index 4cbd42fef5..3ab76ff5a9 100644 --- a/testData/results/pkg/TestInnerClasses2J21.dec +++ b/testData/results/pkg/TestInnerClasses2J21.dec @@ -40,4 +40,4 @@ Lines mapping: 11 <-> 11 12 <-> 12 Not mapped: -10 \ No newline at end of file +10 diff --git a/testData/results/pkg/TestInnerClassesJ21.dec b/testData/results/pkg/TestInnerClassesJ21.dec index 8ffaffbfa9..2876b8d701 100644 --- a/testData/results/pkg/TestInnerClassesJ21.dec +++ b/testData/results/pkg/TestInnerClassesJ21.dec @@ -61,4 +61,4 @@ Lines mapping: 18 <-> 5 19 <-> 6 Not mapped: -9 \ No newline at end of file +9 diff --git a/testData/results/pkg/TestInstanceGeneric.dec b/testData/results/pkg/TestInstanceGeneric.dec index 4c0731f74f..8687f31e27 100644 --- a/testData/results/pkg/TestInstanceGeneric.dec +++ b/testData/results/pkg/TestInstanceGeneric.dec @@ -43,4 +43,4 @@ Lines mapping: 9 <-> 8 13 <-> 12 15 <-> 13 -16 <-> 14 \ No newline at end of file +16 <-> 14 diff --git a/testData/results/pkg/TestIntBoolMerge.dec b/testData/results/pkg/TestIntBoolMerge.dec index 7eaf0599da..e14685a0e8 100644 --- a/testData/results/pkg/TestIntBoolMerge.dec +++ b/testData/results/pkg/TestIntBoolMerge.dec @@ -74,6 +74,8 @@ class 'pkg/TestIntBoolMerge' { e 17 f 17 10 17 + 11 17 + 12 17 13 18 14 18 15 18 @@ -128,4 +130,4 @@ Lines mapping: 28 <-> 27 29 <-> 28 33 <-> 31 -37 <-> 34 \ No newline at end of file +37 <-> 34 diff --git a/testData/results/pkg/TestInvertedFloatComparison.dec b/testData/results/pkg/TestInvertedFloatComparison.dec index 6fc3e9f26e..e7d4f2d2b4 100644 --- a/testData/results/pkg/TestInvertedFloatComparison.dec +++ b/testData/results/pkg/TestInvertedFloatComparison.dec @@ -72,6 +72,8 @@ class 'pkg/TestInvertedFloatComparison' { 1 4 2 4 3 4 + 4 4 + 5 4 b 4 } @@ -79,6 +81,8 @@ class 'pkg/TestInvertedFloatComparison' { 0 8 1 8 2 8 + 3 8 + 4 8 a 8 } @@ -87,6 +91,8 @@ class 'pkg/TestInvertedFloatComparison' { 1 12 2 12 3 12 + 4 12 + 5 12 b 12 } @@ -94,6 +100,8 @@ class 'pkg/TestInvertedFloatComparison' { 0 16 1 16 2 16 + 3 16 + 4 16 a 16 } @@ -102,6 +110,8 @@ class 'pkg/TestInvertedFloatComparison' { 1 20 2 20 3 20 + 4 20 + 5 20 b 20 } @@ -109,6 +119,8 @@ class 'pkg/TestInvertedFloatComparison' { 0 24 1 24 2 24 + 3 24 + 4 24 a 24 } @@ -117,6 +129,8 @@ class 'pkg/TestInvertedFloatComparison' { 1 28 2 28 3 28 + 4 28 + 5 28 b 28 } @@ -124,6 +138,8 @@ class 'pkg/TestInvertedFloatComparison' { 0 32 1 32 2 32 + 3 32 + 4 32 a 32 } @@ -132,6 +148,8 @@ class 'pkg/TestInvertedFloatComparison' { 1 36 2 36 3 36 + 4 36 + 5 36 b 36 } @@ -139,6 +157,8 @@ class 'pkg/TestInvertedFloatComparison' { 0 40 1 40 2 40 + 3 40 + 4 40 a 40 } @@ -147,6 +167,8 @@ class 'pkg/TestInvertedFloatComparison' { 1 44 2 44 3 44 + 4 44 + 5 44 b 44 } @@ -154,6 +176,8 @@ class 'pkg/TestInvertedFloatComparison' { 0 48 1 48 2 48 + 3 48 + 4 48 a 48 } @@ -162,6 +186,8 @@ class 'pkg/TestInvertedFloatComparison' { 1 52 2 52 3 52 + 4 52 + 5 52 b 52 } @@ -169,6 +195,8 @@ class 'pkg/TestInvertedFloatComparison' { 0 56 1 56 2 56 + 3 56 + 4 56 a 56 } @@ -177,6 +205,8 @@ class 'pkg/TestInvertedFloatComparison' { 1 60 2 60 3 60 + 4 60 + 5 60 b 60 } @@ -184,6 +214,8 @@ class 'pkg/TestInvertedFloatComparison' { 0 64 1 64 2 64 + 3 64 + 4 64 a 64 } } diff --git a/testData/results/pkg/TestIrreducible.dec b/testData/results/pkg/TestIrreducible.dec index 32585643b4..e95957de17 100644 --- a/testData/results/pkg/TestIrreducible.dec +++ b/testData/results/pkg/TestIrreducible.dec @@ -31,6 +31,8 @@ class 'pkg/TestIrreducible' { 2 7 3 7 4 7 + 5 7 + 6 7 a 10 b 10 c 10 @@ -43,24 +45,32 @@ class 'pkg/TestIrreducible' { 13 11 14 11 15 11 + 16 11 + 17 11 1b 12 1c 12 1d 12 1e 12 1f 12 20 12 + 21 12 + 22 12 23 20 24 20 25 20 26 20 27 20 28 20 + 29 20 + 2a 20 2b 14 2c 14 2d 14 2e 14 2f 14 30 14 + 31 14 + 32 14 33 19 34 19 35 19 diff --git a/testData/results/pkg/TestIterationOverGenericsWithoutLvt.dec b/testData/results/pkg/TestIterationOverGenericsWithoutLvt.dec index 4b905f9082..583784a070 100644 --- a/testData/results/pkg/TestIterationOverGenericsWithoutLvt.dec +++ b/testData/results/pkg/TestIterationOverGenericsWithoutLvt.dec @@ -75,6 +75,8 @@ class 'pkg/TestIterationOverGenericsWithoutLvt' { 21 10 22 10 23 10 + 24 10 + 25 10 26 11 27 11 28 11 @@ -186,6 +188,8 @@ class 'pkg/TestIterationOverGenericsWithoutLvt' { 1c 35 1d 36 1e 36 + 1f 36 + 20 36 21 37 22 37 23 37 @@ -202,8 +206,11 @@ class 'pkg/TestIterationOverGenericsWithoutLvt' { 31 40 32 40 33 40 + 34 40 + 35 40 36 40 3a 40 + 3b 40 3c 40 40 44 41 44 diff --git a/testData/results/pkg/TestItrLoop.dec b/testData/results/pkg/TestItrLoop.dec index b60de97483..4e6b1a816b 100644 --- a/testData/results/pkg/TestItrLoop.dec +++ b/testData/results/pkg/TestItrLoop.dec @@ -148,4 +148,4 @@ Not mapped: 14 20 26 -32 \ No newline at end of file +32 diff --git a/testData/results/pkg/TestKotlinConstructorKt.dec b/testData/results/pkg/TestKotlinConstructorKt.dec index f52df664a1..dca2b8ebf4 100644 --- a/testData/results/pkg/TestKotlinConstructorKt.dec +++ b/testData/results/pkg/TestKotlinConstructorKt.dec @@ -92,6 +92,8 @@ class 'pkg/TestKotlinConstructorKt' { 4b 26 4c 26 4e 26 + 4f 26 + 50 26 56 27 57 27 5b 27 diff --git a/testData/results/pkg/TestKotlinEnumWhen.dec b/testData/results/pkg/TestKotlinEnumWhen.dec index 297fd24016..06dd019885 100644 --- a/testData/results/pkg/TestKotlinEnumWhen.dec +++ b/testData/results/pkg/TestKotlinEnumWhen.dec @@ -116,6 +116,32 @@ class 'pkg/TestKotlinEnumWhen' { 0 19 8 19 9 19 + a 19 + b 19 + c 19 + d 19 + e 19 + f 19 + 10 19 + 11 19 + 12 19 + 13 19 + 14 19 + 15 19 + 16 19 + 17 19 + 18 19 + 19 19 + 1a 19 + 1b 19 + 1c 19 + 1d 19 + 1e 19 + 1f 19 + 20 19 + 21 19 + 22 19 + 23 19 24 21 25 21 26 21 @@ -140,6 +166,8 @@ class 'pkg/TestKotlinEnumWhen' { 3f 27 40 27 42 27 + 43 27 + 44 27 45 29 } @@ -147,6 +175,32 @@ class 'pkg/TestKotlinEnumWhen' { 0 32 8 32 9 32 + a 32 + b 32 + c 32 + d 32 + e 32 + f 32 + 10 32 + 11 32 + 12 32 + 13 32 + 14 32 + 15 32 + 16 32 + 17 32 + 18 32 + 19 32 + 1a 32 + 1b 32 + 1c 32 + 1d 32 + 1e 32 + 1f 32 + 20 32 + 21 32 + 22 32 + 23 32 24 33 25 33 29 34 @@ -173,6 +227,33 @@ class 'pkg/TestKotlinEnumWhen' { 7 43 b 43 c 43 + d 43 + e 43 + f 43 + 10 43 + 11 43 + 12 43 + 13 43 + 14 43 + 15 43 + 16 43 + 17 43 + 18 43 + 19 43 + 1a 43 + 1b 43 + 1c 43 + 1d 43 + 1e 43 + 1f 43 + 20 43 + 21 43 + 22 43 + 23 43 + 24 43 + 25 43 + 26 43 + 27 43 28 45 29 45 2a 45 @@ -209,6 +290,8 @@ class 'pkg/TestKotlinEnumWhen' { 4f 51 50 51 52 51 + 53 51 + 54 51 55 53 } @@ -216,6 +299,32 @@ class 'pkg/TestKotlinEnumWhen' { 0 56 8 56 9 56 + a 56 + b 56 + c 56 + d 56 + e 56 + f 56 + 10 56 + 11 56 + 12 56 + 13 56 + 14 56 + 15 56 + 16 56 + 17 56 + 18 56 + 19 56 + 1a 56 + 1b 56 + 1c 56 + 1d 56 + 1e 56 + 1f 56 + 20 56 + 21 56 + 22 56 + 23 56 24 58 25 58 26 58 @@ -240,9 +349,36 @@ class 'pkg/TestKotlinEnumWhen' { 3f 64 40 64 42 64 + 43 64 + 44 64 45 67 4d 67 4e 67 + 4f 67 + 50 67 + 51 67 + 52 67 + 53 67 + 54 67 + 55 67 + 56 67 + 57 67 + 58 67 + 59 67 + 5a 67 + 5b 67 + 5c 67 + 5d 67 + 5e 67 + 5f 67 + 60 67 + 61 67 + 62 67 + 63 67 + 64 67 + 65 67 + 66 67 + 67 67 68 69 69 69 6a 69 @@ -267,6 +403,8 @@ class 'pkg/TestKotlinEnumWhen' { 83 75 84 75 86 75 + 87 75 + 88 75 89 77 } @@ -278,6 +416,33 @@ class 'pkg/TestKotlinEnumWhen' { 7 81 b 81 c 81 + d 81 + e 81 + f 81 + 10 81 + 11 81 + 12 81 + 13 81 + 14 81 + 15 81 + 16 81 + 17 81 + 18 81 + 19 81 + 1a 81 + 1b 81 + 1c 81 + 1d 81 + 1e 81 + 1f 81 + 20 81 + 21 81 + 22 81 + 23 81 + 24 81 + 25 81 + 26 81 + 27 81 28 83 29 83 2a 83 @@ -314,9 +479,36 @@ class 'pkg/TestKotlinEnumWhen' { 4f 89 50 89 52 89 + 53 89 + 54 89 55 92 5d 92 5e 92 + 5f 92 + 60 92 + 61 92 + 62 92 + 63 92 + 64 92 + 65 92 + 66 92 + 67 92 + 68 92 + 69 92 + 6a 92 + 6b 92 + 6c 92 + 6d 92 + 6e 92 + 6f 92 + 70 92 + 71 92 + 72 92 + 73 92 + 74 92 + 75 92 + 76 92 + 77 92 78 94 79 94 7a 94 @@ -341,6 +533,8 @@ class 'pkg/TestKotlinEnumWhen' { 93 100 94 100 96 100 + 97 100 + 98 100 99 102 } diff --git a/testData/results/pkg/TestLabeledBreaks.dec b/testData/results/pkg/TestLabeledBreaks.dec index ebbe8b89c3..e4db8290f0 100644 --- a/testData/results/pkg/TestLabeledBreaks.dec +++ b/testData/results/pkg/TestLabeledBreaks.dec @@ -63,12 +63,16 @@ class 'pkg/TestLabeledBreaks' { 8 5 9 5 a 5 + b 5 + c 5 10 6 11 6 12 6 13 6 14 6 15 6 + 16 6 + 17 6 18 8 } @@ -78,6 +82,8 @@ class 'pkg/TestLabeledBreaks' { 2 14 3 14 4 14 + 5 14 + 6 14 7 15 8 15 9 15 @@ -89,9 +95,13 @@ class 'pkg/TestLabeledBreaks' { f 16 10 16 11 16 + 12 16 + 13 16 17 20 18 20 19 20 + 1a 20 + 1b 20 1f 21 20 21 21 21 @@ -110,6 +120,8 @@ class 'pkg/TestLabeledBreaks' { 30 27 31 27 32 27 + 33 27 + 34 27 35 31 36 31 37 31 @@ -127,6 +139,8 @@ class 'pkg/TestLabeledBreaks' { 2 35 3 35 4 35 + 5 35 + 6 35 7 36 8 36 9 36 @@ -138,15 +152,21 @@ class 'pkg/TestLabeledBreaks' { f 37 10 37 11 37 + 12 37 + 13 37 17 38 18 38 19 38 + 1a 38 + 1b 38 1f 42 20 42 21 42 22 42 23 42 24 42 + 25 42 + 26 42 27 45 28 45 29 45 diff --git a/testData/results/pkg/TestLambdaGenericCall.dec b/testData/results/pkg/TestLambdaGenericCall.dec index a0ca6b0985..cbf16e2c0e 100644 --- a/testData/results/pkg/TestLambdaGenericCall.dec +++ b/testData/results/pkg/TestLambdaGenericCall.dec @@ -144,4 +144,4 @@ Lines mapping: 26 <-> 22 28 <-> 23 29 <-> 24 -30 <-> 25 \ No newline at end of file +30 <-> 25 diff --git a/testData/results/pkg/TestLambdaLocalCapture.dec b/testData/results/pkg/TestLambdaLocalCapture.dec index 1f45cba447..1cbdb0db48 100644 --- a/testData/results/pkg/TestLambdaLocalCapture.dec +++ b/testData/results/pkg/TestLambdaLocalCapture.dec @@ -38,6 +38,8 @@ class 'pkg/TestLambdaLocalCapture' { a 6 b 6 c 6 + d 6 + e 6 f 7 10 7 11 7 @@ -46,6 +48,8 @@ class 'pkg/TestLambdaLocalCapture' { 14 7 15 7 16 7 + 17 7 + 18 7 19 8 1a 8 1b 8 diff --git a/testData/results/pkg/TestListEquals.dec b/testData/results/pkg/TestListEquals.dec index 3ab984dcbd..1db590f6f2 100644 --- a/testData/results/pkg/TestListEquals.dec +++ b/testData/results/pkg/TestListEquals.dec @@ -19,6 +19,8 @@ class 'pkg/TestListEquals' { 2 7 3 7 4 7 + 5 7 + 6 7 c 7 } } diff --git a/testData/results/pkg/TestLocalClassesSwitch.dec b/testData/results/pkg/TestLocalClassesSwitch.dec index 4af2914873..6b5b4b35e9 100644 --- a/testData/results/pkg/TestLocalClassesSwitch.dec +++ b/testData/results/pkg/TestLocalClassesSwitch.dec @@ -89,9 +89,29 @@ class 'pkg/TestLocalClassesSwitch' { method 'test (I)V' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 1c 12 1d 13 1e 13 + 1f 13 + 20 13 29 22 2a 23 2b 23 @@ -103,6 +123,32 @@ class 'pkg/TestLocalClassesSwitch' { method 'test1 (I)V' { 0 29 1 29 + 2 29 + 3 29 + 4 29 + 5 29 + 6 29 + 7 29 + 8 29 + 9 29 + a 29 + b 29 + c 29 + d 29 + e 29 + f 29 + 10 29 + 11 29 + 12 29 + 13 29 + 14 29 + 15 29 + 16 29 + 17 29 + 18 29 + 19 29 + 1a 29 + 1b 29 24 37 25 38 26 38 @@ -125,6 +171,16 @@ class 'pkg/TestLocalClassesSwitch' { method 'test2 (I)V' { 0 64 1 64 + 2 64 + 3 64 + 4 64 + 5 64 + 6 64 + 7 64 + 8 64 + 9 64 + a 64 + b 64 14 72 15 73 16 73 diff --git a/testData/results/pkg/TestLocalEnum.dec b/testData/results/pkg/TestLocalEnum.dec index 5147e2f6ff..5a256b77df 100644 --- a/testData/results/pkg/TestLocalEnum.dec +++ b/testData/results/pkg/TestLocalEnum.dec @@ -15,10 +15,14 @@ class 'pkg/TestLocalEnum' { method 'test (I)V' { 0 9 1 9 + 2 9 + 3 9 4 9 5 9 6 9 a 9 + b 9 + c 9 d 9 e 10 } diff --git a/testData/results/pkg/TestLocalScopeClash.dec b/testData/results/pkg/TestLocalScopeClash.dec index fab6d546fe..4cb129d05d 100644 --- a/testData/results/pkg/TestLocalScopeClash.dec +++ b/testData/results/pkg/TestLocalScopeClash.dec @@ -69,8 +69,12 @@ class 'pkg/TestLocalScopeClash' { 2e 17 30 18 31 18 + 32 18 + 33 18 34 18 35 18 + 36 18 + 37 18 3e 18 3f 19 40 19 diff --git a/testData/results/pkg/TestLocalScopes.dec b/testData/results/pkg/TestLocalScopes.dec index 8880348ca5..090135fbff 100644 --- a/testData/results/pkg/TestLocalScopes.dec +++ b/testData/results/pkg/TestLocalScopes.dec @@ -26,6 +26,8 @@ class 'pkg/TestLocalScopes' { 5 6 6 6 7 6 + 8 6 + 9 6 b 7 d 7 e 6 @@ -39,6 +41,8 @@ class 'pkg/TestLocalScopes' { 19 12 1a 12 1b 12 + 1c 12 + 1d 12 1f 13 21 13 22 12 diff --git a/testData/results/pkg/TestLocalVariableMerge.dec b/testData/results/pkg/TestLocalVariableMerge.dec index 44ebb5c847..f87222add7 100644 --- a/testData/results/pkg/TestLocalVariableMerge.dec +++ b/testData/results/pkg/TestLocalVariableMerge.dec @@ -38,6 +38,8 @@ class 'pkg/TestLocalVariableMerge' { 2 8 3 8 4 8 + 5 8 + 6 8 7 9 8 9 9 9 @@ -53,6 +55,8 @@ class 'pkg/TestLocalVariableMerge' { 13 12 14 12 15 12 + 16 12 + 17 12 18 13 19 13 1a 13 @@ -74,35 +78,47 @@ class 'pkg/TestLocalVariableMerge' { 2a 18 2b 18 2c 18 + 2d 18 + 2e 18 2f 19 30 19 31 19 32 19 33 19 34 19 + 35 19 + 36 19 37 22 38 22 39 22 3a 22 3b 22 + 3c 22 + 3d 22 3e 23 3f 23 40 23 41 23 42 23 43 23 + 44 23 + 45 23 46 26 47 26 48 26 49 26 4a 26 4b 26 + 4c 26 + 4d 26 4e 27 4f 27 50 27 51 27 52 27 53 27 + 54 27 + 55 27 56 30 } } diff --git a/testData/results/pkg/TestLocalVariableMergeSwitch.dec b/testData/results/pkg/TestLocalVariableMergeSwitch.dec index 5ca6fb89fb..1c68ae8e74 100644 --- a/testData/results/pkg/TestLocalVariableMergeSwitch.dec +++ b/testData/results/pkg/TestLocalVariableMergeSwitch.dec @@ -23,6 +23,8 @@ class 'pkg/TestLocalVariableMergeSwitch' { method 'test (Ljava/lang/String;I)V' { 0 4 1 4 + 2 4 + 3 4 4 5 5 5 6 5 @@ -30,6 +32,31 @@ class 'pkg/TestLocalVariableMergeSwitch' { 8 6 9 7 a 7 + b 7 + c 7 + d 7 + e 7 + f 7 + 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 + 20 7 + 21 7 + 22 7 + 23 7 24 9 25 9 26 9 diff --git a/testData/results/pkg/TestLocalsNames.dec b/testData/results/pkg/TestLocalsNames.dec index 1a30a11df3..6752b74b14 100644 --- a/testData/results/pkg/TestLocalsNames.dec +++ b/testData/results/pkg/TestLocalsNames.dec @@ -27,6 +27,8 @@ class 'pkg/TestLocalsNames' { 2 6 3 6 4 6 + 5 6 + 6 6 7 7 8 7 9 7 @@ -111,6 +113,8 @@ class 'pkg/TestLocalsNames' { b7 17 b8 17 b9 17 + ba 17 + bb 17 bc 19 } } diff --git a/testData/results/pkg/TestLoopBreak.dec b/testData/results/pkg/TestLoopBreak.dec index db7320bf28..d820dcfefa 100644 --- a/testData/results/pkg/TestLoopBreak.dec +++ b/testData/results/pkg/TestLoopBreak.dec @@ -18,6 +18,8 @@ class 'pkg/TestLoopBreak' { 1 4 2 4 3 4 + 4 4 + 5 4 6 5 7 5 8 5 @@ -25,6 +27,8 @@ class 'pkg/TestLoopBreak' { a 5 b 5 c 5 + d 5 + e 5 12 6 13 6 14 6 diff --git a/testData/results/pkg/TestLoopBreak2.dec b/testData/results/pkg/TestLoopBreak2.dec index 7343e98f99..659ffa1f28 100644 --- a/testData/results/pkg/TestLoopBreak2.dec +++ b/testData/results/pkg/TestLoopBreak2.dec @@ -19,6 +19,8 @@ class 'pkg/TestLoopBreak2' { 1 4 2 4 3 4 + 4 4 + 5 4 6 5 7 5 8 5 @@ -26,6 +28,8 @@ class 'pkg/TestLoopBreak2' { a 5 b 5 c 5 + d 5 + e 5 12 6 13 6 14 6 diff --git a/testData/results/pkg/TestLoopBreak3.dec b/testData/results/pkg/TestLoopBreak3.dec index ae286241d8..5a41f2dbc2 100644 --- a/testData/results/pkg/TestLoopBreak3.dec +++ b/testData/results/pkg/TestLoopBreak3.dec @@ -29,6 +29,8 @@ class 'pkg/TestLoopBreak3' { 2 4 3 4 4 4 + 5 4 + 6 4 7 5 8 5 9 5 @@ -43,10 +45,14 @@ class 'pkg/TestLoopBreak3' { 12 7 13 7 14 7 + 15 7 + 16 7 17 8 18 8 19 8 1a 8 + 1b 8 + 1c 8 1d 9 1e 9 1f 9 @@ -54,6 +60,8 @@ class 'pkg/TestLoopBreak3' { 21 9 22 9 23 9 + 24 9 + 25 9 26 10 27 10 28 10 @@ -63,6 +71,8 @@ class 'pkg/TestLoopBreak3' { 2c 10 2d 11 2e 11 + 2f 11 + 30 11 31 15 32 15 33 15 diff --git a/testData/results/pkg/TestLoopBreak4.dec b/testData/results/pkg/TestLoopBreak4.dec index c41954fcb2..ebcce10801 100644 --- a/testData/results/pkg/TestLoopBreak4.dec +++ b/testData/results/pkg/TestLoopBreak4.dec @@ -44,6 +44,8 @@ class 'pkg/TestLoopBreak4' { 4 4 5 4 6 4 + 7 4 + 8 4 9 5 a 5 b 5 @@ -51,6 +53,8 @@ class 'pkg/TestLoopBreak4' { d 5 e 5 f 5 + 10 5 + 11 5 12 6 13 6 14 6 @@ -67,10 +71,14 @@ class 'pkg/TestLoopBreak4' { 1f 8 20 8 21 8 + 22 8 + 23 8 24 9 25 9 26 9 27 9 + 28 9 + 29 9 2a 10 2b 10 2c 10 @@ -78,6 +86,8 @@ class 'pkg/TestLoopBreak4' { 2e 10 2f 10 30 10 + 31 10 + 32 10 33 11 34 11 35 11 @@ -87,6 +97,8 @@ class 'pkg/TestLoopBreak4' { 39 11 3a 12 3b 12 + 3c 12 + 3d 12 3e 16 3f 16 40 16 @@ -99,6 +111,8 @@ class 'pkg/TestLoopBreak4' { 47 17 48 17 49 17 + 4a 17 + 4b 17 4c 18 4d 18 4e 18 @@ -107,6 +121,8 @@ class 'pkg/TestLoopBreak4' { 51 18 52 18 53 18 + 54 18 + 55 18 56 19 57 19 58 19 @@ -119,6 +135,8 @@ class 'pkg/TestLoopBreak4' { 5f 20 60 20 61 20 + 62 20 + 63 20 67 24 68 24 69 24 diff --git a/testData/results/pkg/TestLoopBreakException.dec b/testData/results/pkg/TestLoopBreakException.dec index 067e4436e0..f59e7b1a1a 100644 --- a/testData/results/pkg/TestLoopBreakException.dec +++ b/testData/results/pkg/TestLoopBreakException.dec @@ -23,6 +23,8 @@ class 'pkg/TestLoopBreakException' { 1 4 2 4 3 4 + 4 4 + 5 4 6 5 7 5 8 5 @@ -30,6 +32,8 @@ class 'pkg/TestLoopBreakException' { a 5 b 5 c 5 + d 5 + e 5 12 6 13 6 14 6 @@ -42,6 +46,8 @@ class 'pkg/TestLoopBreakException' { 1b 11 1c 11 1d 11 + 1e 11 + 1f 11 20 12 21 12 29 14 diff --git a/testData/results/pkg/TestLoopFinally.dec b/testData/results/pkg/TestLoopFinally.dec index 6c3ee508f4..716ce5f13f 100644 --- a/testData/results/pkg/TestLoopFinally.dec +++ b/testData/results/pkg/TestLoopFinally.dec @@ -185,12 +185,18 @@ class 'pkg/TestLoopFinally' { 3 4 4 4 5 4 + 6 4 + 7 4 8 6 9 6 a 6 b 6 c 6 + d 6 + e 6 27 4 + 28 4 + 29 4 2b 8 2c 8 2d 8 @@ -202,12 +208,16 @@ class 'pkg/TestLoopFinally' { 33 9 34 9 35 9 + 36 9 + 37 9 3b 13 3c 13 3d 13 3e 13 3f 13 40 13 + 41 13 + 42 13 4b 17 4c 17 4d 17 @@ -226,11 +236,15 @@ class 'pkg/TestLoopFinally' { 3 21 4 21 5 21 + 6 21 + 7 21 8 23 9 23 a 23 b 23 c 23 + d 23 + e 23 43 25 44 25 45 25 @@ -242,6 +256,8 @@ class 'pkg/TestLoopFinally' { 4b 26 4c 26 4d 26 + 4e 26 + 4f 26 50 35 51 35 52 35 @@ -254,6 +270,8 @@ class 'pkg/TestLoopFinally' { 5b 27 5c 27 5d 27 + 5e 27 + 5f 27 60 28 61 28 62 28 @@ -269,6 +287,8 @@ class 'pkg/TestLoopFinally' { 6e 32 6f 32 70 32 + 71 32 + 72 32 75 21 76 21 77 21 @@ -290,11 +310,15 @@ class 'pkg/TestLoopFinally' { 3 44 4 44 5 44 + 6 44 + 7 44 8 46 9 46 a 46 b 46 c 46 + d 46 + e 46 20 48 21 48 22 48 @@ -306,6 +330,8 @@ class 'pkg/TestLoopFinally' { 28 49 29 49 2a 49 + 2b 49 + 2c 49 30 44 31 44 32 44 @@ -324,6 +350,8 @@ class 'pkg/TestLoopFinally' { 0 62 1 62 2 62 + 3 62 + 4 62 5 63 10 63 11 66 @@ -338,6 +366,8 @@ class 'pkg/TestLoopFinally' { 1a 67 1b 67 1c 67 + 1d 67 + 1e 67 1f 68 2a 68 2b 71 @@ -352,15 +382,21 @@ class 'pkg/TestLoopFinally' { 34 72 35 72 36 72 + 37 72 + 38 72 39 73 44 73 4e 76 4f 76 50 76 + 51 76 + 52 76 58 80 59 80 5a 80 5b 80 + 5c 80 + 5d 80 5e 82 5f 82 60 82 @@ -377,15 +413,21 @@ class 'pkg/TestLoopFinally' { 1 89 2 89 3 89 + 4 89 + 5 89 6 90 11 90 1b 93 1c 93 1d 93 + 1e 93 + 1f 93 25 97 26 97 27 97 28 97 + 29 97 + 2a 97 2b 94 2c 94 } @@ -395,15 +437,21 @@ class 'pkg/TestLoopFinally' { 1 105 2 105 3 105 + 4 105 + 5 105 6 106 7 106 20 111 21 111 22 111 + 23 111 + 24 111 2b 115 2c 115 2d 115 2e 115 + 2f 115 + 30 115 31 112 32 112 33 108 @@ -425,6 +473,8 @@ class 'pkg/TestLoopFinally' { 9 128 a 128 b 128 + c 128 + d 128 16 129 17 130 26 136 @@ -433,6 +483,8 @@ class 'pkg/TestLoopFinally' { 29 136 2a 136 2b 136 + 2c 136 + 2d 136 } method 'testConditionalBreakInFinally ()V' { @@ -443,8 +495,15 @@ class 'pkg/TestLoopFinally' { 4 143 5 143 6 143 + 7 143 + 8 143 9 158 a 145 + b 145 + c 145 + d 145 + e 145 + f 145 1a 146 1b 147 1c 147 @@ -452,11 +511,15 @@ class 'pkg/TestLoopFinally' { 1e 147 1f 147 20 147 + 21 147 + 22 147 2e 149 2f 149 30 149 31 149 32 149 + 33 149 + 34 149 38 154 39 154 43 150 @@ -478,6 +541,8 @@ class 'pkg/TestLoopFinally' { 4 165 5 165 6 165 + 7 165 + 8 165 19 176 2f 167 32 170 @@ -491,6 +556,8 @@ class 'pkg/TestLoopFinally' { 3a 172 3b 172 3c 172 + 3d 172 + 3e 172 3f 173 40 173 41 173 diff --git a/testData/results/pkg/TestLoopMerging2.dec b/testData/results/pkg/TestLoopMerging2.dec index 9a34d7fe34..2b474cf449 100644 --- a/testData/results/pkg/TestLoopMerging2.dec +++ b/testData/results/pkg/TestLoopMerging2.dec @@ -40,6 +40,8 @@ class 'pkg/TestLoopMerging2' { a 7 b 7 c 7 + d 7 + e 7 f 8 10 8 12 8 @@ -53,6 +55,8 @@ class 'pkg/TestLoopMerging2' { 1d 11 1e 11 1f 11 + 20 11 + 21 11 22 12 23 12 24 12 @@ -76,6 +80,8 @@ class 'pkg/TestLoopMerging2' { 4 17 5 17 6 17 + 7 17 + 8 17 9 17 a 17 b 17 @@ -83,6 +89,8 @@ class 'pkg/TestLoopMerging2' { d 17 e 17 f 17 + 10 17 + 11 17 12 26 13 18 14 18 @@ -92,6 +100,8 @@ class 'pkg/TestLoopMerging2' { 18 20 19 20 1a 20 + 1b 20 + 1c 20 1d 21 1e 21 1f 21 @@ -121,4 +131,4 @@ Lines mapping: 24 <-> 22 26 <-> 25 Not mapped: -27 \ No newline at end of file +27 diff --git a/testData/results/pkg/TestLoopReturn.dec b/testData/results/pkg/TestLoopReturn.dec index 12b3d44623..892f2a4362 100644 --- a/testData/results/pkg/TestLoopReturn.dec +++ b/testData/results/pkg/TestLoopReturn.dec @@ -75,9 +75,13 @@ class 'pkg/TestLoopReturn' { 2 4 3 4 4 4 + 5 4 + 6 4 7 6 b 7 c 7 + d 7 + e 7 f 8 10 12 11 12 @@ -92,8 +96,12 @@ class 'pkg/TestLoopReturn' { method 'test1a (ZZ)V' { 0 16 1 16 + 2 16 + 3 16 4 17 5 17 + 6 17 + 7 17 8 18 9 22 a 22 @@ -108,8 +116,12 @@ class 'pkg/TestLoopReturn' { method 'test1b (ZZ)V' { 0 26 1 26 + 2 26 + 3 26 4 27 5 27 + 6 27 + 7 27 8 28 9 31 } @@ -117,6 +129,8 @@ class 'pkg/TestLoopReturn' { method 'test2 (Z)V' { 0 34 1 34 + 2 34 + 3 34 4 37 5 35 6 35 @@ -133,8 +147,12 @@ class 'pkg/TestLoopReturn' { 2 40 3 40 4 40 + 5 40 + 6 40 7 42 8 42 + 9 42 + a 42 b 45 c 43 d 43 @@ -151,8 +169,12 @@ class 'pkg/TestLoopReturn' { 2 48 3 48 4 48 + 5 48 + 6 48 7 50 8 50 + 9 50 + a 50 b 54 c 54 d 54 @@ -189,6 +211,8 @@ class 'pkg/TestLoopReturn' { f 61 10 61 11 61 + 12 61 + 13 61 17 66 18 66 19 66 diff --git a/testData/results/pkg/TestMixedCompoundAssignment.dec b/testData/results/pkg/TestMixedCompoundAssignment.dec index dc21681687..dd8639edd6 100644 --- a/testData/results/pkg/TestMixedCompoundAssignment.dec +++ b/testData/results/pkg/TestMixedCompoundAssignment.dec @@ -328,6 +328,8 @@ class 'pkg/TestMixedCompoundAssignment' { 4 58 5 58 6 58 + 7 58 + 8 58 9 59 a 59 b 59 @@ -351,6 +353,8 @@ class 'pkg/TestMixedCompoundAssignment' { 4 64 5 64 6 64 + 7 64 + 8 64 9 65 a 65 b 65 @@ -374,6 +378,8 @@ class 'pkg/TestMixedCompoundAssignment' { 4 70 5 70 6 70 + 7 70 + 8 70 9 71 a 71 b 71 @@ -395,6 +401,8 @@ class 'pkg/TestMixedCompoundAssignment' { 5 76 6 76 7 76 + 8 76 + 9 76 a 77 b 77 c 77 diff --git a/testData/results/pkg/TestMultiBoolean.dec b/testData/results/pkg/TestMultiBoolean.dec index 884dc0801c..4ceeda5b41 100644 --- a/testData/results/pkg/TestMultiBoolean.dec +++ b/testData/results/pkg/TestMultiBoolean.dec @@ -24,48 +24,80 @@ class 'pkg/TestMultiBoolean' { method 'test (Z)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 + 6 4 + 7 4 8 5 9 5 a 5 b 5 c 5 + d 5 + e 5 f 8 10 8 + 11 8 + 12 8 13 8 14 8 + 15 8 + 16 8 17 9 18 9 19 9 1a 9 1b 9 + 1c 9 + 1d 9 1e 12 1f 12 + 20 12 + 21 12 22 12 23 12 + 24 12 + 25 12 26 12 27 12 + 28 12 + 29 12 2a 13 2b 13 2c 13 2d 13 2e 13 + 2f 13 + 30 13 31 16 32 16 + 33 16 + 34 16 35 16 36 16 + 37 16 + 38 16 39 16 3a 16 + 3b 16 + 3c 16 3d 16 3e 16 + 3f 16 + 40 16 41 16 42 16 + 43 16 + 44 16 45 17 46 17 47 17 48 17 49 17 + 4a 17 + 4b 17 4c 19 } } diff --git a/testData/results/pkg/TestMultipleStaticBlocks.dec b/testData/results/pkg/TestMultipleStaticBlocks.dec index c8fa547c75..34e9debb7d 100644 --- a/testData/results/pkg/TestMultipleStaticBlocks.dec +++ b/testData/results/pkg/TestMultipleStaticBlocks.dec @@ -31,8 +31,12 @@ class 'pkg/TestMultipleStaticBlocks' { a 7 b 7 c 7 + d 7 + e 7 f 8 10 8 + 11 8 + 12 8 13 11 14 11 15 11 @@ -46,8 +50,12 @@ class 'pkg/TestMultipleStaticBlocks' { 1d 12 1e 12 1f 12 + 20 12 + 21 12 22 13 23 13 + 24 13 + 25 13 26 15 } } diff --git a/testData/results/pkg/TestNamedSuspendFun2Kt.dec b/testData/results/pkg/TestNamedSuspendFun2Kt.dec index 98b5a00e8e..401195f1c2 100644 --- a/testData/results/pkg/TestNamedSuspendFun2Kt.dec +++ b/testData/results/pkg/TestNamedSuspendFun2Kt.dec @@ -107,7 +107,7 @@ public final class TestNamedSuspendFun2Kt { break; case 2: ResultKt.throwOnFailure($result); - return Boxing.boxInt(1);// 2 7 8 9 11 + return Boxing.boxInt(1);// 11 case 3: ResultKt.throwOnFailure($result); break; @@ -151,11 +151,11 @@ public final class TestNamedSuspendFun2Kt { } } - Throwable x = var10000; - $continuation.L$0 = x; + Throwable x = var10000;// 7 + $continuation.L$0 = x;// 8 $continuation.label = 4; if (bar($continuation) == var4) { - return var4; + return var4;// 2 } throw x; @@ -210,6 +210,8 @@ class 'pkg/TestNamedSuspendFun2Kt' { 2 60 3 60 4 60 + 5 60 + 6 60 7 61 8 61 9 61 @@ -223,6 +225,8 @@ class 'pkg/TestNamedSuspendFun2Kt' { 11 62 12 62 13 62 + 14 62 + 15 62 16 63 1b 63 1c 63 @@ -247,8 +251,42 @@ class 'pkg/TestNamedSuspendFun2Kt' { 39 77 3a 77 3b 77 + 3c 77 + 3d 77 + 3e 77 + 3f 77 + 40 77 + 41 77 + 42 77 + 43 77 + 44 77 + 45 77 + 46 77 + 47 77 + 48 77 + 49 77 + 4a 77 + 4b 77 + 4c 77 + 4d 77 + 4e 77 + 4f 77 + 50 77 + 51 77 + 52 77 + 53 77 + 54 77 + 55 77 + 56 77 + 57 77 + 58 77 + 59 77 + 5a 77 + 5b 77 5c 79 5d 79 + 5e 79 + 5f 79 62 124 63 123 64 123 @@ -256,9 +294,13 @@ class 'pkg/TestNamedSuspendFun2Kt' { 66 123 67 123 68 124 + 69 124 + 6a 124 6c 131 6d 131 6e 131 + 6f 131 + 70 131 71 132 72 132 73 132 @@ -276,6 +318,8 @@ class 'pkg/TestNamedSuspendFun2Kt' { 80 92 81 93 82 93 + 83 93 + 84 93 85 164 86 163 87 163 @@ -288,6 +332,8 @@ class 'pkg/TestNamedSuspendFun2Kt' { 8f 164 90 164 91 164 + 92 164 + 93 164 94 164 95 164 97 108 @@ -295,8 +341,6 @@ class 'pkg/TestNamedSuspendFun2Kt' { 99 108 9a 108 9d 109 - 9e 109 - 9f 109 a0 103 a1 102 a2 102 @@ -306,68 +350,58 @@ class 'pkg/TestNamedSuspendFun2Kt' { a6 103 a7 103 a8 103 - a9 109 aa 103 ab 103 ac 103 - ad 109 - ae 109 + ad 103 + ae 103 af 104 b0 104 b1 104 - b2 109 - b3 109 - b4 109 - b5 109 - b6 109 - b7 109 - b8 109 - b9 109 - ba 109 - bb 109 - bc 109 - bd 109 - be 109 - bf 109 - c0 109 - c1 109 - c2 109 - c3 109 - c4 109 - c5 109 - c6 109 - c7 109 - c8 109 - c9 109 - ca 109 - cb 109 - cc 109 - cd 109 - ce 109 - cf 109 - d0 109 - d1 109 - d2 109 - d3 109 - d4 109 - d5 109 - d6 109 - d7 109 - d8 109 - d9 109 - da 109 - db 109 - dc 109 - dd 109 - de 109 - df 109 - e0 109 - e1 109 - e2 109 + b2 111 + b3 111 + b4 111 + b5 111 + bb 153 + bc 156 + bd 154 + be 154 + bf 154 + c0 154 + c1 154 + c2 155 + c3 155 + c4 155 + c5 155 + c6 155 + c7 156 + c8 156 + c9 156 + cb 156 + cc 156 + cd 156 + ce 156 + cf 156 + d0 157 + d1 157 + d2 157 + d3 114 + d4 114 + d5 114 + d6 114 + d7 114 + d8 114 + d9 114 + da 114 + db 115 + dc 115 + dd 115 + de 115 + e1 116 + e2 116 e3 109 e4 109 e5 109 - e6 109 ec 118 ed 118 f1 118 @@ -383,14 +417,14 @@ class 'pkg/TestNamedSuspendFun2Kt' { } Lines mapping: -2 <-> 110 +2 <-> 158 4 <-> 125 5 <-> 93 6 <-> 94 -7 <-> 110 -8 <-> 110 -9 <-> 110 +7 <-> 154 +8 <-> 155 11 <-> 110 14 <-> 170 Not mapped: 3 +9 diff --git a/testData/results/pkg/TestNestedFor.dec b/testData/results/pkg/TestNestedFor.dec index a7b0999eb6..e678887496 100644 --- a/testData/results/pkg/TestNestedFor.dec +++ b/testData/results/pkg/TestNestedFor.dec @@ -27,6 +27,8 @@ class 'pkg/TestNestedFor' { 5 6 6 6 7 6 + 8 6 + 9 6 a 7 b 7 c 7 @@ -40,6 +42,8 @@ class 'pkg/TestNestedFor' { 15 7 16 7 17 7 + 18 7 + 19 7 1a 8 1b 8 1c 8 diff --git a/testData/results/pkg/TestNestedLambdas.dec b/testData/results/pkg/TestNestedLambdas.dec index 13db63c0e3..61d41a754a 100644 --- a/testData/results/pkg/TestNestedLambdas.dec +++ b/testData/results/pkg/TestNestedLambdas.dec @@ -41,6 +41,8 @@ class 'pkg/TestNestedLambdas' { method 'lambda$test$2 (I)I' { 0 5 1 5 + 2 5 + 3 5 a 6 b 6 c 6 @@ -51,6 +53,8 @@ class 'pkg/TestNestedLambdas' { method 'lambda$null$1 (II)I' { 0 6 1 6 + 2 6 + 3 6 b 6 c 6 d 6 diff --git a/testData/results/pkg/TestNestedLoops.dec b/testData/results/pkg/TestNestedLoops.dec index 47f7fc4a7d..eab27f8882 100644 --- a/testData/results/pkg/TestNestedLoops.dec +++ b/testData/results/pkg/TestNestedLoops.dec @@ -53,6 +53,8 @@ class 'pkg/TestNestedLoops' { b 11 c 11 d 11 + e 11 + f 11 10 14 11 14 12 14 @@ -79,6 +81,8 @@ class 'pkg/TestNestedLoops' { 30 15 31 15 32 15 + 33 15 + 34 15 35 17 36 17 37 17 @@ -94,6 +98,8 @@ class 'pkg/TestNestedLoops' { 42 18 43 18 44 18 + 45 18 + 46 18 47 15 48 15 49 15 @@ -110,6 +116,8 @@ class 'pkg/TestNestedLoops' { b 31 c 31 d 31 + e 31 + f 31 13 32 14 32 15 32 @@ -136,6 +144,8 @@ class 'pkg/TestNestedLoops' { 33 33 34 33 35 33 + 36 33 + 37 33 38 35 39 35 3a 35 @@ -151,6 +161,8 @@ class 'pkg/TestNestedLoops' { 45 36 46 36 47 36 + 48 36 + 49 36 4d 33 4e 33 4f 33 diff --git a/testData/results/pkg/TestNestedLoops2.dec b/testData/results/pkg/TestNestedLoops2.dec index adc8ebeebc..6daa9547a7 100644 --- a/testData/results/pkg/TestNestedLoops2.dec +++ b/testData/results/pkg/TestNestedLoops2.dec @@ -26,9 +26,13 @@ class 'pkg/TestNestedLoops2' { 3 5 4 5 5 5 + 6 5 + 7 5 8 8 9 8 a 8 + b 8 + c 8 e 9 f 9 10 9 diff --git a/testData/results/pkg/TestNestedTernaryAssign.dec b/testData/results/pkg/TestNestedTernaryAssign.dec index d4419a8853..80ec314fed 100644 --- a/testData/results/pkg/TestNestedTernaryAssign.dec +++ b/testData/results/pkg/TestNestedTernaryAssign.dec @@ -47,8 +47,12 @@ class 'pkg/TestNestedTernaryAssign' { method 'test (ZZZ)V' { 0 4 1 4 + 2 4 + 3 4 4 5 5 5 + 6 5 + 7 5 8 6 9 6 d 8 @@ -57,43 +61,62 @@ class 'pkg/TestNestedTernaryAssign' { 10 8 14 10 15 10 + 16 10 + 17 10 18 11 19 11 1d 13 1e 13 + 1f 13 + 20 13 23 15 } method 'test2 (ZZZ)V' { 0 18 1 18 + 2 18 + 3 18 4 19 5 19 + 6 19 + 7 19 8 19 9 19 d 19 e 19 12 21 13 21 + 14 21 + 15 21 16 21 17 21 1b 21 + 1c 21 1f 23 } method 'test3 (ZZII)V' { 0 26 1 26 + 2 26 + 3 26 4 26 5 26 6 26 + 7 26 + 8 26 9 26 d 26 + e 26 f 26 + 10 26 + 11 26 12 26 16 26 17 26 1b 26 + 1c 26 1d 26 1e 26 1f 27 @@ -110,14 +133,21 @@ class 'pkg/TestNestedTernaryAssign' { method 'test4 (ZII)V' { 0 31 1 31 + 2 31 + 3 31 4 31 5 31 6 31 + 7 31 + 8 31 c 31 d 31 e 31 + f 31 + 10 31 11 31 15 31 + 16 31 17 31 18 31 19 31 @@ -127,28 +157,42 @@ class 'pkg/TestNestedTernaryAssign' { method 'test5 (ZZII)V' { 0 35 1 35 + 2 35 + 3 35 4 35 5 35 6 35 7 35 + 8 35 + 9 35 d 35 e 35 f 35 10 35 + 11 35 + 12 35 13 35 17 35 + 18 35 19 35 1a 35 + 1b 35 + 1c 35 1d 35 1e 35 1f 35 20 35 + 21 35 + 22 35 26 35 27 35 28 35 29 35 + 2a 35 + 2b 35 2c 35 30 35 + 31 35 32 35 33 35 34 35 diff --git a/testData/results/pkg/TestNestedTernaryCondition.dec b/testData/results/pkg/TestNestedTernaryCondition.dec index f98929bc3d..874cdfe93e 100644 --- a/testData/results/pkg/TestNestedTernaryCondition.dec +++ b/testData/results/pkg/TestNestedTernaryCondition.dec @@ -14,14 +14,21 @@ class 'pkg/TestNestedTernaryCondition' { method 'test (ZII)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 c 4 d 4 e 4 + f 4 + 10 4 11 7 15 5 + 16 5 19 9 } } diff --git a/testData/results/pkg/TestNextGaussian.dec b/testData/results/pkg/TestNextGaussian.dec index 754c7098c1..011ddae33c 100644 --- a/testData/results/pkg/TestNextGaussian.dec +++ b/testData/results/pkg/TestNextGaussian.dec @@ -37,6 +37,8 @@ class 'pkg/TestNextGaussian' { 2 7 3 7 4 7 + 5 7 + 6 7 7 8 8 8 9 8 @@ -87,6 +89,8 @@ class 'pkg/TestNextGaussian' { 39 18 3a 18 3b 18 + 3c 18 + 3d 18 3e 20 3f 20 40 20 diff --git a/testData/results/pkg/TestNoUse.dec b/testData/results/pkg/TestNoUse.dec index 45900e268d..ede7355bb6 100644 --- a/testData/results/pkg/TestNoUse.dec +++ b/testData/results/pkg/TestNoUse.dec @@ -77,6 +77,8 @@ class 'pkg/TestNoUse' { 15 7 19 8 1a 8 + 1b 8 + 1c 8 1d 9 1e 9 1f 9 @@ -115,6 +117,8 @@ class 'pkg/TestNoUse' { 18 17 19 18 1a 18 + 1b 18 + 1c 18 1d 19 1e 19 1f 19 @@ -153,6 +157,8 @@ class 'pkg/TestNoUse' { 15 27 19 28 1a 28 + 1b 28 + 1c 28 1d 29 1e 29 1f 29 @@ -184,6 +190,8 @@ class 'pkg/TestNoUse' { f 37 12 38 13 38 + 14 38 + 15 38 17 39 18 39 19 39 @@ -223,6 +231,8 @@ class 'pkg/TestNoUse' { 18 51 19 52 1a 52 + 1b 52 + 1c 52 1d 53 1e 53 1f 53 diff --git a/testData/results/pkg/TestObject.dec b/testData/results/pkg/TestObject.dec index 2394b2e503..88966a6b17 100644 --- a/testData/results/pkg/TestObject.dec +++ b/testData/results/pkg/TestObject.dec @@ -113,11 +113,15 @@ class 'pkg/TestObject$' { 0 26 1 26 2 26 + 3 26 + 4 26 5 27 6 27 7 29 8 29 9 29 + a 29 + b 29 c 29 e 29 f 29 diff --git a/testData/results/pkg/TestObjectBitwise.dec b/testData/results/pkg/TestObjectBitwise.dec index 82ce7049c0..3b766e91d9 100644 --- a/testData/results/pkg/TestObjectBitwise.dec +++ b/testData/results/pkg/TestObjectBitwise.dec @@ -84,6 +84,8 @@ class 'pkg/TestObjectBitwise' { d 6 e 6 f 6 + 10 6 + 11 6 17 6 } @@ -104,6 +106,8 @@ class 'pkg/TestObjectBitwise' { d 10 e 10 f 10 + 10 10 + 11 10 17 10 } @@ -124,6 +128,8 @@ class 'pkg/TestObjectBitwise' { d 14 e 14 f 14 + 10 14 + 11 14 17 14 } @@ -144,6 +150,8 @@ class 'pkg/TestObjectBitwise' { d 18 e 18 f 18 + 10 18 + 11 18 17 18 } @@ -164,6 +172,8 @@ class 'pkg/TestObjectBitwise' { d 22 e 22 f 22 + 10 22 + 11 22 17 22 } @@ -184,6 +194,8 @@ class 'pkg/TestObjectBitwise' { d 26 e 26 f 26 + 10 26 + 11 26 17 26 } @@ -233,6 +245,8 @@ class 'pkg/TestObjectBitwise$Inner' { a 45 b 45 c 45 + d 45 + e 45 14 45 } @@ -252,6 +266,8 @@ class 'pkg/TestObjectBitwise$Inner' { c 50 d 50 e 50 + f 50 + 10 50 16 50 } @@ -274,6 +290,8 @@ class 'pkg/TestObjectBitwise$Inner' { 12 55 13 55 14 55 + 15 55 + 16 55 1c 55 } @@ -347,6 +365,8 @@ class 'pkg/TestObjectBitwise$Inner' { 42 63 43 63 44 63 + 45 63 + 46 63 4c 63 } } diff --git a/testData/results/pkg/TestObjectPhi.dec b/testData/results/pkg/TestObjectPhi.dec index 824bb21cf9..34516ca03b 100644 --- a/testData/results/pkg/TestObjectPhi.dec +++ b/testData/results/pkg/TestObjectPhi.dec @@ -20,6 +20,8 @@ class 'pkg/TestObjectPhi' { 2 4 3 5 4 5 + 5 5 + 6 5 7 6 8 6 c 8 diff --git a/testData/results/pkg/TestOldECJInner.dec b/testData/results/pkg/TestOldECJInner.dec index 0b7b87b1c6..1a6c6c61db 100644 --- a/testData/results/pkg/TestOldECJInner.dec +++ b/testData/results/pkg/TestOldECJInner.dec @@ -30,7 +30,11 @@ class 'pkg/TestOldECJInner' { 1 6 2 6 3 6 + 4 6 + 5 6 d 7 + e 7 + f 7 10 10 11 10 12 10 diff --git a/testData/results/pkg/TestPPMMLoop.dec b/testData/results/pkg/TestPPMMLoop.dec index dec2d0425a..3e29959392 100644 --- a/testData/results/pkg/TestPPMMLoop.dec +++ b/testData/results/pkg/TestPPMMLoop.dec @@ -33,6 +33,8 @@ class 'pkg/TestPPMMLoop' { 2 4 3 4 4 4 + 5 4 + 6 4 e 5 12 5 13 5 @@ -48,6 +50,8 @@ class 'pkg/TestPPMMLoop' { 2 10 3 10 4 10 + 5 10 + 6 10 e 11 12 11 13 11 @@ -64,6 +68,8 @@ class 'pkg/TestPPMMLoop' { 2 16 3 16 4 16 + 5 16 + 6 16 e 17 12 17 13 17 @@ -79,6 +85,8 @@ class 'pkg/TestPPMMLoop' { 2 22 3 22 4 22 + 5 22 + 6 22 e 23 12 23 13 23 diff --git a/testData/results/pkg/TestPPMMPhi.dec b/testData/results/pkg/TestPPMMPhi.dec index c3ae15843d..92cfc2b4db 100644 --- a/testData/results/pkg/TestPPMMPhi.dec +++ b/testData/results/pkg/TestPPMMPhi.dec @@ -27,6 +27,8 @@ class 'pkg/TestPPMMPhi' { 4 4 5 5 6 5 + 7 5 + 8 5 9 6 a 6 b 6 diff --git a/testData/results/pkg/TestPatternMatching.dec b/testData/results/pkg/TestPatternMatching.dec index 04c72452e5..0d2e6c3798 100644 --- a/testData/results/pkg/TestPatternMatching.dec +++ b/testData/results/pkg/TestPatternMatching.dec @@ -115,6 +115,8 @@ class 'pkg/TestPatternMatching' { 4 4 5 4 6 4 + 7 4 + 8 4 d 4 e 5 f 5 @@ -124,6 +126,8 @@ class 'pkg/TestPatternMatching' { 13 5 14 5 15 5 + 16 5 + 17 5 18 7 } @@ -134,6 +138,8 @@ class 'pkg/TestPatternMatching' { 4 10 5 10 6 10 + 7 10 + 8 10 d 10 11 11 12 11 @@ -141,6 +147,8 @@ class 'pkg/TestPatternMatching' { 14 11 15 11 16 11 + 17 11 + 18 11 19 13 } @@ -151,6 +159,8 @@ class 'pkg/TestPatternMatching' { 4 16 5 16 6 16 + 7 16 + 8 16 d 16 e 16 f 16 @@ -159,6 +169,8 @@ class 'pkg/TestPatternMatching' { 12 16 13 16 14 16 + 15 16 + 16 16 17 17 18 17 19 17 @@ -167,6 +179,8 @@ class 'pkg/TestPatternMatching' { 1c 17 1d 17 1e 17 + 1f 17 + 20 17 21 19 } @@ -230,6 +244,8 @@ class 'pkg/TestPatternMatching' { 4 37 5 37 6 37 + 7 37 + 8 37 9 42 a 42 b 42 @@ -251,19 +267,12 @@ class 'pkg/TestPatternMatching' { 1b 39 1c 39 1d 39 - 1e 43 - 1f 43 - 20 43 21 43 - 22 43 - 23 43 24 43 25 43 26 43 27 43 28 44 - 29 44 - 2a 44 } method 'testInvertedLoopUnused (Ljava/lang/Object;)V' { @@ -273,14 +282,14 @@ class 'pkg/TestPatternMatching' { 4 47 5 47 6 47 + 7 47 + 8 47 9 52 a 52 b 52 c 52 d 52 e 53 - f 53 - 10 53 11 48 12 48 13 48 @@ -294,9 +303,6 @@ class 'pkg/TestPatternMatching' { 1b 49 1c 49 1d 49 - 1e 53 - 1f 53 - 20 53 } method 'testCompoundLoop (Ljava/lang/Object;)V' { @@ -306,6 +312,8 @@ class 'pkg/TestPatternMatching' { 4 56 5 56 6 56 + 7 56 + 8 56 d 56 e 56 f 56 @@ -314,6 +322,8 @@ class 'pkg/TestPatternMatching' { 12 56 13 56 14 56 + 15 56 + 16 56 17 57 18 57 19 57 @@ -330,6 +340,8 @@ class 'pkg/TestPatternMatching' { 4 62 5 62 6 62 + 7 62 + 8 62 d 62 e 62 f 62 @@ -337,6 +349,8 @@ class 'pkg/TestPatternMatching' { 11 62 12 62 13 62 + 14 62 + 15 62 16 63 1a 66 1b 63 @@ -349,6 +363,8 @@ class 'pkg/TestPatternMatching' { 4 70 5 70 6 70 + 7 70 + 8 70 d 70 e 70 f 70 @@ -365,6 +381,8 @@ class 'pkg/TestPatternMatching' { 4 74 5 74 6 74 + 7 74 + 8 74 d 74 e 74 f 74 @@ -372,11 +390,15 @@ class 'pkg/TestPatternMatching' { 11 74 12 74 13 74 + 14 74 + 15 74 16 74 17 74 18 74 19 74 1a 74 + 1b 74 + 1c 74 1d 74 21 74 22 74 @@ -389,6 +411,8 @@ class 'pkg/TestPatternMatching' { 4 78 5 78 6 78 + 7 78 + 8 78 d 78 e 78 f 78 @@ -397,6 +421,8 @@ class 'pkg/TestPatternMatching' { 12 78 13 78 14 78 + 15 78 + 16 78 17 79 18 79 19 79 @@ -426,6 +452,8 @@ class 'pkg/TestPatternMatching' { 4 86 5 86 6 86 + 7 86 + 8 86 d 86 e 86 f 86 @@ -433,6 +461,8 @@ class 'pkg/TestPatternMatching' { 11 86 12 86 13 86 + 14 86 + 15 86 16 87 17 90 18 90 @@ -486,6 +516,8 @@ class 'pkg/TestPatternMatching' { 26 103 27 103 28 103 + 29 103 + 2a 103 2f 103 30 104 31 104 @@ -495,6 +527,8 @@ class 'pkg/TestPatternMatching' { 35 104 36 104 37 104 + 38 104 + 39 104 3a 106 } } diff --git a/testData/results/pkg/TestPatternMatching17.dec b/testData/results/pkg/TestPatternMatching17.dec index 6e6bfc84cb..c9438949ca 100644 --- a/testData/results/pkg/TestPatternMatching17.dec +++ b/testData/results/pkg/TestPatternMatching17.dec @@ -194,6 +194,8 @@ class 'pkg/TestPatternMatching17' { 2 9 3 9 4 9 + 5 9 + 6 9 b 9 c 10 d 10 @@ -203,6 +205,8 @@ class 'pkg/TestPatternMatching17' { 11 10 12 10 13 10 + 14 10 + 15 10 16 12 } @@ -212,6 +216,8 @@ class 'pkg/TestPatternMatching17' { 2 15 3 15 4 15 + 5 15 + 6 15 b 15 f 16 10 16 @@ -219,6 +225,8 @@ class 'pkg/TestPatternMatching17' { 12 16 13 16 14 16 + 15 16 + 16 16 17 18 } @@ -228,6 +236,8 @@ class 'pkg/TestPatternMatching17' { 2 21 3 21 4 21 + 5 21 + 6 21 b 21 c 21 d 21 @@ -236,6 +246,8 @@ class 'pkg/TestPatternMatching17' { 10 21 11 21 12 21 + 13 21 + 14 21 15 22 16 22 17 22 @@ -244,6 +256,8 @@ class 'pkg/TestPatternMatching17' { 1a 22 1b 22 1c 22 + 1d 22 + 1e 22 1f 24 } @@ -304,6 +318,8 @@ class 'pkg/TestPatternMatching17' { 2 42 3 42 4 42 + 5 42 + 6 42 7 47 8 47 9 47 @@ -325,19 +341,12 @@ class 'pkg/TestPatternMatching17' { 19 44 1a 44 1b 44 - 1c 48 - 1d 48 - 1e 48 1f 48 - 20 48 - 21 48 22 48 23 48 24 48 25 48 26 49 - 27 49 - 28 49 } method 'testInvertedLoopUnused (Ljava/lang/Object;)V' { @@ -346,14 +355,14 @@ class 'pkg/TestPatternMatching17' { 2 52 3 52 4 52 + 5 52 + 6 52 7 57 8 57 9 57 a 57 b 57 c 58 - d 58 - e 58 f 53 10 53 11 53 @@ -367,9 +376,6 @@ class 'pkg/TestPatternMatching17' { 19 54 1a 54 1b 54 - 1c 58 - 1d 58 - 1e 58 } method 'testCompoundLoop (Ljava/lang/Object;)V' { @@ -378,6 +384,8 @@ class 'pkg/TestPatternMatching17' { 2 61 3 61 4 61 + 5 61 + 6 61 b 61 c 61 d 61 @@ -386,6 +394,8 @@ class 'pkg/TestPatternMatching17' { 10 61 11 61 12 61 + 13 61 + 14 61 15 62 16 62 17 62 @@ -401,6 +411,8 @@ class 'pkg/TestPatternMatching17' { 2 67 3 67 4 67 + 5 67 + 6 67 b 67 c 67 d 67 @@ -408,6 +420,8 @@ class 'pkg/TestPatternMatching17' { f 67 10 67 11 67 + 12 67 + 13 67 14 68 18 71 19 68 @@ -419,6 +433,8 @@ class 'pkg/TestPatternMatching17' { 2 75 3 75 4 75 + 5 75 + 6 75 b 75 c 75 d 75 @@ -434,6 +450,8 @@ class 'pkg/TestPatternMatching17' { 2 79 3 79 4 79 + 5 79 + 6 79 b 79 c 79 d 79 @@ -441,11 +459,15 @@ class 'pkg/TestPatternMatching17' { f 79 10 79 11 79 + 12 79 + 13 79 14 79 15 79 16 79 17 79 18 79 + 19 79 + 1a 79 1b 79 1f 79 20 79 @@ -457,6 +479,8 @@ class 'pkg/TestPatternMatching17' { 2 83 3 83 4 83 + 5 83 + 6 83 b 83 c 83 d 83 @@ -465,6 +489,8 @@ class 'pkg/TestPatternMatching17' { 10 83 11 83 12 83 + 13 83 + 14 83 15 84 16 84 17 84 @@ -493,6 +519,8 @@ class 'pkg/TestPatternMatching17' { 2 91 3 91 4 91 + 5 91 + 6 91 b 91 c 91 d 91 @@ -500,6 +528,8 @@ class 'pkg/TestPatternMatching17' { f 91 10 91 11 91 + 12 91 + 13 91 14 92 15 95 16 95 @@ -552,6 +582,8 @@ class 'pkg/TestPatternMatching17' { 24 108 25 108 26 108 + 27 108 + 28 108 2d 108 2e 109 2f 109 @@ -561,6 +593,8 @@ class 'pkg/TestPatternMatching17' { 33 109 34 109 35 109 + 36 109 + 37 109 38 111 } @@ -573,16 +607,24 @@ class 'pkg/TestPatternMatching17' { 5 114 6 114 7 114 + 8 114 + 9 114 a 115 b 115 c 115 d 115 e 115 + f 115 + 10 115 11 116 12 116 13 116 14 116 15 116 + 16 116 + 17 116 + 18 116 + 19 116 1a 119 1b 119 1c 119 @@ -600,6 +642,8 @@ class 'pkg/TestPatternMatching17' { 28 120 29 120 2a 120 + 2b 120 + 2c 120 2d 121 2e 121 2f 121 @@ -612,6 +656,8 @@ class 'pkg/TestPatternMatching17' { 39 123 3a 123 3b 123 + 3c 123 + 3d 123 3e 126 } @@ -625,11 +671,15 @@ class 'pkg/TestPatternMatching17' { 6 131 7 131 8 131 + 9 131 + a 131 b 132 c 132 d 132 e 132 f 132 + 10 132 + 11 132 12 133 13 133 14 133 @@ -638,6 +688,8 @@ class 'pkg/TestPatternMatching17' { 1a 134 1b 134 1c 134 + 1d 134 + 1e 134 1f 135 20 135 21 135 @@ -666,11 +718,15 @@ class 'pkg/TestPatternMatching17' { 6 145 7 145 8 145 + 9 145 + a 145 b 146 c 146 d 146 e 146 f 146 + 10 146 + 11 146 12 147 13 147 14 147 @@ -679,6 +735,8 @@ class 'pkg/TestPatternMatching17' { 1a 148 1b 148 1c 148 + 1d 148 + 1e 148 23 148 24 148 25 149 @@ -704,11 +762,15 @@ class 'pkg/TestPatternMatching17' { 3 157 4 157 5 157 + 6 157 + 7 157 8 158 9 158 a 158 b 158 c 158 + d 158 + e 158 f 159 10 159 11 159 @@ -717,6 +779,8 @@ class 'pkg/TestPatternMatching17' { 17 160 18 160 19 160 + 1a 160 + 1b 160 1c 161 1d 161 1e 161 @@ -745,11 +809,15 @@ class 'pkg/TestPatternMatching17' { 6 171 7 171 8 171 + 9 171 + a 171 b 172 c 172 d 172 e 172 f 172 + 10 172 + 11 172 12 173 13 173 14 173 @@ -758,6 +826,8 @@ class 'pkg/TestPatternMatching17' { 1a 174 1b 174 1c 174 + 1d 174 + 1e 174 23 174 24 171 25 171 @@ -771,12 +841,16 @@ class 'pkg/TestPatternMatching17' { 2 181 3 181 4 181 + 5 181 + 6 181 b 181 c 181 d 181 e 181 f 181 10 181 + 11 181 + 12 181 13 182 14 182 15 182 diff --git a/testData/results/pkg/TestPatternMatching17AlreadyUsed.dec b/testData/results/pkg/TestPatternMatching17AlreadyUsed.dec index 6bdcfaecd1..0a18ee4b78 100644 --- a/testData/results/pkg/TestPatternMatching17AlreadyUsed.dec +++ b/testData/results/pkg/TestPatternMatching17AlreadyUsed.dec @@ -166,6 +166,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { c 6 d 6 e 6 + f 6 + 10 6 15 6 16 7 17 7 @@ -175,6 +177,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 1b 7 1c 7 1d 7 + 1e 7 + 1f 7 20 9 } @@ -194,6 +198,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { c 14 d 14 e 14 + f 14 + 10 14 15 14 16 15 17 15 @@ -203,6 +209,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 1b 15 1c 15 1d 15 + 1e 15 + 1f 15 20 17 } @@ -222,6 +230,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { c 22 d 22 e 22 + f 22 + 10 22 15 22 16 23 17 23 @@ -231,6 +241,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 1b 23 1c 23 1d 23 + 1e 23 + 1f 23 20 25 } @@ -250,6 +262,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { c 30 d 30 e 30 + f 30 + 10 30 15 30 16 31 17 31 @@ -259,6 +273,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 1b 31 1c 31 1d 31 + 1e 31 + 1f 31 20 33 } @@ -271,6 +287,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 5 37 6 37 7 37 + 8 37 + 9 37 e 37 f 38 10 38 @@ -280,6 +298,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 14 38 15 38 16 38 + 17 38 + 18 38 19 40 } @@ -292,6 +312,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 5 44 6 44 7 44 + 8 44 + 9 44 e 44 f 45 10 45 @@ -311,6 +333,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 21 47 22 47 23 47 + 24 47 + 25 47 26 49 } @@ -323,6 +347,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 5 53 6 53 7 53 + 8 53 + 9 53 a 54 b 54 c 54 @@ -351,6 +377,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 6 63 7 63 8 63 + 9 63 + a 63 b 64 c 64 d 64 @@ -358,6 +386,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { f 64 10 64 11 64 + 12 64 + 13 64 1a 64 1b 65 1c 65 @@ -367,6 +397,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 20 65 21 65 22 65 + 23 65 + 24 65 25 63 26 63 27 63 @@ -383,6 +415,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 6 73 7 73 8 73 + 9 73 + a 73 b 74 c 74 d 74 @@ -390,6 +424,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { f 74 10 74 11 74 + 12 74 + 13 74 14 75 15 75 16 75 @@ -422,6 +458,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 5 84 6 84 7 84 + 8 84 + 9 84 e 84 f 85 10 85 @@ -431,11 +469,15 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 14 85 15 85 16 85 + 17 85 + 18 85 19 88 1a 88 1b 88 1c 88 1d 88 + 1e 88 + 1f 88 24 88 25 89 26 89 @@ -445,6 +487,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 2a 89 2b 89 2c 89 + 2d 89 + 2e 89 2f 91 } @@ -457,6 +501,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 5 95 6 95 7 95 + 8 95 + 9 95 e 95 f 96 10 96 @@ -466,11 +512,15 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 14 96 15 96 16 96 + 17 96 + 18 96 19 99 1a 99 1b 99 1c 99 1d 99 + 1e 99 + 1f 99 24 99 25 100 26 100 @@ -480,11 +530,15 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 2a 100 2b 100 2c 100 + 2d 100 + 2e 100 2f 103 30 103 31 103 32 103 33 103 + 34 103 + 35 103 3a 103 3b 104 3c 104 @@ -494,11 +548,15 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 40 104 41 104 42 104 + 43 104 + 44 104 45 107 46 107 47 107 48 107 49 107 + 4a 107 + 4b 107 50 107 51 108 52 108 @@ -508,6 +566,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 56 108 57 108 58 108 + 59 108 + 5a 108 5b 110 } @@ -520,6 +580,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 5 114 6 114 7 114 + 8 114 + 9 114 a 115 b 115 c 115 @@ -540,6 +602,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 1b 119 1c 119 1d 119 + 1e 119 + 1f 119 20 120 21 120 22 120 @@ -567,6 +631,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 5 128 6 128 7 128 + 8 128 + 9 128 a 129 b 129 c 129 @@ -587,6 +653,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 1b 133 1c 133 1d 133 + 1e 133 + 1f 133 20 134 21 134 22 134 @@ -607,6 +675,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 31 138 32 138 33 138 + 34 138 + 35 138 36 139 37 139 38 139 @@ -627,6 +697,8 @@ class 'pkg/TestPatternMatching17AlreadyUsed' { 47 143 48 143 49 143 + 4a 143 + 4b 143 4c 144 4d 144 4e 144 @@ -740,4 +812,4 @@ Lines mapping: 159 <-> 144 160 <-> 145 162 <-> 148 -163 <-> 149 \ No newline at end of file +163 <-> 149 diff --git a/testData/results/pkg/TestPatternMatching17Fake.dec b/testData/results/pkg/TestPatternMatching17Fake.dec index b80824cc5a..d7d14fcd8b 100644 --- a/testData/results/pkg/TestPatternMatching17Fake.dec +++ b/testData/results/pkg/TestPatternMatching17Fake.dec @@ -35,10 +35,10 @@ public class TestPatternMatching17Fake { public void testClash(Object obj) { if (obj instanceof String s) {// 39 - System.out.println(s.length());// 40 42 43 44 + System.out.println(s.length());// 44 } else { - int s = 0; - System.out.println(s); + int s = 0;// 40 + System.out.println(s);// 42 } }// 46 @@ -64,6 +64,8 @@ class 'pkg/TestPatternMatching17Fake' { 2 4 3 4 4 4 + 5 4 + 6 4 b 4 c 5 d 5 @@ -75,11 +77,15 @@ class 'pkg/TestPatternMatching17Fake' { 13 5 14 5 15 5 + 16 5 + 17 5 18 8 19 8 1a 8 1b 8 1c 8 + 1d 8 + 1e 8 23 8 24 9 25 9 @@ -91,6 +97,8 @@ class 'pkg/TestPatternMatching17Fake' { 2b 9 2c 9 2d 9 + 2e 9 + 2f 9 30 11 } @@ -100,6 +108,8 @@ class 'pkg/TestPatternMatching17Fake' { 2 14 3 14 4 14 + 5 14 + 6 14 b 14 c 15 d 15 @@ -111,6 +121,8 @@ class 'pkg/TestPatternMatching17Fake' { 13 15 14 15 15 15 + 16 15 + 17 15 18 17 } @@ -120,6 +132,8 @@ class 'pkg/TestPatternMatching17Fake' { 2 20 3 20 4 20 + 5 20 + 6 20 b 20 c 21 d 21 @@ -131,6 +145,8 @@ class 'pkg/TestPatternMatching17Fake' { 13 21 14 21 15 21 + 16 21 + 17 21 18 23 } @@ -140,6 +156,8 @@ class 'pkg/TestPatternMatching17Fake' { 2 26 3 26 4 26 + 5 26 + 6 26 7 27 8 27 9 27 @@ -153,11 +171,15 @@ class 'pkg/TestPatternMatching17Fake' { 11 27 12 27 13 27 + 14 27 + 15 27 16 30 17 30 18 30 19 30 1a 30 + 1b 30 + 1c 30 21 30 22 31 23 31 @@ -169,6 +191,8 @@ class 'pkg/TestPatternMatching17Fake' { 29 31 2a 31 2b 31 + 2c 31 + 2d 31 2e 33 } @@ -178,25 +202,22 @@ class 'pkg/TestPatternMatching17Fake' { 2 36 3 36 4 36 + 5 36 + 6 36 b 36 c 37 d 37 e 37 - f 37 - 10 37 - 11 37 - 12 37 - 13 37 - 14 37 - 15 37 - 16 37 - 17 37 - 18 37 - 19 37 - 1a 37 + f 39 + 10 39 + 11 40 + 12 40 + 13 40 + 14 40 + 15 40 + 16 40 + 17 40 1b 37 - 1c 37 - 1d 37 1e 37 1f 37 20 37 @@ -212,6 +233,8 @@ class 'pkg/TestPatternMatching17Fake' { 4 46 5 46 6 46 + 7 46 + 8 46 9 47 a 47 b 47 @@ -223,6 +246,8 @@ class 'pkg/TestPatternMatching17Fake' { 11 48 12 48 13 48 + 14 48 + 15 48 16 49 17 49 18 49 @@ -235,11 +260,15 @@ class 'pkg/TestPatternMatching17Fake' { 1f 49 20 53 21 53 + 22 53 + 23 53 24 54 25 54 26 54 27 54 28 54 + 29 54 + 2a 54 2b 56 } } @@ -264,9 +293,8 @@ Lines mapping: 34 <-> 32 36 <-> 34 39 <-> 37 -40 <-> 38 -42 <-> 38 -43 <-> 38 +40 <-> 40 +42 <-> 41 44 <-> 38 46 <-> 43 49 <-> 46 @@ -277,3 +305,5 @@ Lines mapping: 58 <-> 54 59 <-> 55 61 <-> 57 +Not mapped: +43 diff --git a/testData/results/pkg/TestPatternMatching17FakeLoops.dec b/testData/results/pkg/TestPatternMatching17FakeLoops.dec index a65b5345c0..381f59342e 100644 --- a/testData/results/pkg/TestPatternMatching17FakeLoops.dec +++ b/testData/results/pkg/TestPatternMatching17FakeLoops.dec @@ -210,11 +210,15 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 19 3 19 4 19 + 5 19 + 6 19 7 19 8 19 9 19 a 19 b 19 + c 19 + d 19 e 20 f 20 10 20 @@ -236,11 +240,15 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 26 3 26 4 26 + 5 26 + 6 26 7 26 8 26 9 26 a 26 b 26 + c 26 + d 26 e 27 f 27 10 27 @@ -270,6 +278,8 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 35 3 35 4 35 + 5 35 + 6 35 7 35 8 35 9 35 @@ -296,17 +306,23 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 44 3 44 4 44 + 5 44 + 6 44 7 45 8 45 9 45 a 45 b 45 + c 45 + d 45 12 45 13 45 14 45 15 45 16 45 17 45 + 18 45 + 19 45 1a 52 1b 52 1c 52 @@ -328,6 +344,8 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 58 3 58 4 58 + 5 58 + 6 58 7 58 8 58 9 58 @@ -362,17 +380,23 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 69 3 69 4 69 + 5 69 + 6 69 7 70 8 70 9 70 a 70 b 70 + c 70 + d 70 12 70 13 70 14 70 15 70 16 70 17 70 + 18 70 + 19 70 1a 78 1b 78 1c 78 @@ -402,11 +426,15 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 84 3 84 4 84 + 5 84 + 6 84 7 84 8 84 9 84 a 84 b 84 + c 84 + d 84 e 85 f 85 10 85 @@ -428,11 +456,15 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 91 3 91 4 91 + 5 91 + 6 91 7 91 8 91 9 91 a 91 b 91 + c 91 + d 91 e 92 f 92 10 92 @@ -462,12 +494,16 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 100 3 100 4 100 + 5 100 + 6 100 b 100 f 100 10 100 11 100 12 100 13 100 + 14 100 + 15 100 16 101 17 101 18 101 @@ -489,17 +525,23 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 107 3 107 4 107 + 5 107 + 6 107 b 107 c 107 d 107 e 107 f 107 10 107 + 11 107 + 12 107 13 107 14 107 15 107 16 107 17 107 + 18 107 + 19 107 1a 108 1b 108 1c 108 @@ -521,12 +563,16 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 114 3 114 4 114 + 5 114 + 6 114 b 114 f 114 10 114 11 114 12 114 13 114 + 14 114 + 15 114 16 115 17 115 18 115 @@ -556,17 +602,23 @@ class 'pkg/TestPatternMatching17FakeLoops' { 2 123 3 123 4 123 + 5 123 + 6 123 b 123 c 123 d 123 e 123 f 123 10 123 + 11 123 + 12 123 13 123 14 123 15 123 16 123 17 123 + 18 123 + 19 123 1a 124 1b 124 1c 124 @@ -631,6 +683,8 @@ class 'pkg/TestPatternMatching17FakeLoops' { 11 146 12 146 13 146 + 14 146 + 15 146 16 147 17 147 18 147 @@ -643,11 +697,15 @@ class 'pkg/TestPatternMatching17FakeLoops' { 1f 147 23 151 24 151 + 25 151 + 26 151 27 152 28 152 29 152 2a 152 2b 152 + 2c 152 + 2d 152 2e 154 } } diff --git a/testData/results/pkg/TestPatternMatching17FakeLoopsInverted.dec b/testData/results/pkg/TestPatternMatching17FakeLoopsInverted.dec index 3abcc47bc1..56bf7890c7 100644 --- a/testData/results/pkg/TestPatternMatching17FakeLoopsInverted.dec +++ b/testData/results/pkg/TestPatternMatching17FakeLoopsInverted.dec @@ -15,7 +15,7 @@ public class TestPatternMatching17FakeLoopsInverted { } String x = (String)o; - }// 15 + } void test3(Object o) { while (o.hashCode() >= 0 && !(o instanceof String)) {// 19 @@ -148,7 +148,7 @@ public class TestPatternMatching17FakeLoopsInverted { } String x = (String)o; - String var4 = (String)o;// 133 134 + String var4 = (String)o;// 134 System.out.println(var4.hashCode() + var4.length());// 135 } @@ -235,6 +235,8 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 4 3 4 4 4 + 5 4 + 6 4 7 5 8 5 9 5 @@ -259,14 +261,14 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 11 3 11 4 11 + 5 11 + 6 11 7 16 8 16 9 16 a 16 b 16 c 17 - d 17 - e 17 f 12 10 12 11 12 @@ -279,9 +281,6 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 18 13 19 13 1a 13 - 1b 17 - 1c 17 - 1d 17 } method 'test3 (Ljava/lang/Object;)V' { @@ -290,11 +289,15 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 20 3 20 4 20 + 5 20 + 6 20 7 20 8 20 9 20 a 20 b 20 + c 20 + d 20 e 21 f 21 10 21 @@ -316,11 +319,15 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 27 3 27 4 27 + 5 27 + 6 27 7 27 8 27 9 27 a 27 b 27 + c 27 + d 27 e 28 f 28 10 28 @@ -350,11 +357,15 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 36 3 36 4 36 + 5 36 + 6 36 7 36 8 36 9 36 a 36 b 36 + c 36 + d 36 12 36 16 37 17 37 @@ -377,17 +388,23 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 43 3 43 4 43 + 5 43 + 6 43 7 44 8 44 9 44 a 44 b 44 + c 44 + d 44 12 44 13 44 14 44 15 44 16 44 17 44 + 18 44 + 19 44 1a 48 1b 48 1c 48 @@ -409,11 +426,15 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 54 3 54 4 54 + 5 54 + 6 54 7 54 8 54 9 54 a 54 b 54 + c 54 + d 54 12 54 16 55 17 55 @@ -444,17 +465,23 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 63 3 63 4 63 + 5 63 + 6 63 7 64 8 64 9 64 a 64 b 64 + c 64 + d 64 12 64 13 64 14 64 15 64 16 64 17 64 + 18 64 + 19 64 1a 68 1b 68 1c 68 @@ -484,11 +511,15 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 76 3 76 4 76 + 5 76 + 6 76 7 76 8 76 9 76 a 76 b 76 + c 76 + d 76 e 77 f 77 10 77 @@ -510,11 +541,15 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 83 3 83 4 83 + 5 83 + 6 83 7 83 8 83 9 83 a 83 b 83 + c 83 + d 83 e 84 f 84 10 84 @@ -544,12 +579,16 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 92 3 92 4 92 + 5 92 + 6 92 b 92 f 92 10 92 11 92 12 92 13 92 + 14 92 + 15 92 16 93 17 93 18 93 @@ -571,6 +610,8 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 99 3 99 4 99 + 5 99 + 6 99 b 99 c 99 d 99 @@ -581,6 +622,8 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 15 99 16 99 17 99 + 18 99 + 19 99 1a 100 1b 100 1c 100 @@ -602,12 +645,16 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 106 3 106 4 106 + 5 106 + 6 106 b 106 f 106 10 106 11 106 12 106 13 106 + 14 106 + 15 106 16 107 17 107 18 107 @@ -637,6 +684,8 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 115 3 115 4 115 + 5 115 + 6 115 b 115 c 115 d 115 @@ -647,6 +696,8 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 15 115 16 115 17 115 + 18 115 + 19 115 1a 116 1b 116 1c 116 @@ -679,6 +730,8 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 5 126 6 126 7 126 + 8 126 + 9 126 a 127 b 127 c 127 @@ -700,6 +753,8 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 134 3 134 4 134 + 5 134 + 6 134 7 135 8 135 9 135 @@ -744,14 +799,14 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 144 3 144 4 144 + 5 144 + 6 144 7 149 8 149 9 149 a 149 b 149 c 150 - d 150 - e 150 f 145 10 145 11 145 @@ -764,29 +819,21 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 18 146 19 146 1a 146 - 1b 150 - 1c 150 - 1d 150 1e 150 1f 150 20 150 - 21 150 22 151 23 151 24 151 - 25 151 26 151 27 151 28 151 - 29 151 2a 151 2b 151 2c 151 - 2d 151 2e 151 - 2f 152 - 30 152 - 31 152 + 2f 151 + 30 151 } method 'test3A (Ljava/lang/Object;)V' { @@ -795,11 +842,15 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 155 3 155 4 155 + 5 155 + 6 155 7 155 8 155 9 155 a 155 b 155 + c 155 + d 155 e 156 f 156 10 156 @@ -841,11 +892,15 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 165 3 165 4 165 + 5 165 + 6 165 7 165 8 165 9 165 a 165 b 165 + c 165 + d 165 12 165 16 166 17 166 @@ -888,17 +943,23 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 175 3 175 4 175 + 5 175 + 6 175 7 176 8 176 9 176 a 176 b 176 + c 176 + d 176 12 176 13 176 14 176 15 176 16 176 17 176 + 18 176 + 19 176 1a 180 1b 180 1c 180 @@ -940,11 +1001,15 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 189 3 189 4 189 + 5 189 + 6 189 7 189 8 189 9 189 a 189 b 189 + c 189 + d 189 e 190 f 190 10 190 @@ -986,12 +1051,16 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 199 3 199 4 199 + 5 199 + 6 199 b 199 f 199 10 199 11 199 12 199 13 199 + 14 199 + 15 199 16 200 17 200 18 200 @@ -1033,6 +1102,8 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 2 209 3 209 4 209 + 5 209 + 6 209 b 209 c 209 d 209 @@ -1043,6 +1114,8 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 15 209 16 209 17 209 + 18 209 + 19 209 1a 210 1b 210 1c 210 @@ -1087,6 +1160,8 @@ class 'pkg/TestPatternMatching17FakeLoopsInverted' { 5 221 6 221 7 221 + 8 221 + 9 221 a 222 b 222 c 222 @@ -1124,7 +1199,6 @@ Lines mapping: 12 <-> 12 13 <-> 13 14 <-> 14 -15 <-> 18 19 <-> 21 20 <-> 22 21 <-> 23 @@ -1193,7 +1267,6 @@ Lines mapping: 130 <-> 145 131 <-> 146 132 <-> 147 -133 <-> 151 134 <-> 151 135 <-> 152 139 <-> 156 @@ -1240,6 +1313,7 @@ Lines mapping: 207 <-> 228 Not mapped: 8 +15 16 22 29 @@ -1254,6 +1328,7 @@ Not mapped: 98 106 124 +133 136 142 152 diff --git a/testData/results/pkg/TestPatternMatching17FakeNew.dec b/testData/results/pkg/TestPatternMatching17FakeNew.dec index eee995cf2e..5af13ae78f 100644 --- a/testData/results/pkg/TestPatternMatching17FakeNew.dec +++ b/testData/results/pkg/TestPatternMatching17FakeNew.dec @@ -112,10 +112,10 @@ public class TestPatternMatching17FakeNew { public void testClash(Object obj) { if (obj instanceof String s) {// 112 - System.out.println(s.length());// 113 115 116 117 + System.out.println(s.length());// 117 } else { - int s = 0; - System.out.println(s); + int s = 0;// 113 + System.out.println(s);// 115 } }// 119 @@ -136,6 +136,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 4 3 4 4 4 + 5 4 + 6 4 b 4 c 5 d 5 @@ -145,6 +147,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 11 5 12 5 13 5 + 14 5 + 15 5 16 7 } @@ -154,6 +158,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 10 3 10 4 10 + 5 10 + 6 10 b 10 c 11 d 11 @@ -165,6 +171,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 13 12 14 12 15 12 + 16 12 + 17 12 18 14 } @@ -174,11 +182,15 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 17 3 17 4 17 + 5 17 + 6 17 7 17 8 17 9 17 a 17 b 17 + c 17 + d 17 e 18 f 18 10 18 @@ -189,6 +201,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 15 19 16 19 17 19 + 18 19 + 19 19 1a 21 } @@ -198,11 +212,15 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 24 3 24 4 24 + 5 24 + 6 24 7 24 8 24 9 24 a 24 b 24 + c 24 + d 24 e 25 f 25 10 25 @@ -213,6 +231,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 15 26 16 26 17 26 + 18 26 + 19 26 1a 29 1b 29 1c 29 @@ -230,11 +250,15 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 33 3 33 4 33 + 5 33 + 6 33 7 33 8 33 9 33 a 33 b 33 + c 33 + d 33 12 33 13 34 14 34 @@ -246,6 +270,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 1a 35 1b 35 1c 35 + 1d 35 + 1e 35 1f 37 } @@ -255,6 +281,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 40 3 40 4 40 + 5 40 + 6 40 7 40 8 40 9 40 @@ -265,6 +293,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 15 40 16 40 17 40 + 18 40 + 19 40 1a 41 1b 41 1c 41 @@ -275,6 +305,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 21 42 22 42 23 42 + 24 42 + 25 42 26 44 } @@ -284,11 +316,15 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 47 3 47 4 47 + 5 47 + 6 47 7 47 8 47 9 47 a 47 b 47 + c 47 + d 47 12 47 13 48 14 48 @@ -300,6 +336,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 1a 49 1b 49 1c 49 + 1d 49 + 1e 49 1f 52 20 52 21 52 @@ -317,6 +355,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 56 3 56 4 56 + 5 56 + 6 56 7 56 8 56 9 56 @@ -327,6 +367,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 15 56 16 56 17 56 + 18 56 + 19 56 1a 57 1b 57 1c 57 @@ -337,6 +379,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 21 58 22 58 23 58 + 24 58 + 25 58 26 61 27 61 28 61 @@ -354,11 +398,15 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 65 3 65 4 65 + 5 65 + 6 65 7 65 8 65 9 65 a 65 b 65 + c 65 + d 65 e 66 f 66 10 66 @@ -369,6 +417,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 15 67 16 67 17 67 + 18 67 + 19 67 1a 69 } @@ -378,11 +428,15 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 72 3 72 4 72 + 5 72 + 6 72 7 72 8 72 9 72 a 72 b 72 + c 72 + d 72 e 73 f 73 10 73 @@ -393,6 +447,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 15 74 16 74 17 74 + 18 74 + 19 74 1a 77 1b 77 1c 77 @@ -410,12 +466,16 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 81 3 81 4 81 + 5 81 + 6 81 b 81 f 81 10 81 11 81 12 81 13 81 + 14 81 + 15 81 16 82 17 82 18 82 @@ -426,6 +486,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 1d 83 1e 83 1f 83 + 20 83 + 21 83 22 85 } @@ -435,17 +497,23 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 88 3 88 4 88 + 5 88 + 6 88 b 88 c 88 d 88 e 88 f 88 10 88 + 11 88 + 12 88 13 88 14 88 15 88 16 88 17 88 + 18 88 + 19 88 1a 89 1b 89 1c 89 @@ -456,6 +524,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 21 90 22 90 23 90 + 24 90 + 25 90 26 92 } @@ -465,12 +535,16 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 95 3 95 4 95 + 5 95 + 6 95 b 95 f 95 10 95 11 95 12 95 13 95 + 14 95 + 15 95 16 96 17 96 18 96 @@ -481,6 +555,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 1d 97 1e 97 1f 97 + 20 97 + 21 97 22 100 23 100 24 100 @@ -498,17 +574,23 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 104 3 104 4 104 + 5 104 + 6 104 b 104 c 104 d 104 e 104 f 104 10 104 + 11 104 + 12 104 13 104 14 104 15 104 16 104 17 104 + 18 104 + 19 104 1a 105 1b 105 1c 105 @@ -519,6 +601,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 21 106 22 106 23 106 + 24 106 + 25 106 26 109 27 109 28 109 @@ -536,25 +620,22 @@ class 'pkg/TestPatternMatching17FakeNew' { 2 113 3 113 4 113 + 5 113 + 6 113 b 113 c 114 d 114 e 114 - f 114 - 10 114 - 11 114 - 12 114 - 13 114 - 14 114 - 15 114 - 16 114 - 17 114 - 18 114 - 19 114 - 1a 114 + f 116 + 10 116 + 11 117 + 12 117 + 13 117 + 14 117 + 15 117 + 16 117 + 17 117 1b 114 - 1c 114 - 1d 114 1e 114 1f 114 20 114 @@ -571,6 +652,8 @@ class 'pkg/TestPatternMatching17FakeNew' { 5 123 6 123 7 123 + 8 123 + 9 123 a 124 b 124 c 124 @@ -651,9 +734,8 @@ Lines mapping: 107 <-> 110 108 <-> 111 112 <-> 114 -113 <-> 115 -115 <-> 115 -116 <-> 115 +113 <-> 117 +115 <-> 118 117 <-> 115 119 <-> 120 122 <-> 123 @@ -661,3 +743,5 @@ Lines mapping: 124 <-> 125 127 <-> 128 128 <-> 129 +Not mapped: +116 diff --git a/testData/results/pkg/TestPatternMatchingAssign.dec b/testData/results/pkg/TestPatternMatchingAssign.dec index 0fda95ad25..6072893432 100644 --- a/testData/results/pkg/TestPatternMatchingAssign.dec +++ b/testData/results/pkg/TestPatternMatchingAssign.dec @@ -17,6 +17,8 @@ class 'pkg/TestPatternMatchingAssign' { 4 4 5 4 6 4 + 7 4 + 8 4 d 4 e 5 f 5 @@ -26,6 +28,8 @@ class 'pkg/TestPatternMatchingAssign' { 13 6 14 6 15 6 + 16 6 + 17 6 18 8 } } diff --git a/testData/results/pkg/TestPatternMatchingCompoundBool.dec b/testData/results/pkg/TestPatternMatchingCompoundBool.dec index 0721c97578..e8a9267f94 100644 --- a/testData/results/pkg/TestPatternMatchingCompoundBool.dec +++ b/testData/results/pkg/TestPatternMatchingCompoundBool.dec @@ -14,6 +14,8 @@ class 'pkg/TestPatternMatchingCompoundBool' { method 'test (ZLjava/lang/Object;)V' { 0 4 1 4 + 2 4 + 3 4 4 4 7 4 8 4 @@ -26,12 +28,16 @@ class 'pkg/TestPatternMatchingCompoundBool' { 17 4 18 4 19 4 + 1a 4 + 1b 4 1c 5 1d 5 1e 5 1f 5 20 5 21 5 + 22 5 + 23 5 24 8 25 8 26 8 diff --git a/testData/results/pkg/TestPatternMatchingFake.dec b/testData/results/pkg/TestPatternMatchingFake.dec index a5a3ea3578..47799e9d55 100644 --- a/testData/results/pkg/TestPatternMatchingFake.dec +++ b/testData/results/pkg/TestPatternMatchingFake.dec @@ -35,10 +35,10 @@ public class TestPatternMatchingFake { public void testClash(Object obj) { if (obj instanceof String s) {// 39 - System.out.println(s.length());// 40 42 43 44 + System.out.println(s.length());// 44 } else { - int s = 0; - System.out.println(s); + int s = 0;// 40 + System.out.println(s);// 42 } }// 46 @@ -64,6 +64,8 @@ class 'pkg/TestPatternMatchingFake' { 2 4 3 4 4 4 + 5 4 + 6 4 b 4 c 5 d 5 @@ -75,12 +77,16 @@ class 'pkg/TestPatternMatchingFake' { 13 5 14 5 15 5 + 16 5 + 17 5 18 8 1a 8 1b 8 1c 8 1d 8 1e 8 + 1f 8 + 20 8 25 8 26 9 27 9 @@ -92,6 +98,8 @@ class 'pkg/TestPatternMatchingFake' { 2d 9 2e 9 2f 9 + 30 9 + 31 9 32 11 } @@ -101,6 +109,8 @@ class 'pkg/TestPatternMatchingFake' { 2 14 3 14 4 14 + 5 14 + 6 14 b 14 c 15 d 15 @@ -112,6 +122,8 @@ class 'pkg/TestPatternMatchingFake' { 13 15 14 15 15 15 + 16 15 + 17 15 18 17 } @@ -122,6 +134,8 @@ class 'pkg/TestPatternMatchingFake' { 4 20 5 20 6 20 + 7 20 + 8 20 d 20 e 21 f 21 @@ -133,6 +147,8 @@ class 'pkg/TestPatternMatchingFake' { 15 21 16 21 17 21 + 18 21 + 19 21 1a 23 } @@ -142,6 +158,8 @@ class 'pkg/TestPatternMatchingFake' { 2 26 3 26 4 26 + 5 26 + 6 26 7 27 8 27 9 27 @@ -155,12 +173,16 @@ class 'pkg/TestPatternMatchingFake' { 11 27 12 27 13 27 + 14 27 + 15 27 16 30 18 30 19 30 1a 30 1b 30 1c 30 + 1d 30 + 1e 30 23 30 24 31 25 31 @@ -172,6 +194,8 @@ class 'pkg/TestPatternMatchingFake' { 2b 31 2c 31 2d 31 + 2e 31 + 2f 31 30 33 } @@ -182,25 +206,22 @@ class 'pkg/TestPatternMatchingFake' { 4 36 5 36 6 36 + 7 36 + 8 36 d 36 e 37 f 37 10 37 - 11 37 - 12 37 - 13 37 - 14 37 - 15 37 - 16 37 - 17 37 - 18 37 - 19 37 - 1a 37 - 1b 37 - 1c 37 + 11 39 + 12 39 + 13 40 + 14 40 + 15 40 + 16 40 + 17 40 + 18 40 + 19 40 1d 37 - 1e 37 - 1f 37 20 37 21 37 22 37 @@ -216,6 +237,8 @@ class 'pkg/TestPatternMatchingFake' { 4 46 5 46 6 46 + 7 46 + 8 46 9 47 a 47 b 47 @@ -227,6 +250,8 @@ class 'pkg/TestPatternMatchingFake' { 11 48 12 48 13 48 + 14 48 + 15 48 16 49 17 49 18 49 @@ -239,11 +264,15 @@ class 'pkg/TestPatternMatchingFake' { 1f 49 20 53 21 53 + 22 53 + 23 53 24 54 25 54 26 54 27 54 28 54 + 29 54 + 2a 54 2b 56 } } @@ -268,9 +297,8 @@ Lines mapping: 34 <-> 32 36 <-> 34 39 <-> 37 -40 <-> 38 -42 <-> 38 -43 <-> 38 +40 <-> 40 +42 <-> 41 44 <-> 38 46 <-> 43 49 <-> 46 @@ -281,3 +309,5 @@ Lines mapping: 58 <-> 54 59 <-> 55 61 <-> 57 +Not mapped: +43 diff --git a/testData/results/pkg/TestPatternMatchingFakeLoops.dec b/testData/results/pkg/TestPatternMatchingFakeLoops.dec index 9c69dd713a..fd46226057 100644 --- a/testData/results/pkg/TestPatternMatchingFakeLoops.dec +++ b/testData/results/pkg/TestPatternMatchingFakeLoops.dec @@ -211,11 +211,15 @@ class 'pkg/TestPatternMatchingFakeLoops' { 2 19 3 19 4 19 + 5 19 + 6 19 7 19 8 19 9 19 a 19 b 19 + c 19 + d 19 e 20 f 20 10 20 @@ -237,11 +241,15 @@ class 'pkg/TestPatternMatchingFakeLoops' { 2 26 3 26 4 26 + 5 26 + 6 26 7 26 8 26 9 26 a 26 b 26 + c 26 + d 26 e 27 f 27 10 27 @@ -271,6 +279,8 @@ class 'pkg/TestPatternMatchingFakeLoops' { 2 35 3 35 4 35 + 5 35 + 6 35 7 35 9 35 a 35 @@ -298,18 +308,24 @@ class 'pkg/TestPatternMatchingFakeLoops' { 2 44 3 44 4 44 + 5 44 + 6 44 7 45 9 45 a 45 b 45 c 45 d 45 + e 45 + f 45 14 45 15 45 16 45 17 45 18 45 19 45 + 1a 45 + 1b 45 1c 52 1d 52 1e 52 @@ -331,6 +347,8 @@ class 'pkg/TestPatternMatchingFakeLoops' { 2 58 3 58 4 58 + 5 58 + 6 58 7 58 9 58 a 58 @@ -366,18 +384,24 @@ class 'pkg/TestPatternMatchingFakeLoops' { 2 69 3 69 4 69 + 5 69 + 6 69 7 70 9 70 a 70 b 70 c 70 d 70 + e 70 + f 70 14 70 15 70 16 70 17 70 18 70 19 70 + 1a 70 + 1b 70 1c 78 1d 78 1e 78 @@ -407,11 +431,15 @@ class 'pkg/TestPatternMatchingFakeLoops' { 2 84 3 84 4 84 + 5 84 + 6 84 7 84 8 84 9 84 a 84 b 84 + c 84 + d 84 e 85 f 85 10 85 @@ -433,11 +461,15 @@ class 'pkg/TestPatternMatchingFakeLoops' { 2 91 3 91 4 91 + 5 91 + 6 91 7 91 8 91 9 91 a 91 b 91 + c 91 + d 91 e 92 f 92 10 92 @@ -468,12 +500,16 @@ class 'pkg/TestPatternMatchingFakeLoops' { 4 100 5 100 6 100 + 7 100 + 8 100 d 100 11 100 12 100 13 100 14 100 15 100 + 16 100 + 17 100 18 101 19 101 1a 101 @@ -496,17 +532,23 @@ class 'pkg/TestPatternMatchingFakeLoops' { 4 107 5 107 6 107 + 7 107 + 8 107 d 107 e 107 f 107 10 107 11 107 12 107 + 13 107 + 14 107 15 107 16 107 17 107 18 107 19 107 + 1a 107 + 1b 107 1c 108 1d 108 1e 108 @@ -529,12 +571,16 @@ class 'pkg/TestPatternMatchingFakeLoops' { 4 114 5 114 6 114 + 7 114 + 8 114 d 114 11 114 12 114 13 114 14 114 15 114 + 16 114 + 17 114 18 115 19 115 1a 115 @@ -565,17 +611,23 @@ class 'pkg/TestPatternMatchingFakeLoops' { 4 123 5 123 6 123 + 7 123 + 8 123 d 123 e 123 f 123 10 123 11 123 12 123 + 13 123 + 14 123 15 123 16 123 17 123 18 123 19 123 + 1a 123 + 1b 123 1c 124 1d 124 1e 124 @@ -640,6 +692,8 @@ class 'pkg/TestPatternMatchingFakeLoops' { 11 146 12 146 13 146 + 14 146 + 15 146 16 147 17 147 18 147 @@ -652,11 +706,15 @@ class 'pkg/TestPatternMatchingFakeLoops' { 1f 147 23 151 24 151 + 25 151 + 26 151 27 152 28 152 29 152 2a 152 2b 152 + 2c 152 + 2d 152 2e 154 } } diff --git a/testData/results/pkg/TestPatternMatchingFakeLoopsInverted.dec b/testData/results/pkg/TestPatternMatchingFakeLoopsInverted.dec index 9883c28808..8558ae7ae5 100644 --- a/testData/results/pkg/TestPatternMatchingFakeLoopsInverted.dec +++ b/testData/results/pkg/TestPatternMatchingFakeLoopsInverted.dec @@ -15,7 +15,7 @@ public class TestPatternMatchingFakeLoopsInverted { } String x = (String)o; - }// 15 + } void test3(Object o) { while (o.hashCode() >= 0 && !(o instanceof String)) {// 19 @@ -148,7 +148,7 @@ public class TestPatternMatchingFakeLoopsInverted { } String x = (String)o; - String var4 = (String)o;// 133 134 + String var4 = (String)o;// 134 System.out.println(var4.hashCode() + var4.length());// 135 } @@ -235,6 +235,8 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 4 3 4 4 4 + 5 4 + 6 4 7 5 8 5 9 5 @@ -260,14 +262,14 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 4 11 5 11 6 11 + 7 11 + 8 11 9 16 a 16 b 16 c 16 d 16 e 17 - f 17 - 10 17 11 12 12 12 13 12 @@ -280,9 +282,6 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 1a 13 1b 13 1c 13 - 1d 17 - 1e 17 - 1f 17 } method 'test3 (Ljava/lang/Object;)V' { @@ -291,11 +290,15 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 20 3 20 4 20 + 5 20 + 6 20 7 20 8 20 9 20 a 20 b 20 + c 20 + d 20 e 21 f 21 10 21 @@ -317,11 +320,15 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 27 3 27 4 27 + 5 27 + 6 27 7 27 8 27 9 27 a 27 b 27 + c 27 + d 27 e 28 f 28 10 28 @@ -351,12 +358,16 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 36 3 36 4 36 + 5 36 + 6 36 7 36 9 36 a 36 b 36 c 36 d 36 + e 36 + f 36 14 36 18 37 19 37 @@ -379,18 +390,24 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 43 3 43 4 43 + 5 43 + 6 43 7 44 9 44 a 44 b 44 c 44 d 44 + e 44 + f 44 14 44 15 44 16 44 17 44 18 44 19 44 + 1a 44 + 1b 44 1c 48 1d 48 1e 48 @@ -412,12 +429,16 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 54 3 54 4 54 + 5 54 + 6 54 7 54 9 54 a 54 b 54 c 54 d 54 + e 54 + f 54 14 54 18 55 19 55 @@ -448,18 +469,24 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 63 3 63 4 63 + 5 63 + 6 63 7 64 9 64 a 64 b 64 c 64 d 64 + e 64 + f 64 14 64 15 64 16 64 17 64 18 64 19 64 + 1a 64 + 1b 64 1c 68 1d 68 1e 68 @@ -489,11 +516,15 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 76 3 76 4 76 + 5 76 + 6 76 7 76 8 76 9 76 a 76 b 76 + c 76 + d 76 e 77 f 77 10 77 @@ -515,11 +546,15 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 83 3 83 4 83 + 5 83 + 6 83 7 83 8 83 9 83 a 83 b 83 + c 83 + d 83 e 84 f 84 10 84 @@ -550,12 +585,16 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 4 92 5 92 6 92 + 7 92 + 8 92 d 92 11 92 12 92 13 92 14 92 15 92 + 16 92 + 17 92 18 93 19 93 1a 93 @@ -578,6 +617,8 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 4 99 5 99 6 99 + 7 99 + 8 99 d 99 e 99 f 99 @@ -588,6 +629,8 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 17 99 18 99 19 99 + 1a 99 + 1b 99 1c 100 1d 100 1e 100 @@ -610,12 +653,16 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 4 106 5 106 6 106 + 7 106 + 8 106 d 106 11 106 12 106 13 106 14 106 15 106 + 16 106 + 17 106 18 107 19 107 1a 107 @@ -646,6 +693,8 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 4 115 5 115 6 115 + 7 115 + 8 115 d 115 e 115 f 115 @@ -656,6 +705,8 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 17 115 18 115 19 115 + 1a 115 + 1b 115 1c 116 1d 116 1e 116 @@ -688,6 +739,8 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 5 126 6 126 7 126 + 8 126 + 9 126 a 127 b 127 c 127 @@ -709,6 +762,8 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 134 3 134 4 134 + 5 134 + 6 134 7 135 8 135 9 135 @@ -754,14 +809,14 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 4 144 5 144 6 144 + 7 144 + 8 144 9 149 a 149 b 149 c 149 d 149 e 150 - f 150 - 10 150 11 145 12 145 13 145 @@ -774,29 +829,21 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 1a 146 1b 146 1c 146 - 1d 150 - 1e 150 - 1f 150 20 150 21 150 22 150 - 23 150 24 151 25 151 26 151 - 27 151 28 151 29 151 2a 151 - 2b 151 2c 151 2d 151 2e 151 - 2f 151 30 151 - 31 152 - 32 152 - 33 152 + 31 151 + 32 151 } method 'test3A (Ljava/lang/Object;)V' { @@ -805,11 +852,15 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 155 3 155 4 155 + 5 155 + 6 155 7 155 8 155 9 155 a 155 b 155 + c 155 + d 155 e 156 f 156 10 156 @@ -851,12 +902,16 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 165 3 165 4 165 + 5 165 + 6 165 7 165 9 165 a 165 b 165 c 165 d 165 + e 165 + f 165 14 165 18 166 19 166 @@ -899,18 +954,24 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 175 3 175 4 175 + 5 175 + 6 175 7 176 9 176 a 176 b 176 c 176 d 176 + e 176 + f 176 14 176 15 176 16 176 17 176 18 176 19 176 + 1a 176 + 1b 176 1c 180 1d 180 1e 180 @@ -952,11 +1013,15 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 2 189 3 189 4 189 + 5 189 + 6 189 7 189 8 189 9 189 a 189 b 189 + c 189 + d 189 e 190 f 190 10 190 @@ -999,12 +1064,16 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 4 199 5 199 6 199 + 7 199 + 8 199 d 199 11 199 12 199 13 199 14 199 15 199 + 16 199 + 17 199 18 200 19 200 1a 200 @@ -1047,6 +1116,8 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 4 209 5 209 6 209 + 7 209 + 8 209 d 209 e 209 f 209 @@ -1057,6 +1128,8 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 17 209 18 209 19 209 + 1a 209 + 1b 209 1c 210 1d 210 1e 210 @@ -1101,6 +1174,8 @@ class 'pkg/TestPatternMatchingFakeLoopsInverted' { 5 221 6 221 7 221 + 8 221 + 9 221 a 222 b 222 c 222 @@ -1138,7 +1213,6 @@ Lines mapping: 12 <-> 12 13 <-> 13 14 <-> 14 -15 <-> 18 19 <-> 21 20 <-> 22 21 <-> 23 @@ -1207,7 +1281,6 @@ Lines mapping: 130 <-> 145 131 <-> 146 132 <-> 147 -133 <-> 151 134 <-> 151 135 <-> 152 139 <-> 156 @@ -1254,6 +1327,7 @@ Lines mapping: 207 <-> 228 Not mapped: 8 +15 16 22 29 @@ -1268,6 +1342,7 @@ Not mapped: 98 106 124 +133 136 142 152 diff --git a/testData/results/pkg/TestPatternMatchingFakeNew.dec b/testData/results/pkg/TestPatternMatchingFakeNew.dec index ba449a7b76..63d2e1328b 100644 --- a/testData/results/pkg/TestPatternMatchingFakeNew.dec +++ b/testData/results/pkg/TestPatternMatchingFakeNew.dec @@ -112,10 +112,10 @@ public class TestPatternMatchingFakeNew { public void testClash(Object obj) { if (obj instanceof String s) {// 112 - System.out.println(s.length());// 113 115 116 117 + System.out.println(s.length());// 117 } else { - int s = 0; - System.out.println(s); + int s = 0;// 113 + System.out.println(s);// 115 } }// 119 @@ -136,6 +136,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 2 4 3 4 4 4 + 5 4 + 6 4 b 4 c 5 d 5 @@ -145,6 +147,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 11 5 12 5 13 5 + 14 5 + 15 5 16 7 } @@ -155,6 +159,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 4 10 5 10 6 10 + 7 10 + 8 10 d 10 e 11 f 11 @@ -166,6 +172,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 15 12 16 12 17 12 + 18 12 + 19 12 1a 14 } @@ -175,11 +183,15 @@ class 'pkg/TestPatternMatchingFakeNew' { 2 17 3 17 4 17 + 5 17 + 6 17 7 17 8 17 9 17 a 17 b 17 + c 17 + d 17 e 18 f 18 10 18 @@ -190,6 +202,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 15 19 16 19 17 19 + 18 19 + 19 19 1a 21 } @@ -199,11 +213,15 @@ class 'pkg/TestPatternMatchingFakeNew' { 2 24 3 24 4 24 + 5 24 + 6 24 7 24 8 24 9 24 a 24 b 24 + c 24 + d 24 e 25 f 25 10 25 @@ -214,6 +232,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 15 26 16 26 17 26 + 18 26 + 19 26 1a 29 1b 29 1c 29 @@ -231,12 +251,16 @@ class 'pkg/TestPatternMatchingFakeNew' { 2 33 3 33 4 33 + 5 33 + 6 33 7 33 9 33 a 33 b 33 c 33 d 33 + e 33 + f 33 14 33 15 34 16 34 @@ -248,6 +272,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 1c 35 1d 35 1e 35 + 1f 35 + 20 35 21 37 } @@ -257,6 +283,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 2 40 3 40 4 40 + 5 40 + 6 40 7 40 9 40 a 40 @@ -268,6 +296,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 17 40 18 40 19 40 + 1a 40 + 1b 40 1c 41 1d 41 1e 41 @@ -278,6 +308,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 23 42 24 42 25 42 + 26 42 + 27 42 28 44 } @@ -287,12 +319,16 @@ class 'pkg/TestPatternMatchingFakeNew' { 2 47 3 47 4 47 + 5 47 + 6 47 7 47 9 47 a 47 b 47 c 47 d 47 + e 47 + f 47 14 47 15 48 16 48 @@ -304,6 +340,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 1c 49 1d 49 1e 49 + 1f 49 + 20 49 21 52 22 52 23 52 @@ -321,6 +359,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 2 56 3 56 4 56 + 5 56 + 6 56 7 56 9 56 a 56 @@ -332,6 +372,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 17 56 18 56 19 56 + 1a 56 + 1b 56 1c 57 1d 57 1e 57 @@ -342,6 +384,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 23 58 24 58 25 58 + 26 58 + 27 58 28 61 29 61 2a 61 @@ -359,11 +403,15 @@ class 'pkg/TestPatternMatchingFakeNew' { 2 65 3 65 4 65 + 5 65 + 6 65 7 65 8 65 9 65 a 65 b 65 + c 65 + d 65 e 66 f 66 10 66 @@ -374,6 +422,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 15 67 16 67 17 67 + 18 67 + 19 67 1a 69 } @@ -383,11 +433,15 @@ class 'pkg/TestPatternMatchingFakeNew' { 2 72 3 72 4 72 + 5 72 + 6 72 7 72 8 72 9 72 a 72 b 72 + c 72 + d 72 e 73 f 73 10 73 @@ -398,6 +452,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 15 74 16 74 17 74 + 18 74 + 19 74 1a 77 1b 77 1c 77 @@ -416,12 +472,16 @@ class 'pkg/TestPatternMatchingFakeNew' { 4 81 5 81 6 81 + 7 81 + 8 81 d 81 11 81 12 81 13 81 14 81 15 81 + 16 81 + 17 81 18 82 19 82 1a 82 @@ -432,6 +492,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 1f 83 20 83 21 83 + 22 83 + 23 83 24 85 } @@ -442,17 +504,23 @@ class 'pkg/TestPatternMatchingFakeNew' { 4 88 5 88 6 88 + 7 88 + 8 88 d 88 e 88 f 88 10 88 11 88 12 88 + 13 88 + 14 88 15 88 16 88 17 88 18 88 19 88 + 1a 88 + 1b 88 1c 89 1d 89 1e 89 @@ -463,6 +531,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 23 90 24 90 25 90 + 26 90 + 27 90 28 92 } @@ -473,12 +543,16 @@ class 'pkg/TestPatternMatchingFakeNew' { 4 95 5 95 6 95 + 7 95 + 8 95 d 95 11 95 12 95 13 95 14 95 15 95 + 16 95 + 17 95 18 96 19 96 1a 96 @@ -489,6 +563,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 1f 97 20 97 21 97 + 22 97 + 23 97 24 100 25 100 26 100 @@ -507,17 +583,23 @@ class 'pkg/TestPatternMatchingFakeNew' { 4 104 5 104 6 104 + 7 104 + 8 104 d 104 e 104 f 104 10 104 11 104 12 104 + 13 104 + 14 104 15 104 16 104 17 104 18 104 19 104 + 1a 104 + 1b 104 1c 105 1d 105 1e 105 @@ -528,6 +610,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 23 106 24 106 25 106 + 26 106 + 27 106 28 109 29 109 2a 109 @@ -546,25 +630,22 @@ class 'pkg/TestPatternMatchingFakeNew' { 4 113 5 113 6 113 + 7 113 + 8 113 d 113 e 114 f 114 10 114 - 11 114 - 12 114 - 13 114 - 14 114 - 15 114 - 16 114 - 17 114 - 18 114 - 19 114 - 1a 114 - 1b 114 - 1c 114 + 11 116 + 12 116 + 13 117 + 14 117 + 15 117 + 16 117 + 17 117 + 18 117 + 19 117 1d 114 - 1e 114 - 1f 114 20 114 21 114 22 114 @@ -581,6 +662,8 @@ class 'pkg/TestPatternMatchingFakeNew' { 5 123 6 123 7 123 + 8 123 + 9 123 a 124 b 124 c 124 @@ -661,9 +744,8 @@ Lines mapping: 107 <-> 110 108 <-> 111 112 <-> 114 -113 <-> 115 -115 <-> 115 -116 <-> 115 +113 <-> 117 +115 <-> 118 117 <-> 115 119 <-> 120 122 <-> 123 @@ -671,3 +753,5 @@ Lines mapping: 124 <-> 125 127 <-> 128 128 <-> 129 +Not mapped: +116 diff --git a/testData/results/pkg/TestPatternMatchingInline.dec b/testData/results/pkg/TestPatternMatchingInline.dec index b2ed1b8d5e..1141474022 100644 --- a/testData/results/pkg/TestPatternMatchingInline.dec +++ b/testData/results/pkg/TestPatternMatchingInline.dec @@ -43,6 +43,8 @@ class 'pkg/TestPatternMatchingInline' { 6 6 7 6 8 6 + 9 6 + a 6 f 6 10 6 11 6 @@ -50,6 +52,8 @@ class 'pkg/TestPatternMatchingInline' { 13 6 14 6 15 6 + 16 6 + 17 6 18 7 19 8 1c 11 @@ -68,12 +72,16 @@ class 'pkg/TestPatternMatchingInline' { 6 20 7 20 8 20 + 9 20 + a 20 f 20 10 20 11 20 12 20 13 20 14 20 + 15 20 + 16 20 17 21 18 22 1b 25 diff --git a/testData/results/pkg/TestPatternMatchingInteger.dec b/testData/results/pkg/TestPatternMatchingInteger.dec index a728a5c8f2..a735fe3724 100644 --- a/testData/results/pkg/TestPatternMatchingInteger.dec +++ b/testData/results/pkg/TestPatternMatchingInteger.dec @@ -55,6 +55,8 @@ class 'pkg/TestPatternMatchingInteger' { 2 4 3 4 4 4 + 5 4 + 6 4 b 4 c 4 d 4 @@ -71,12 +73,16 @@ class 'pkg/TestPatternMatchingInteger' { 2 8 3 8 4 8 + 5 8 + 6 8 b 8 c 8 d 8 e 8 f 8 10 8 + 11 8 + 12 8 17 8 18 8 19 9 @@ -95,6 +101,8 @@ class 'pkg/TestPatternMatchingInteger' { 26 12 27 12 28 12 + 29 12 + 2a 12 2f 12 30 12 31 13 @@ -108,6 +116,8 @@ class 'pkg/TestPatternMatchingInteger' { 39 15 3a 15 3b 15 + 3c 15 + 3d 15 42 15 43 15 44 15 @@ -126,6 +136,8 @@ class 'pkg/TestPatternMatchingInteger' { 4 21 5 21 6 21 + 7 21 + 8 21 d 21 e 21 10 22 @@ -139,6 +151,8 @@ class 'pkg/TestPatternMatchingInteger' { 19 25 1a 25 1b 25 + 1c 25 + 1d 25 22 25 23 25 25 26 @@ -157,12 +171,16 @@ class 'pkg/TestPatternMatchingInteger' { 2 33 3 33 4 33 + 5 33 + 6 33 b 33 c 33 d 33 e 33 f 33 10 33 + 11 33 + 12 33 17 33 18 33 19 34 @@ -186,6 +204,8 @@ class 'pkg/TestPatternMatchingInteger' { 2 41 3 41 4 41 + 5 41 + 6 41 b 41 c 41 d 41 @@ -193,6 +213,8 @@ class 'pkg/TestPatternMatchingInteger' { f 41 10 41 11 41 + 12 41 + 13 41 14 41 15 41 16 41 @@ -200,6 +222,8 @@ class 'pkg/TestPatternMatchingInteger' { 18 41 19 41 1a 41 + 1b 41 + 1c 41 1d 46 1e 46 1f 46 @@ -213,6 +237,8 @@ class 'pkg/TestPatternMatchingInteger' { 2a 42 2b 42 2c 42 + 2d 42 + 2e 42 2f 43 } } diff --git a/testData/results/pkg/TestPatternMatchingLocalCapture.dec b/testData/results/pkg/TestPatternMatchingLocalCapture.dec index b67a5ce5ba..2dba1de9f2 100644 --- a/testData/results/pkg/TestPatternMatchingLocalCapture.dec +++ b/testData/results/pkg/TestPatternMatchingLocalCapture.dec @@ -20,6 +20,8 @@ class 'pkg/TestPatternMatchingLocalCapture' { 4 4 5 4 6 4 + 7 4 + 8 4 d 4 18 11 } diff --git a/testData/results/pkg/TestPatternMatchingMerge.dec b/testData/results/pkg/TestPatternMatchingMerge.dec index 26fdbf1a2e..632d600ca5 100644 --- a/testData/results/pkg/TestPatternMatchingMerge.dec +++ b/testData/results/pkg/TestPatternMatchingMerge.dec @@ -28,6 +28,8 @@ class 'pkg/TestPatternMatchingMerge' { 5 5 6 5 7 5 + 8 5 + 9 5 e 5 f 8 } @@ -40,6 +42,8 @@ class 'pkg/TestPatternMatchingMerge' { 4 12 5 12 6 12 + 7 12 + 8 12 9 13 a 13 b 13 diff --git a/testData/results/pkg/TestPatternMatchingStatic.dec b/testData/results/pkg/TestPatternMatchingStatic.dec index ca057fd2f1..f4260c21ca 100644 --- a/testData/results/pkg/TestPatternMatchingStatic.dec +++ b/testData/results/pkg/TestPatternMatchingStatic.dec @@ -18,7 +18,11 @@ class 'pkg/TestPatternMatchingStatic' { 2 4 3 4 4 4 + 5 4 + 6 4 c 5 + d 5 + e 5 f 7 } diff --git a/testData/results/pkg/TestPiDivision.dec b/testData/results/pkg/TestPiDivision.dec index 588a72f491..d6444249f5 100644 --- a/testData/results/pkg/TestPiDivision.dec +++ b/testData/results/pkg/TestPiDivision.dec @@ -96,6 +96,8 @@ class 'pkg/TestPiDivision' { 3 28 4 28 5 28 + 6 28 + 7 28 d 28 } } diff --git a/testData/results/pkg/TestPrimitives.dec b/testData/results/pkg/TestPrimitives.dec index c76fd0779e..3522e04306 100644 --- a/testData/results/pkg/TestPrimitives.dec +++ b/testData/results/pkg/TestPrimitives.dec @@ -1097,64 +1097,90 @@ class 'pkg/TestPrimitives' { 0 176 1 176 2 176 + 3 176 + 4 176 a 176 b 177 c 177 + d 177 + e 177 14 177 15 178 16 178 17 178 + 18 178 + 19 178 1f 178 20 179 21 179 22 179 23 179 + 24 179 + 25 179 2b 179 2c 180 2d 180 2e 180 2f 180 + 30 180 + 31 180 37 180 38 181 39 181 3a 181 3b 181 + 3c 181 + 3d 181 43 181 44 182 45 182 46 182 47 182 + 48 182 + 49 182 4f 182 50 183 51 183 52 183 53 183 + 54 183 + 55 183 5b 183 5c 184 5d 184 5e 184 5f 184 + 60 184 + 61 184 67 184 68 185 69 185 6a 185 6b 185 + 6c 185 + 6d 185 73 185 74 186 75 186 76 186 77 186 + 78 186 + 79 186 7f 186 80 187 81 187 82 187 83 187 + 84 187 + 85 187 8b 187 8c 188 8d 188 8e 188 8f 188 90 188 + 91 188 + 92 188 9a 188 } diff --git a/testData/results/pkg/TestRecordCanonicalConstructor.dec b/testData/results/pkg/TestRecordCanonicalConstructor.dec index 29ddefca22..64f0fe5730 100644 --- a/testData/results/pkg/TestRecordCanonicalConstructor.dec +++ b/testData/results/pkg/TestRecordCanonicalConstructor.dec @@ -15,6 +15,8 @@ class 'pkg/TestRecordCanonicalConstructor' { method ' (Ljava/lang/String;Ljava/lang/Object;)V' { 4 4 5 4 + 6 4 + 7 4 c 5 d 5 11 5 diff --git a/testData/results/pkg/TestRecordCanonicalConstructor2.dec b/testData/results/pkg/TestRecordCanonicalConstructor2.dec index d59fbf5ff6..5517e1dd92 100644 --- a/testData/results/pkg/TestRecordCanonicalConstructor2.dec +++ b/testData/results/pkg/TestRecordCanonicalConstructor2.dec @@ -34,6 +34,8 @@ class 'pkg/TestRecordCanonicalConstructor2' { 5 4 6 5 7 5 + 8 5 + 9 5 e 6 f 6 13 6 @@ -43,6 +45,8 @@ class 'pkg/TestRecordCanonicalConstructor2' { method ' (Ljava/lang/String;Ljava/lang/Object;)V' { 4 11 5 11 + 6 11 + 7 11 c 12 d 12 11 12 @@ -70,6 +74,8 @@ class 'pkg/TestRecordCanonicalConstructor2' { 8 20 9 21 a 21 + b 21 + c 21 11 22 12 22 16 22 diff --git a/testData/results/pkg/TestRecordPattern1.dec b/testData/results/pkg/TestRecordPattern1.dec index 9040dfe877..9d67d51fb8 100644 --- a/testData/results/pkg/TestRecordPattern1.dec +++ b/testData/results/pkg/TestRecordPattern1.dec @@ -74,6 +74,8 @@ class 'pkg/TestRecordPattern1' { 2 6 3 6 4 6 + 5 6 + 6 6 7 7 8 7 9 7 @@ -117,6 +119,8 @@ class 'pkg/TestRecordPattern1' { 2f 11 30 11 31 11 + 32 11 + 33 11 34 13 } @@ -124,6 +128,30 @@ class 'pkg/TestRecordPattern1' { 0 16 4 16 b 16 + c 16 + d 16 + e 16 + f 16 + 10 16 + 11 16 + 12 16 + 13 16 + 14 16 + 15 16 + 16 16 + 17 16 + 18 16 + 19 16 + 1a 16 + 1b 16 + 1c 16 + 1d 16 + 1e 16 + 1f 16 + 20 16 + 21 16 + 22 16 + 23 16 24 21 25 21 26 21 @@ -189,6 +217,8 @@ class 'pkg/TestRecordPattern1' { 69 28 6a 28 6b 28 + 6c 28 + 6d 28 6e 30 } @@ -205,6 +235,30 @@ class 'pkg/TestRecordPattern1' { 9 38 a 38 b 38 + c 38 + d 38 + e 38 + f 38 + 10 38 + 11 38 + 12 38 + 13 38 + 14 38 + 15 38 + 16 38 + 17 38 + 18 38 + 19 38 + 1a 38 + 1b 38 + 1c 38 + 1d 38 + 1e 38 + 1f 38 + 20 38 + 21 38 + 22 38 + 23 38 24 40 25 41 28 43 @@ -248,9 +302,13 @@ class 'pkg/TestRecordPattern1' { 4e 47 4f 47 50 47 + 51 47 + 52 47 53 47 54 47 55 47 + 56 47 + 57 47 58 48 59 48 5a 49 diff --git a/testData/results/pkg/TestRecordPattern2.dec b/testData/results/pkg/TestRecordPattern2.dec index 42f2291cfe..b2702b3ee2 100644 --- a/testData/results/pkg/TestRecordPattern2.dec +++ b/testData/results/pkg/TestRecordPattern2.dec @@ -97,6 +97,8 @@ class 'pkg/TestRecordPattern2' { 2 6 3 6 4 6 + 5 6 + 6 6 7 6 8 6 9 6 @@ -105,6 +107,8 @@ class 'pkg/TestRecordPattern2' { 10 6 11 6 12 6 + 13 6 + 14 6 1a 6 1b 6 1c 6 @@ -114,6 +118,8 @@ class 'pkg/TestRecordPattern2' { 24 6 25 6 26 6 + 27 6 + 28 6 2e 6 2f 7 30 7 @@ -133,6 +139,8 @@ class 'pkg/TestRecordPattern2' { 41 8 42 8 43 8 + 44 8 + 45 8 46 8 47 8 48 8 @@ -141,6 +149,8 @@ class 'pkg/TestRecordPattern2' { 4f 8 50 8 51 8 + 52 8 + 53 8 59 8 5a 8 5b 9 @@ -163,6 +173,8 @@ class 'pkg/TestRecordPattern2' { 73 12 74 12 75 12 + 76 12 + 77 12 78 14 } @@ -172,6 +184,8 @@ class 'pkg/TestRecordPattern2' { 2 17 3 17 4 17 + 5 17 + 6 17 7 17 8 17 9 17 @@ -180,6 +194,8 @@ class 'pkg/TestRecordPattern2' { 10 17 11 17 12 17 + 13 17 + 14 17 1a 17 1b 17 1c 17 @@ -189,6 +205,8 @@ class 'pkg/TestRecordPattern2' { 24 17 25 17 26 17 + 27 17 + 28 17 2e 17 2f 18 30 18 @@ -208,6 +226,8 @@ class 'pkg/TestRecordPattern2' { 41 19 42 19 43 19 + 44 19 + 45 19 46 19 47 19 48 19 @@ -216,6 +236,8 @@ class 'pkg/TestRecordPattern2' { 4f 19 50 19 51 19 + 52 19 + 53 19 59 19 5a 19 5b 20 @@ -238,6 +260,8 @@ class 'pkg/TestRecordPattern2' { 73 23 74 23 75 23 + 76 23 + 77 23 78 26 79 26 7a 26 @@ -262,6 +286,42 @@ class 'pkg/TestRecordPattern2' { 9 35 a 35 b 35 + c 35 + d 35 + e 35 + f 35 + 10 35 + 11 35 + 12 35 + 13 35 + 14 35 + 15 35 + 16 35 + 17 35 + 18 35 + 19 35 + 1a 35 + 1b 35 + 1c 35 + 1d 35 + 1e 35 + 1f 35 + 20 35 + 21 35 + 22 35 + 23 35 + 24 35 + 25 35 + 26 35 + 27 35 + 28 35 + 29 35 + 2a 35 + 2b 35 + 2c 35 + 2d 35 + 2e 35 + 2f 35 34 81 35 81 39 81 @@ -278,6 +338,8 @@ class 'pkg/TestRecordPattern2' { 4a 42 4b 42 4c 42 + 4d 42 + 4e 42 54 42 55 42 56 42 @@ -288,27 +350,25 @@ class 'pkg/TestRecordPattern2' { 5f 42 60 42 61 42 + 62 42 + 63 42 69 42 6a 42 6e 43 6f 43 - 70 43 - 71 43 - 72 43 - 73 43 - 74 43 - 75 43 + 71 47 + 72 47 + 73 48 76 43 77 43 78 43 79 43 - 7a 43 7b 43 7c 43 7d 43 - 7e 43 - 7f 43 80 43 + 81 43 + 82 43 84 44 87 50 88 50 @@ -318,6 +378,8 @@ class 'pkg/TestRecordPattern2' { 90 50 91 50 92 50 + 93 50 + 94 50 9a 50 9b 50 9c 50 @@ -328,34 +390,30 @@ class 'pkg/TestRecordPattern2' { a5 50 a6 50 a7 50 + a8 50 + a9 50 af 50 b0 50 b1 51 b4 51 b5 51 - b6 51 - b7 51 - b8 51 - b9 51 - ba 51 - bb 51 + b7 55 + b8 55 + b9 56 bc 51 bd 51 be 51 bf 51 - c0 51 c1 51 c2 51 c3 51 - c4 51 - c5 51 c6 51 c7 51 c8 51 c9 51 - ca 51 - cb 51 cc 51 + cd 51 + ce 51 d0 52 d3 58 d4 58 @@ -371,15 +429,16 @@ class 'pkg/TestRecordPattern2' { e6 59 e7 59 e8 59 + e9 59 + ea 59 f0 59 f1 59 f5 63 f6 63 f7 64 fd 60 + fe 60 100 60 - 101 60 - 102 60 104 66 105 66 106 66 @@ -388,6 +447,8 @@ class 'pkg/TestRecordPattern2' { 10d 66 10e 66 10f 66 + 110 66 + 111 66 117 66 118 66 119 66 @@ -398,6 +459,8 @@ class 'pkg/TestRecordPattern2' { 122 66 123 66 124 66 + 125 66 + 126 66 12c 66 12d 66 12e 66 @@ -407,6 +470,8 @@ class 'pkg/TestRecordPattern2' { 132 66 133 66 134 66 + 135 66 + 136 66 137 66 138 66 139 66 @@ -414,6 +479,8 @@ class 'pkg/TestRecordPattern2' { 13b 66 13c 66 13d 66 + 13e 66 + 13f 66 140 66 141 66 142 66 @@ -428,6 +495,8 @@ class 'pkg/TestRecordPattern2' { 14b 66 14c 66 14d 66 + 14e 66 + 14f 66 150 73 151 73 152 74 diff --git a/testData/results/pkg/TestRecordPattern3.dec b/testData/results/pkg/TestRecordPattern3.dec index ba8bbcb6c3..32968b1eea 100644 --- a/testData/results/pkg/TestRecordPattern3.dec +++ b/testData/results/pkg/TestRecordPattern3.dec @@ -42,6 +42,8 @@ class 'pkg/TestRecordPattern3' { 2 4 3 4 4 4 + 5 4 + 6 4 7 4 8 4 9 4 @@ -50,6 +52,8 @@ class 'pkg/TestRecordPattern3' { 10 4 11 4 12 4 + 13 4 + 14 4 1a 4 1b 5 1c 5 @@ -292,6 +296,8 @@ class 'pkg/TestRecordPattern3' { 10c 29 10d 29 10e 29 + 10f 29 + 110 29 111 31 } } diff --git a/testData/results/pkg/TestRecordPattern4.dec b/testData/results/pkg/TestRecordPattern4.dec index b617b05ac6..332af09f3a 100644 --- a/testData/results/pkg/TestRecordPattern4.dec +++ b/testData/results/pkg/TestRecordPattern4.dec @@ -60,6 +60,8 @@ class 'pkg/TestRecordPattern4' { 2 4 3 4 4 4 + 5 4 + 6 4 7 5 8 5 9 5 @@ -71,6 +73,8 @@ class 'pkg/TestRecordPattern4' { 13 5 14 5 15 5 + 16 5 + 17 5 1d 5 1e 6 1f 6 @@ -83,6 +87,8 @@ class 'pkg/TestRecordPattern4' { 2a 6 2b 6 2c 6 + 2d 6 + 2e 6 34 6 35 7 36 7 @@ -95,6 +101,8 @@ class 'pkg/TestRecordPattern4' { 41 7 42 7 43 7 + 44 7 + 45 7 4b 7 4c 7 4d 8 @@ -108,6 +116,8 @@ class 'pkg/TestRecordPattern4' { 59 8 5a 8 5b 8 + 5c 8 + 5d 8 63 8 64 8 65 9 @@ -121,6 +131,8 @@ class 'pkg/TestRecordPattern4' { 71 9 72 9 73 9 + 74 9 + 75 9 7b 9 7c 9 7d 10 @@ -134,6 +146,8 @@ class 'pkg/TestRecordPattern4' { 89 10 8a 10 8b 10 + 8c 10 + 8d 10 93 10 94 10 95 11 @@ -147,6 +161,8 @@ class 'pkg/TestRecordPattern4' { a1 11 a2 11 a3 11 + a4 11 + a5 11 ab 11 ac 11 ad 12 @@ -160,6 +176,8 @@ class 'pkg/TestRecordPattern4' { b9 12 ba 12 bb 12 + bc 12 + bd 12 c3 12 c4 12 c5 13 @@ -173,6 +191,8 @@ class 'pkg/TestRecordPattern4' { d1 13 d2 13 d3 13 + d4 13 + d5 13 db 13 dc 13 dd 14 @@ -211,6 +231,8 @@ class 'pkg/TestRecordPattern4' { fe 15 ff 15 100 15 + 101 15 + 102 15 103 17 } @@ -220,6 +242,8 @@ class 'pkg/TestRecordPattern4' { 2 20 3 20 4 20 + 5 20 + 6 20 7 21 8 21 9 21 @@ -240,6 +264,8 @@ class 'pkg/TestRecordPattern4' { 1f 22 20 22 21 22 + 22 22 + 23 22 29 22 2a 23 2b 23 @@ -272,6 +298,8 @@ class 'pkg/TestRecordPattern4' { 50 25 51 25 52 25 + 53 25 + 54 25 5a 25 5b 25 5c 26 @@ -303,6 +331,8 @@ class 'pkg/TestRecordPattern4' { 82 28 83 28 84 28 + 85 28 + 86 28 8c 28 8d 28 8e 29 @@ -320,6 +350,8 @@ class 'pkg/TestRecordPattern4' { 9a 30 9b 30 9c 30 + 9d 30 + 9e 30 9f 31 a0 31 a1 31 @@ -402,6 +434,8 @@ class 'pkg/TestRecordPattern4' { 10e 38 10f 38 110 38 + 111 38 + 112 38 118 38 119 38 11a 39 @@ -416,6 +450,8 @@ class 'pkg/TestRecordPattern4' { 127 39 128 39 129 39 + 12a 39 + 12b 39 131 39 132 39 133 40 @@ -461,6 +497,8 @@ class 'pkg/TestRecordPattern4' { 161 42 162 42 163 42 + 164 42 + 165 42 166 49 } } diff --git a/testData/results/pkg/TestRecordPatterns1.dec b/testData/results/pkg/TestRecordPatterns1.dec index 8e804c25a7..3ca59e9400 100644 --- a/testData/results/pkg/TestRecordPatterns1.dec +++ b/testData/results/pkg/TestRecordPatterns1.dec @@ -166,15 +166,21 @@ class 'pkg/TestRecordPatterns1' { 2 5 3 5 4 5 + 5 5 + 6 5 7 6 9 6 a 12 + b 12 + c 12 d 19 e 19 f 36 10 36 12 20 13 23 + 14 23 + 15 23 16 35 17 35 18 37 @@ -192,6 +198,8 @@ class 'pkg/TestRecordPatterns1' { 26 37 27 37 28 37 + 29 37 + 2a 37 2e 31 33 32 34 32 @@ -208,19 +216,27 @@ class 'pkg/TestRecordPatterns1' { 2 43 3 43 4 43 + 5 43 + 6 43 7 44 9 44 a 50 + b 50 + c 50 d 57 e 57 f 74 10 74 12 58 13 61 + 14 61 + 15 61 1a 73 1b 73 1c 73 1d 73 + 1e 73 + 1f 73 25 73 26 73 27 74 @@ -236,6 +252,8 @@ class 'pkg/TestRecordPatterns1' { 31 75 32 75 33 75 + 34 75 + 35 75 39 69 3e 70 3f 70 @@ -252,19 +270,27 @@ class 'pkg/TestRecordPatterns1' { 2 82 3 82 4 82 + 5 82 + 6 82 7 83 9 83 a 89 + b 89 + c 89 d 96 e 96 f 113 10 113 12 97 13 100 + 14 100 + 15 100 1a 112 1b 112 1c 112 1d 112 + 1e 112 + 1f 112 25 112 26 112 27 112 @@ -275,6 +301,8 @@ class 'pkg/TestRecordPatterns1' { 2c 112 2d 112 2e 112 + 2f 112 + 30 112 31 113 32 113 33 113 @@ -288,6 +316,8 @@ class 'pkg/TestRecordPatterns1' { 3b 114 3c 114 3d 114 + 3e 114 + 3f 114 43 108 48 109 49 109 @@ -304,15 +334,21 @@ class 'pkg/TestRecordPatterns1' { 2 121 3 121 4 121 + 5 121 + 6 121 7 122 9 122 a 128 + b 128 + c 128 d 135 e 135 f 152 10 152 12 136 13 139 + 14 139 + 15 139 16 151 17 151 18 153 @@ -330,6 +366,8 @@ class 'pkg/TestRecordPatterns1' { 26 153 27 153 28 153 + 29 153 + 2a 153 2e 147 33 148 34 148 @@ -357,4 +395,4 @@ Lines mapping: 28 <-> 148 29 <-> 153 30 <-> 154 -32 <-> 156 \ No newline at end of file +32 <-> 156 diff --git a/testData/results/pkg/TestRecordPatterns2.dec b/testData/results/pkg/TestRecordPatterns2.dec index cba11be4ce..d8d0a576f6 100644 --- a/testData/results/pkg/TestRecordPatterns2.dec +++ b/testData/results/pkg/TestRecordPatterns2.dec @@ -27,9 +27,13 @@ class 'pkg/TestRecordPatterns2' { 2 4 3 4 4 4 + 5 4 + 6 4 7 5 9 5 a 8 + b 8 + c 8 d 13 e 13 f 14 @@ -39,6 +43,8 @@ class 'pkg/TestRecordPatterns2' { 14 14 15 14 16 14 + 17 14 + 18 14 1c 9 21 10 22 10 diff --git a/testData/results/pkg/TestReturnIf.dec b/testData/results/pkg/TestReturnIf.dec index 6de31e35f2..7dfdb8541f 100644 --- a/testData/results/pkg/TestReturnIf.dec +++ b/testData/results/pkg/TestReturnIf.dec @@ -31,6 +31,8 @@ class 'pkg/TestReturnIf' { 0 4 1 4 2 4 + 3 4 + 4 4 a 4 } @@ -38,6 +40,8 @@ class 'pkg/TestReturnIf' { 0 8 1 8 2 8 + 3 8 + 4 8 a 8 } @@ -45,6 +49,8 @@ class 'pkg/TestReturnIf' { 0 12 1 12 2 12 + 3 12 + 4 12 a 12 } @@ -52,6 +58,8 @@ class 'pkg/TestReturnIf' { 0 16 1 16 2 16 + 3 16 + 4 16 a 16 } @@ -59,6 +67,8 @@ class 'pkg/TestReturnIf' { 0 20 1 20 2 20 + 3 20 + 4 20 a 20 } @@ -66,6 +76,8 @@ class 'pkg/TestReturnIf' { 0 24 1 24 2 24 + 3 24 + 4 24 a 24 } } diff --git a/testData/results/pkg/TestReturnSwitchExpression1.dec b/testData/results/pkg/TestReturnSwitchExpression1.dec index 06e010be72..74e22e8bd2 100644 --- a/testData/results/pkg/TestReturnSwitchExpression1.dec +++ b/testData/results/pkg/TestReturnSwitchExpression1.dec @@ -14,11 +14,38 @@ class 'pkg/TestReturnSwitchExpression1' { method 'test (I)Ljava/lang/String;' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 5 1d 5 21 6 22 6 26 7 + 27 7 28 4 } } diff --git a/testData/results/pkg/TestReturnSwitchExpression2.dec b/testData/results/pkg/TestReturnSwitchExpression2.dec index 4fb339e597..4ef3d86637 100644 --- a/testData/results/pkg/TestReturnSwitchExpression2.dec +++ b/testData/results/pkg/TestReturnSwitchExpression2.dec @@ -18,15 +18,68 @@ class 'pkg/TestReturnSwitchExpression2' { method 'test (I)Ljava/lang/String;' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 5 20 6 24 7 25 4 + 26 4 + 27 4 + 28 4 + 29 4 + 2a 4 + 2b 4 + 2c 4 + 2d 4 + 2e 4 + 2f 4 + 30 4 + 31 4 + 32 4 + 33 4 + 34 4 + 35 4 + 36 4 + 37 4 + 38 4 + 39 4 + 3a 4 + 3b 4 + 3c 4 + 3d 4 + 3e 4 + 3f 4 40 9 41 9 45 10 46 10 4a 11 + 4b 11 4c 4 } } diff --git a/testData/results/pkg/TestReturnSwitchExpression3.dec b/testData/results/pkg/TestReturnSwitchExpression3.dec index 3050159131..22f002d2a1 100644 --- a/testData/results/pkg/TestReturnSwitchExpression3.dec +++ b/testData/results/pkg/TestReturnSwitchExpression3.dec @@ -23,11 +23,39 @@ class 'pkg/TestReturnSwitchExpression3' { 6 4 7 6 8 6 + 9 6 + a 6 + b 6 + c 6 + d 6 + e 6 + f 6 + 10 6 + 11 6 + 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 24 7 25 7 29 8 2a 8 2e 9 + 2f 9 30 6 } } diff --git a/testData/results/pkg/TestReturnSwitchExpression4.dec b/testData/results/pkg/TestReturnSwitchExpression4.dec index 45d786616b..64a41c3c7b 100644 --- a/testData/results/pkg/TestReturnSwitchExpression4.dec +++ b/testData/results/pkg/TestReturnSwitchExpression4.dec @@ -21,12 +21,40 @@ class 'pkg/TestReturnSwitchExpression4' { method 'test (I)Ljava/lang/String;' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 5 1d 5 21 6 22 6 26 8 27 8 + 28 8 + 29 8 2a 9 2b 9 2f 11 @@ -38,6 +66,7 @@ class 'pkg/TestReturnSwitchExpression4' { 35 11 36 11 37 12 + 38 12 39 4 } } diff --git a/testData/results/pkg/TestReturnSwitchExpression5.dec b/testData/results/pkg/TestReturnSwitchExpression5.dec index 81ff5329e4..bb55d55c6b 100644 --- a/testData/results/pkg/TestReturnSwitchExpression5.dec +++ b/testData/results/pkg/TestReturnSwitchExpression5.dec @@ -17,6 +17,32 @@ class 'pkg/TestReturnSwitchExpression5' { method 'test (I)Ljava/lang/String;' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 5 1d 5 21 6 diff --git a/testData/results/pkg/TestReturnTernaryChar.dec b/testData/results/pkg/TestReturnTernaryChar.dec index 1bbe97d104..ab8046ae75 100644 --- a/testData/results/pkg/TestReturnTernaryChar.dec +++ b/testData/results/pkg/TestReturnTernaryChar.dec @@ -23,9 +23,12 @@ class 'pkg/TestReturnTernaryChar' { 4 4 5 4 6 4 + 7 4 + 8 4 9 4 a 4 e 4 + f 4 10 4 } @@ -37,10 +40,14 @@ class 'pkg/TestReturnTernaryChar' { 4 8 5 8 6 8 + 7 8 + 8 8 9 8 a 8 b 8 f 8 + 10 8 + 11 8 12 8 } @@ -52,9 +59,12 @@ class 'pkg/TestReturnTernaryChar' { 4 12 5 12 6 12 + 7 12 + 8 12 9 12 a 12 e 12 + f 12 10 12 } } diff --git a/testData/results/pkg/TestReturnTernaryConstantSimplification.dec b/testData/results/pkg/TestReturnTernaryConstantSimplification.dec index 626649d39f..bfd4daf8c4 100644 --- a/testData/results/pkg/TestReturnTernaryConstantSimplification.dec +++ b/testData/results/pkg/TestReturnTernaryConstantSimplification.dec @@ -42,6 +42,8 @@ class 'pkg/TestReturnTernaryConstantSimplification' { method 'ternaryNotAnd (ZZ)Z' { 0 4 1 4 + 2 4 + 3 4 8 4 9 4 } @@ -49,12 +51,16 @@ class 'pkg/TestReturnTernaryConstantSimplification' { method 'ifOr (ZZ)Z' { 0 8 1 8 + 2 8 + 3 8 6 8 } method 'ternaryNotOr (ZZ)Z' { 0 12 1 12 + 2 12 + 3 12 4 12 9 12 } @@ -62,6 +68,8 @@ class 'pkg/TestReturnTernaryConstantSimplification' { method 'ternaryAnd (ZZ)Z' { 0 16 1 16 + 2 16 + 3 16 4 16 9 16 } @@ -69,38 +77,56 @@ class 'pkg/TestReturnTernaryConstantSimplification' { method 'redundantIf (Z)Z' { 0 20 1 20 + 2 20 + 3 20 } method 'redundantTernary (Z)Z' { 0 24 1 24 + 2 24 + 3 24 9 24 } method 'nestedIf (ZZ)Z' { 0 28 1 28 + 2 28 + 3 28 4 28 5 28 + 6 28 + 7 28 a 28 } method 'nestedTernary (ZZ)Z' { 0 32 1 32 + 2 32 + 3 32 4 32 5 32 + 6 32 + 7 32 11 32 } method 'nestedIfs (ZZZ)Z' { 0 36 1 36 + 2 36 + 3 36 4 36 5 36 + 6 36 + 7 36 a 36 c 36 d 36 + e 36 + f 36 12 36 } } diff --git a/testData/results/pkg/TestRunSuspend.dec b/testData/results/pkg/TestRunSuspend.dec index 90f42eaf7d..b1c27c6c06 100644 --- a/testData/results/pkg/TestRunSuspend.dec +++ b/testData/results/pkg/TestRunSuspend.dec @@ -83,6 +83,8 @@ class 'pkg/TestRunSuspend' { c 37 d 38 e 38 + f 38 + 10 38 11 44 12 44 13 44 diff --git a/testData/results/pkg/TestSelfIterableLoop.dec b/testData/results/pkg/TestSelfIterableLoop.dec index 4cd25667ad..8072c7085b 100644 --- a/testData/results/pkg/TestSelfIterableLoop.dec +++ b/testData/results/pkg/TestSelfIterableLoop.dec @@ -37,6 +37,8 @@ class 'pkg/TestSelfIterableLoop' { 19 7 1a 7 1b 7 + 1c 7 + 1d 7 1e 8 1f 8 20 8 diff --git a/testData/results/pkg/TestShiftLoop.dec b/testData/results/pkg/TestShiftLoop.dec index 972046ffc6..6abecdc49d 100644 --- a/testData/results/pkg/TestShiftLoop.dec +++ b/testData/results/pkg/TestShiftLoop.dec @@ -23,6 +23,8 @@ class 'pkg/TestShiftLoop' { 6 6 7 6 8 6 + 9 6 + a 6 c 7 e 7 f 6 diff --git a/testData/results/pkg/TestSimpleIf.dec b/testData/results/pkg/TestSimpleIf.dec index 29891baff0..8d19f1512a 100644 --- a/testData/results/pkg/TestSimpleIf.dec +++ b/testData/results/pkg/TestSimpleIf.dec @@ -20,18 +20,24 @@ class 'pkg/TestSimpleIf' { method 'test (I)V' { 0 4 1 4 + 2 4 + 3 4 4 5 5 5 6 5 7 5 8 5 9 5 + a 5 + b 5 c 7 } method 'test2 (I)V' { 0 10 1 10 + 2 10 + 3 10 4 11 5 11 6 11 @@ -46,6 +52,8 @@ class 'pkg/TestSimpleIf' { 12 13 13 13 14 13 + 15 13 + 16 13 17 15 } } diff --git a/testData/results/pkg/TestSimpleWhile.dec b/testData/results/pkg/TestSimpleWhile.dec index bf148c9e99..5892ea2d64 100644 --- a/testData/results/pkg/TestSimpleWhile.dec +++ b/testData/results/pkg/TestSimpleWhile.dec @@ -15,6 +15,8 @@ class 'pkg/TestSimpleWhile' { 1 4 2 4 3 4 + 4 4 + 5 4 6 5 7 5 8 5 diff --git a/testData/results/pkg/TestSingleCaseStrSwitch.dec b/testData/results/pkg/TestSingleCaseStrSwitch.dec index 93a4455962..35176833a3 100644 --- a/testData/results/pkg/TestSingleCaseStrSwitch.dec +++ b/testData/results/pkg/TestSingleCaseStrSwitch.dec @@ -27,6 +27,25 @@ class 'pkg/TestSingleCaseStrSwitch' { 6 5 7 5 8 5 + 9 5 + a 5 + b 5 + c 5 + d 5 + e 5 + f 5 + 10 5 + 11 5 + 12 5 + 13 5 + 14 5 + 15 5 + 16 5 + 17 5 + 18 5 + 19 5 + 1a 5 + 1b 5 1c 7 1d 7 1e 7 @@ -34,10 +53,31 @@ class 'pkg/TestSingleCaseStrSwitch' { 20 7 21 7 22 7 + 23 7 + 24 7 25 8 26 8 27 11 28 11 + 29 11 + 2a 11 + 2b 11 + 2c 11 + 2d 11 + 2e 11 + 2f 11 + 30 11 + 31 11 + 32 11 + 33 11 + 34 11 + 35 11 + 36 11 + 37 11 + 38 11 + 39 11 + 3a 11 + 3b 11 3c 12 3d 12 41 13 diff --git a/testData/results/pkg/TestSplitColorComponents.dec b/testData/results/pkg/TestSplitColorComponents.dec index 4523d57fcd..816907b461 100644 --- a/testData/results/pkg/TestSplitColorComponents.dec +++ b/testData/results/pkg/TestSplitColorComponents.dec @@ -21,6 +21,8 @@ class 'pkg/TestSplitColorComponents' { 3 4 4 4 5 4 + 6 4 + 7 4 8 5 9 5 a 5 diff --git a/testData/results/pkg/TestStaticBlockFinalField.dec b/testData/results/pkg/TestStaticBlockFinalField.dec index 9c766c78ab..f909fd65eb 100644 --- a/testData/results/pkg/TestStaticBlockFinalField.dec +++ b/testData/results/pkg/TestStaticBlockFinalField.dec @@ -48,4 +48,4 @@ Lines mapping: 9 <-> 8 10 <-> 9 11 <-> 10 -12 <-> 11 \ No newline at end of file +12 <-> 11 diff --git a/testData/results/pkg/TestStringConcat.dec b/testData/results/pkg/TestStringConcat.dec index 8d508d3ea6..33fb9eea04 100644 --- a/testData/results/pkg/TestStringConcat.dec +++ b/testData/results/pkg/TestStringConcat.dec @@ -183,4 +183,4 @@ Lines mapping: 42 <-> 27 43 <-> 28 46 <-> 31 -47 <-> 32 \ No newline at end of file +47 <-> 32 diff --git a/testData/results/pkg/TestStringLiteral.dec b/testData/results/pkg/TestStringLiteral.dec index 337ef27d03..a579cfedeb 100644 --- a/testData/results/pkg/TestStringLiteral.dec +++ b/testData/results/pkg/TestStringLiteral.dec @@ -47,12 +47,16 @@ class 'pkg/TestStringLiteral' { 5 9 6 9 7 9 + 8 9 + 9 9 a 10 b 10 c 10 d 10 e 10 f 10 + 10 10 + 11 10 12 12 } diff --git a/testData/results/pkg/TestSuspendLambdaKt.dec b/testData/results/pkg/TestSuspendLambdaKt.dec index c37bc7901f..41ac47e9fd 100644 --- a/testData/results/pkg/TestSuspendLambdaKt.dec +++ b/testData/results/pkg/TestSuspendLambdaKt.dec @@ -110,6 +110,25 @@ class 'pkg/TestSuspendLambdaKt$sl1$1' { 6 56 7 56 8 56 + 9 56 + a 56 + b 56 + c 56 + d 56 + e 56 + f 56 + 10 56 + 11 56 + 12 56 + 13 56 + 14 56 + 15 56 + 16 56 + 17 56 + 18 56 + 19 56 + 1a 56 + 1b 56 1c 58 1d 58 1e 58 diff --git a/testData/results/pkg/TestSwitchAssign.dec b/testData/results/pkg/TestSwitchAssign.dec index 29a62d9ab7..06c1c3bf6c 100644 --- a/testData/results/pkg/TestSwitchAssign.dec +++ b/testData/results/pkg/TestSwitchAssign.dec @@ -42,6 +42,42 @@ class 'pkg/TestSwitchAssign' { 1 4 2 5 3 5 + 4 5 + 5 5 + 6 5 + 7 5 + 8 5 + 9 5 + a 5 + b 5 + c 5 + d 5 + e 5 + f 5 + 10 5 + 11 5 + 12 5 + 13 5 + 14 5 + 15 5 + 16 5 + 17 5 + 18 5 + 19 5 + 1a 5 + 1b 5 + 1c 5 + 1d 5 + 1e 5 + 1f 5 + 20 5 + 21 5 + 22 5 + 23 5 + 24 5 + 25 5 + 26 5 + 27 5 28 9 29 9 2a 10 @@ -67,6 +103,37 @@ class 'pkg/TestSwitchAssign' { 4b 30 4c 30 58 22 + 59 22 + 5a 22 + 5b 22 + 5c 22 + 5d 22 + 5e 22 + 5f 22 + 60 22 + 61 22 + 62 22 + 63 22 + 64 22 + 65 22 + 66 22 + 67 22 + 68 22 + 69 22 + 6a 22 + 6b 22 + 6c 22 + 6d 22 + 6e 22 + 6f 22 + 70 22 + 71 22 + 72 22 + 73 22 + 74 22 + 75 22 + 76 22 + 77 22 78 25 79 25 7a 26 diff --git a/testData/results/pkg/TestSwitchDefaultBefore.dec b/testData/results/pkg/TestSwitchDefaultBefore.dec index f324be0ce0..4f9c1e3d19 100644 --- a/testData/results/pkg/TestSwitchDefaultBefore.dec +++ b/testData/results/pkg/TestSwitchDefaultBefore.dec @@ -41,6 +41,37 @@ class 'pkg/TestSwitchDefaultBefore' { 41 11 42 11 4c 4 + 4d 4 + 4e 4 + 4f 4 + 50 4 + 51 4 + 52 4 + 53 4 + 54 4 + 55 4 + 56 4 + 57 4 + 58 4 + 59 4 + 5a 4 + 5b 4 + 5c 4 + 5d 4 + 5e 4 + 5f 4 + 60 4 + 61 4 + 62 4 + 63 4 + 64 4 + 65 4 + 66 4 + 67 4 + 68 4 + 69 4 + 6a 4 + 6b 4 6c 6 6d 6 6e 6 @@ -62,12 +93,40 @@ class 'pkg/TestSwitchDefaultBefore' { 82 13 83 13 84 13 + 85 13 + 86 13 87 15 } method 'test2 (I)V' { 0 18 1 18 + 2 18 + 3 18 + 4 18 + 5 18 + 6 18 + 7 18 + 8 18 + 9 18 + a 18 + b 18 + c 18 + d 18 + e 18 + f 18 + 10 18 + 11 18 + 12 18 + 13 18 + 14 18 + 15 18 + 16 18 + 17 18 + 18 18 + 19 18 + 1a 18 + 1b 18 1c 20 1d 20 1e 20 @@ -89,6 +148,8 @@ class 'pkg/TestSwitchDefaultBefore' { 32 27 33 27 34 27 + 35 27 + 36 27 37 29 } } diff --git a/testData/results/pkg/TestSwitchDefaultCaseReturn.dec b/testData/results/pkg/TestSwitchDefaultCaseReturn.dec index 43ba6b4177..049736ddf0 100644 --- a/testData/results/pkg/TestSwitchDefaultCaseReturn.dec +++ b/testData/results/pkg/TestSwitchDefaultCaseReturn.dec @@ -41,6 +41,8 @@ class 'pkg/TestSwitchDefaultCaseReturn' { 2 4 3 4 4 4 + 5 4 + 6 4 7 5 b 5 29 6 @@ -48,6 +50,31 @@ class 'pkg/TestSwitchDefaultCaseReturn' { 37 6 38 6 42 5 + 43 5 + 44 5 + 45 5 + 46 5 + 47 5 + 48 5 + 49 5 + 4a 5 + 4b 5 + 4c 5 + 4d 5 + 4e 5 + 4f 5 + 50 5 + 51 5 + 52 5 + 53 5 + 54 5 + 55 5 + 56 5 + 57 5 + 58 5 + 59 5 + 5a 5 + 5b 5 5c 6 5d 6 61 7 @@ -68,18 +95,50 @@ class 'pkg/TestSwitchDefaultCaseReturn' { a0 16 a1 16 ad 14 + ae 14 + af 14 + b0 14 + b1 14 + b2 14 + b3 14 + b4 14 + b5 14 + b6 14 + b7 14 + b8 14 + b9 14 + ba 14 + bb 14 + bc 14 + bd 14 + be 14 + bf 14 + c0 14 + c1 14 + c2 14 + c3 14 + c4 14 + c5 14 + c6 14 + c7 14 c8 17 c9 17 ca 17 cb 20 cc 20 + cd 20 + ce 20 cf 20 d0 20 + d1 20 + d2 20 d3 21 d4 21 d5 21 d6 24 d7 24 + d8 24 + d9 24 da 25 db 25 dc 25 @@ -93,6 +152,8 @@ class 'pkg/TestSwitchDefaultCaseReturn' { e4 28 e5 28 e6 28 + e7 28 + e8 28 e9 29 ea 29 } diff --git a/testData/results/pkg/TestSwitchExprInvoc.dec b/testData/results/pkg/TestSwitchExprInvoc.dec index 349179c91a..ca5c15edc9 100644 --- a/testData/results/pkg/TestSwitchExprInvoc.dec +++ b/testData/results/pkg/TestSwitchExprInvoc.dec @@ -14,11 +14,38 @@ class 'pkg/TestSwitchExprInvoc' { method 'test (I)V' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 5 1d 5 21 6 22 6 26 7 + 27 7 28 8 29 8 2a 8 diff --git a/testData/results/pkg/TestSwitchExprString1.dec b/testData/results/pkg/TestSwitchExprString1.dec index 905adb2f1b..d5728aeb50 100644 --- a/testData/results/pkg/TestSwitchExprString1.dec +++ b/testData/results/pkg/TestSwitchExprString1.dec @@ -30,6 +30,8 @@ class 'pkg/TestSwitchExprString1' { method 'get (Ljava/lang/String;)Lpkg/TestSwitchExprString1$Type;' { 0 4 1 4 + 2 4 + 3 4 4 5 5 5 6 5 @@ -42,6 +44,25 @@ class 'pkg/TestSwitchExprString1' { e 8 f 8 10 8 + 11 8 + 12 8 + 13 8 + 14 8 + 15 8 + 16 8 + 17 8 + 18 8 + 19 8 + 1a 8 + 1b 8 + 1c 8 + 1d 8 + 1e 8 + 1f 8 + 20 8 + 21 8 + 22 8 + 23 8 24 10 25 10 26 10 @@ -49,14 +70,37 @@ class 'pkg/TestSwitchExprString1' { 28 10 29 10 2a 10 + 2b 10 + 2c 10 2d 11 2e 11 2f 14 30 14 + 31 14 + 32 14 + 33 14 + 34 14 + 35 14 + 36 14 + 37 14 + 38 14 + 39 14 + 3a 14 + 3b 14 + 3c 14 + 3d 14 + 3e 14 + 3f 14 + 40 14 + 41 14 + 42 14 + 43 14 44 15 45 15 46 15 4a 16 + 4b 16 + 4c 16 4d 14 } } diff --git a/testData/results/pkg/TestSwitchExpressionFallthrough1.dec b/testData/results/pkg/TestSwitchExpressionFallthrough1.dec index d118675c8c..cc2d388087 100644 --- a/testData/results/pkg/TestSwitchExpressionFallthrough1.dec +++ b/testData/results/pkg/TestSwitchExpressionFallthrough1.dec @@ -24,11 +24,43 @@ class 'pkg/TestSwitchExpressionFallthrough1' { method 'test (I)V' { 0 5 1 5 + 2 5 + 3 5 + 4 5 + 5 5 + 6 5 + 7 5 + 8 5 + 9 5 + a 5 + b 5 + c 5 + d 5 + e 5 + f 5 + 10 5 + 11 5 + 12 5 + 13 5 + 14 5 + 15 5 + 16 5 + 17 5 + 18 5 + 19 5 + 1a 5 + 1b 5 + 1c 5 + 1d 5 + 1e 5 + 1f 5 20 7 21 7 22 7 23 7 24 7 + 25 7 + 26 7 27 11 28 12 2b 14 diff --git a/testData/results/pkg/TestSwitchExpressionNested1.dec b/testData/results/pkg/TestSwitchExpressionNested1.dec index 8bb79101d9..05ba13f466 100644 --- a/testData/results/pkg/TestSwitchExpressionNested1.dec +++ b/testData/results/pkg/TestSwitchExpressionNested1.dec @@ -29,11 +29,65 @@ class 'pkg/TestSwitchExpressionNested1' { 3 6 7 6 8 6 + 9 6 + a 6 + b 6 + c 6 + d 6 + e 6 + f 6 + 10 6 + 11 6 + 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 24 7 28 8 2f 10 33 10 34 10 + 35 10 + 36 10 + 37 10 + 38 10 + 39 10 + 3a 10 + 3b 10 + 3c 10 + 3d 10 + 3e 10 + 3f 10 + 40 10 + 41 10 + 42 10 + 43 10 + 44 10 + 45 10 + 46 10 + 47 10 + 48 10 + 49 10 + 4a 10 + 4b 10 + 4c 10 + 4d 10 + 4e 10 + 4f 10 50 12 54 14 58 16 diff --git a/testData/results/pkg/TestSwitchExpressionPPMM.dec b/testData/results/pkg/TestSwitchExpressionPPMM.dec index af6105ecec..81e72d9322 100644 --- a/testData/results/pkg/TestSwitchExpressionPPMM.dec +++ b/testData/results/pkg/TestSwitchExpressionPPMM.dec @@ -28,6 +28,36 @@ class 'pkg/TestSwitchExpressionPPMM' { 7 6 8 6 9 6 + a 6 + b 6 + c 6 + d 6 + e 6 + f 6 + 10 6 + 11 6 + 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 + 24 6 + 25 6 + 26 6 + 27 6 29 7 2a 7 2b 7 diff --git a/testData/results/pkg/TestSwitchFinally.dec b/testData/results/pkg/TestSwitchFinally.dec index dc75183c2b..668465ae88 100644 --- a/testData/results/pkg/TestSwitchFinally.dec +++ b/testData/results/pkg/TestSwitchFinally.dec @@ -49,24 +49,24 @@ public class TestSwitchFinally { try { System.out.println(1);// 57 } finally { - System.out.println("finally"); + System.out.println("finally");// 59 switch (i) {// 61 case 0: System.out.println("0");// 63 break;// 64 case 1: System.out.println("1");// 66 - System.out.println("c");// 67 69 72 74 76 77 80 + System.out.println("c");// 67 80 return 0;// 81 default: - System.out.println("Default"); + System.out.println("Default");// 69 } - System.out.println("b"); + System.out.println("b");// 72 } - System.out.println("d");// 59 - return 1; + System.out.println("d");// 74 76 + return 1;// 77 } } @@ -77,6 +77,8 @@ class 'pkg/TestSwitchFinally' { 2 5 3 5 4 5 + 5 5 + 6 5 34 15 38 7 39 7 @@ -88,18 +90,40 @@ class 'pkg/TestSwitchFinally' { 3f 7 40 8 41 8 + 42 8 + 43 8 + 44 8 + 45 8 + 46 8 + 47 8 + 48 8 + 49 8 + 4a 8 + 4b 8 + 4c 8 + 4d 8 + 4e 8 + 4f 8 + 50 8 + 51 8 + 52 8 + 53 8 54 10 55 10 56 10 57 10 58 10 59 10 + 5a 10 + 5b 10 5c 13 5d 13 5e 13 5f 13 60 13 61 13 + 62 13 + 63 13 } method 'test1 (I)V' { @@ -108,6 +132,8 @@ class 'pkg/TestSwitchFinally' { 2 19 3 19 4 19 + 5 19 + 6 19 47 32 4b 21 4c 21 @@ -119,6 +145,33 @@ class 'pkg/TestSwitchFinally' { 52 21 53 22 54 22 + 55 22 + 56 22 + 57 22 + 58 22 + 59 22 + 5a 22 + 5b 22 + 5c 22 + 5d 22 + 5e 22 + 5f 22 + 60 22 + 61 22 + 62 22 + 63 22 + 64 22 + 65 22 + 66 22 + 67 22 + 68 22 + 69 22 + 6a 22 + 6b 22 + 6c 22 + 6d 22 + 6e 22 + 6f 22 70 24 71 24 72 24 @@ -134,12 +187,16 @@ class 'pkg/TestSwitchFinally' { 7e 27 7f 27 80 27 + 81 27 + 82 27 83 30 84 30 85 30 86 30 87 30 88 30 + 89 30 + 8a 30 } method 'test2 (I)V' { @@ -148,6 +205,8 @@ class 'pkg/TestSwitchFinally' { 2 36 3 36 4 36 + 5 36 + 6 36 2c 45 30 38 31 38 @@ -159,6 +218,16 @@ class 'pkg/TestSwitchFinally' { 37 38 38 39 39 39 + 3a 39 + 3b 39 + 3c 39 + 3d 39 + 3e 39 + 3f 39 + 40 39 + 41 39 + 42 39 + 43 39 44 41 45 41 46 41 @@ -173,6 +242,8 @@ class 'pkg/TestSwitchFinally' { 4f 42 50 42 51 42 + 52 42 + 53 42 } method 'test3 (I)I' { @@ -181,10 +252,11 @@ class 'pkg/TestSwitchFinally' { 2 49 3 49 4 49 + 5 49 + 6 49 52 67 53 67 54 67 - 55 67 56 51 57 51 58 51 @@ -195,30 +267,30 @@ class 'pkg/TestSwitchFinally' { 5d 51 5e 52 5f 52 - 60 67 - 61 67 - 62 67 - 63 67 - 64 67 - 65 67 - 66 67 - 67 67 - 68 67 - 69 67 - 6a 67 - 6b 67 - 6c 67 - 6d 67 - 6e 67 - 6f 67 - 70 67 - 71 67 - 72 67 - 73 67 - 74 67 - 75 67 - 76 67 - 77 67 + 60 52 + 61 52 + 62 52 + 63 52 + 64 52 + 65 52 + 66 52 + 67 52 + 68 52 + 69 52 + 6a 52 + 6b 52 + 6c 52 + 6d 52 + 6e 52 + 6f 52 + 70 52 + 71 52 + 72 52 + 73 52 + 74 52 + 75 52 + 76 52 + 77 52 78 54 79 54 7a 54 @@ -228,8 +300,6 @@ class 'pkg/TestSwitchFinally' { 7e 54 7f 54 80 55 - 81 67 - 82 67 83 57 84 57 85 57 @@ -241,42 +311,33 @@ class 'pkg/TestSwitchFinally' { 8b 58 8c 58 8d 58 - 8e 58 - 8f 58 - 90 58 - 91 58 - 92 58 - 93 58 - 94 58 - 95 58 - 96 58 - 97 58 - 98 58 - 99 58 - 9a 58 - 9b 58 - 9c 58 - 9d 58 - 9e 58 - 9f 58 - a0 58 - a1 58 - a2 58 - a3 58 - a4 58 - a5 58 - a6 58 - a7 58 - a8 58 - a9 58 + 8e 61 + 8f 61 + 90 61 + 91 61 + 92 61 + 93 61 + 94 61 + 95 61 + 96 64 + 97 64 + 98 64 + 99 64 + 9a 64 + 9b 64 + 9c 64 + 9d 64 + a0 67 + a1 67 + a3 67 + a4 67 + a5 67 + a8 68 aa 58 ab 58 - ac 58 ad 58 ae 58 - af 59 - b0 59 - b1 59 + af 58 b2 59 } } @@ -303,17 +364,17 @@ Lines mapping: 50 <-> 43 51 <-> 46 57 <-> 50 -59 <-> 68 +59 <-> 52 61 <-> 53 63 <-> 55 64 <-> 56 66 <-> 58 67 <-> 59 -69 <-> 59 -72 <-> 59 -74 <-> 59 -76 <-> 59 -77 <-> 59 +69 <-> 62 +72 <-> 65 +74 <-> 68 +76 <-> 68 +77 <-> 69 80 <-> 59 81 <-> 60 Not mapped: diff --git a/testData/results/pkg/TestSwitchInTry.dec b/testData/results/pkg/TestSwitchInTry.dec index b80405d1d0..347e59dc17 100644 --- a/testData/results/pkg/TestSwitchInTry.dec +++ b/testData/results/pkg/TestSwitchInTry.dec @@ -56,6 +56,22 @@ class 'pkg/TestSwitchInTry' { 21 12 22 12 23 12 + 24 12 + 25 12 + 26 12 + 27 12 + 28 12 + 29 12 + 2a 12 + 2b 12 + 2c 12 + 2d 12 + 2e 12 + 2f 12 + 30 12 + 31 12 + 32 12 + 33 12 34 14 35 14 36 14 @@ -64,12 +80,30 @@ class 'pkg/TestSwitchInTry' { 39 14 3a 14 3b 14 + 3c 14 + 3d 14 3e 15 3f 15 40 15 41 18 42 18 43 18 + 44 18 + 45 18 + 46 18 + 47 18 + 48 18 + 49 18 + 4a 18 + 4b 18 + 4c 18 + 4d 18 + 4e 18 + 4f 18 + 50 18 + 51 18 + 52 18 + 53 18 54 20 55 20 56 20 diff --git a/testData/results/pkg/TestSwitchLoop.dec b/testData/results/pkg/TestSwitchLoop.dec index f886572272..ed8fc9c1aa 100644 --- a/testData/results/pkg/TestSwitchLoop.dec +++ b/testData/results/pkg/TestSwitchLoop.dec @@ -327,11 +327,40 @@ class 'pkg/TestSwitchLoop' { method 'test (I)V' { 0 4 1 4 + 2 4 + 3 4 4 5 5 5 6 5 7 6 8 6 + 9 6 + a 6 + b 6 + c 6 + d 6 + e 6 + f 6 + 10 6 + 11 6 + 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 24 8 25 8 26 8 @@ -370,6 +399,8 @@ class 'pkg/TestSwitchLoop' { 4d 18 4e 18 4f 18 + 50 18 + 51 18 55 19 } @@ -379,11 +410,45 @@ class 'pkg/TestSwitchLoop' { 2 26 3 26 4 26 + 5 26 + 6 26 7 27 8 27 9 27 a 28 b 28 + c 28 + d 28 + e 28 + f 28 + 10 28 + 11 28 + 12 28 + 13 28 + 14 28 + 15 28 + 16 28 + 17 28 + 18 28 + 19 28 + 1a 28 + 1b 28 + 1c 28 + 1d 28 + 1e 28 + 1f 28 + 20 28 + 21 28 + 22 28 + 23 28 + 24 28 + 25 28 + 26 28 + 27 28 + 28 28 + 29 28 + 2a 28 + 2b 28 2c 30 2d 30 2e 30 @@ -450,11 +515,45 @@ class 'pkg/TestSwitchLoop' { 2 54 3 54 4 54 + 5 54 + 6 54 7 55 8 55 9 55 a 56 b 56 + c 56 + d 56 + e 56 + f 56 + 10 56 + 11 56 + 12 56 + 13 56 + 14 56 + 15 56 + 16 56 + 17 56 + 18 56 + 19 56 + 1a 56 + 1b 56 + 1c 56 + 1d 56 + 1e 56 + 1f 56 + 20 56 + 21 56 + 22 56 + 23 56 + 24 56 + 25 56 + 26 56 + 27 56 + 28 56 + 29 56 + 2a 56 + 2b 56 2c 58 2d 58 2e 58 @@ -531,11 +630,37 @@ class 'pkg/TestSwitchLoop' { 2 82 3 82 4 82 + 5 82 + 6 82 7 83 8 83 9 83 a 84 b 84 + c 84 + d 84 + e 84 + f 84 + 10 84 + 11 84 + 12 84 + 13 84 + 14 84 + 15 84 + 16 84 + 17 84 + 18 84 + 19 84 + 1a 84 + 1b 84 + 1c 84 + 1d 84 + 1e 84 + 1f 84 + 20 84 + 21 84 + 22 84 + 23 84 24 86 25 86 26 86 @@ -546,18 +671,24 @@ class 'pkg/TestSwitchLoop' { 2b 86 2c 87 2d 87 + 2e 87 + 2f 87 33 92 34 92 35 92 36 92 37 92 38 92 + 39 92 + 3a 92 3b 95 3c 95 3d 95 3e 95 3f 95 40 95 + 41 95 + 42 95 43 82 44 82 45 82 @@ -578,11 +709,37 @@ class 'pkg/TestSwitchLoop' { 2 106 3 106 4 106 + 5 106 + 6 106 7 107 8 107 9 107 a 109 b 109 + c 109 + d 109 + e 109 + f 109 + 10 109 + 11 109 + 12 109 + 13 109 + 14 109 + 15 109 + 16 109 + 17 109 + 18 109 + 19 109 + 1a 109 + 1b 109 + 1c 109 + 1d 109 + 1e 109 + 1f 109 + 20 109 + 21 109 + 22 109 + 23 109 24 111 25 111 26 111 @@ -596,8 +753,37 @@ class 'pkg/TestSwitchLoop' { 2e 115 2f 115 30 115 + 31 115 + 32 115 33 119 34 119 + 35 119 + 36 119 + 37 119 + 38 119 + 39 119 + 3a 119 + 3b 119 + 3c 119 + 3d 119 + 3e 119 + 3f 119 + 40 119 + 41 119 + 42 119 + 43 119 + 44 119 + 45 119 + 46 119 + 47 119 + 48 119 + 49 119 + 4a 119 + 4b 119 + 4c 119 + 4d 119 + 4e 119 + 4f 119 50 121 51 121 52 121 @@ -624,6 +810,8 @@ class 'pkg/TestSwitchLoop' { 71 133 72 133 73 133 + 74 133 + 75 133 76 143 77 143 78 143 @@ -653,8 +841,28 @@ class 'pkg/TestSwitchLoop' { 3 152 4 152 5 152 + 6 152 + 7 152 8 153 9 153 + a 153 + b 153 + c 153 + d 153 + e 153 + f 153 + 10 153 + 11 153 + 12 153 + 13 153 + 14 153 + 15 153 + 16 153 + 17 153 + 18 153 + 19 153 + 1a 153 + 1b 153 1c 155 1d 155 1e 155 @@ -668,8 +876,29 @@ class 'pkg/TestSwitchLoop' { 26 157 27 157 28 157 + 29 157 + 2a 157 2b 158 2c 158 + 2d 158 + 2e 158 + 2f 158 + 30 158 + 31 158 + 32 158 + 33 158 + 34 158 + 35 158 + 36 158 + 37 158 + 38 158 + 39 158 + 3a 158 + 3b 158 + 3c 158 + 3d 158 + 3e 158 + 3f 158 40 160 41 160 42 160 @@ -710,13 +939,36 @@ class 'pkg/TestSwitchLoop' { 3 175 4 175 5 175 + 6 175 + 7 175 8 176 9 176 a 176 b 176 c 176 + d 176 + e 176 f 177 10 177 + 11 177 + 12 177 + 13 177 + 14 177 + 15 177 + 16 177 + 17 177 + 18 177 + 19 177 + 1a 177 + 1b 177 + 1c 177 + 1d 177 + 1e 177 + 1f 177 + 20 177 + 21 177 + 22 177 + 23 177 24 179 25 179 26 179 @@ -753,15 +1005,45 @@ class 'pkg/TestSwitchLoop' { method 'test8 (I)V' { 0 191 1 191 + 2 191 + 3 191 + 4 191 + 5 191 + 6 191 + 7 191 + 8 191 + 9 191 + a 191 + b 191 + c 191 + d 191 + e 191 + f 191 + 10 191 + 11 191 + 12 191 + 13 191 + 14 191 + 15 191 + 16 191 + 17 191 + 18 191 + 19 191 + 1a 191 + 1b 191 1c 193 1d 193 1e 196 1f 196 20 196 21 196 + 22 196 + 23 196 24 201 25 201 26 201 + 27 201 + 28 201 2c 205 2d 205 2e 205 @@ -770,17 +1052,23 @@ class 'pkg/TestSwitchLoop' { 34 197 35 197 36 197 + 37 197 + 38 197 39 208 3a 208 3b 208 3c 208 3d 208 3e 208 + 3f 208 + 40 208 41 210 42 210 43 210 44 210 45 210 + 46 210 + 47 210 48 213 49 213 4a 213 @@ -795,15 +1083,45 @@ class 'pkg/TestSwitchLoop' { method 'test9 (I)V' { 0 218 1 218 + 2 218 + 3 218 + 4 218 + 5 218 + 6 218 + 7 218 + 8 218 + 9 218 + a 218 + b 218 + c 218 + d 218 + e 218 + f 218 + 10 218 + 11 218 + 12 218 + 13 218 + 14 218 + 15 218 + 16 218 + 17 218 + 18 218 + 19 218 + 1a 218 + 1b 218 1c 220 1d 220 1e 223 1f 223 20 223 21 223 + 22 223 + 23 223 24 228 25 228 26 228 + 27 228 + 28 228 2c 233 2d 233 2e 233 @@ -821,11 +1139,15 @@ class 'pkg/TestSwitchLoop' { 3f 229 40 229 41 229 + 42 229 + 43 229 44 236 45 236 46 236 47 236 48 236 + 49 236 + 4a 236 4b 239 4c 239 4d 239 @@ -840,19 +1162,51 @@ class 'pkg/TestSwitchLoop' { method 'test10 (I)V' { 0 245 1 245 + 2 245 + 3 245 + 4 245 + 5 245 + 6 245 + 7 245 + 8 245 + 9 245 + a 245 + b 245 + c 245 + d 245 + e 245 + f 245 + 10 245 + 11 245 + 12 245 + 13 245 + 14 245 + 15 245 + 16 245 + 17 245 + 18 245 + 19 245 + 1a 245 + 1b 245 1c 247 1d 247 1e 250 1f 250 20 250 21 250 + 22 250 + 23 250 24 254 25 254 26 254 + 27 254 + 28 254 2c 259 2d 259 2e 259 2f 259 + 30 259 + 31 259 35 263 36 263 37 263 @@ -869,11 +1223,15 @@ class 'pkg/TestSwitchLoop' { 48 255 49 255 4a 255 + 4b 255 + 4c 255 4d 271 4e 271 4f 271 50 271 51 271 + 52 271 + 53 271 54 278 55 278 56 278 @@ -888,19 +1246,51 @@ class 'pkg/TestSwitchLoop' { method 'test10b (I)V' { 0 285 1 285 + 2 285 + 3 285 + 4 285 + 5 285 + 6 285 + 7 285 + 8 285 + 9 285 + a 285 + b 285 + c 285 + d 285 + e 285 + f 285 + 10 285 + 11 285 + 12 285 + 13 285 + 14 285 + 15 285 + 16 285 + 17 285 + 18 285 + 19 285 + 1a 285 + 1b 285 1c 287 1d 287 1e 290 1f 290 20 290 21 290 + 22 290 + 23 290 24 294 25 294 26 294 + 27 294 + 28 294 2c 299 2d 299 2e 299 2f 299 + 30 299 + 31 299 35 303 36 303 37 303 @@ -917,6 +1307,8 @@ class 'pkg/TestSwitchLoop' { 48 295 49 295 4a 295 + 4b 295 + 4c 295 4d 314 4e 314 4f 314 @@ -930,6 +1322,8 @@ class 'pkg/TestSwitchLoop' { 59 306 5a 306 5b 306 + 5c 306 + 5d 306 5e 321 5f 321 60 321 diff --git a/testData/results/pkg/TestSwitchOnEnum.dec b/testData/results/pkg/TestSwitchOnEnum.dec index a0a8742010..95658ed8f2 100644 --- a/testData/results/pkg/TestSwitchOnEnum.dec +++ b/testData/results/pkg/TestSwitchOnEnum.dec @@ -52,6 +52,33 @@ class 'pkg/TestSwitchOnEnum' { 3 8 7 8 8 8 + 9 8 + a 8 + b 8 + c 8 + d 8 + e 8 + f 8 + 10 8 + 11 8 + 12 8 + 13 8 + 14 8 + 15 8 + 16 8 + 17 8 + 18 8 + 19 8 + 1a 8 + 1b 8 + 1c 8 + 1d 8 + 1e 8 + 1f 8 + 20 8 + 21 8 + 22 8 + 23 8 24 10 25 10 26 12 @@ -66,6 +93,33 @@ class 'pkg/TestSwitchOnEnum$Example' { 3 20 7 20 8 20 + 9 20 + a 20 + b 20 + c 20 + d 20 + e 20 + f 20 + 10 20 + 11 20 + 12 20 + 13 20 + 14 20 + 15 20 + 16 20 + 17 20 + 18 20 + 19 20 + 1a 20 + 1b 20 + 1c 20 + 1d 20 + 1e 20 + 1f 20 + 20 20 + 21 20 + 22 20 + 23 20 24 22 25 22 26 22 @@ -81,9 +135,35 @@ class 'pkg/TestSwitchOnEnum$Example' { 32 25 33 25 34 25 + 35 25 + 36 25 3a 28 3e 28 3f 28 + 40 28 + 41 28 + 42 28 + 43 28 + 44 28 + 45 28 + 46 28 + 47 28 + 48 28 + 49 28 + 4a 28 + 4b 28 + 4c 28 + 4d 28 + 4e 28 + 4f 28 + 50 28 + 51 28 + 52 28 + 53 28 + 54 28 + 55 28 + 56 28 + 57 28 58 30 59 30 5a 30 @@ -99,6 +179,8 @@ class 'pkg/TestSwitchOnEnum$Example' { 66 33 67 33 68 33 + 69 33 + 6a 33 6b 35 } } diff --git a/testData/results/pkg/TestSwitchOnEnumJ21.dec b/testData/results/pkg/TestSwitchOnEnumJ21.dec index 9cf0c1ccbd..5660d78ce2 100644 --- a/testData/results/pkg/TestSwitchOnEnumJ21.dec +++ b/testData/results/pkg/TestSwitchOnEnumJ21.dec @@ -101,6 +101,33 @@ class 'pkg/TestSwitchOnEnumJ21' { method 'test1 (Lpkg/TestSwitchOnEnumJ21$TestEnum;)I' { 0 6 4 6 + 5 6 + 6 6 + 7 6 + 8 6 + 9 6 + a 6 + b 6 + c 6 + d 6 + e 6 + f 6 + 10 6 + 11 6 + 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 2a 7 2e 8 32 9 @@ -111,6 +138,33 @@ class 'pkg/TestSwitchOnEnumJ21' { 3 14 7 14 8 14 + 9 14 + a 14 + b 14 + c 14 + d 14 + e 14 + f 14 + 10 14 + 11 14 + 12 14 + 13 14 + 14 14 + 15 14 + 16 14 + 17 14 + 18 14 + 19 14 + 1a 14 + 1b 14 + 1c 14 + 1d 14 + 1e 14 + 1f 14 + 20 14 + 21 14 + 22 14 + 23 14 2e 15 32 16 36 17 @@ -121,6 +175,34 @@ class 'pkg/TestSwitchOnEnumJ21' { 0 22 4 22 b 22 + c 22 + d 22 + e 22 + f 22 + 10 22 + 11 22 + 12 22 + 13 22 + 14 22 + 15 22 + 16 22 + 17 22 + 18 22 + 19 22 + 1a 22 + 1b 22 + 1c 22 + 1d 22 + 1e 22 + 1f 22 + 20 22 + 21 22 + 22 22 + 23 22 + 24 22 + 25 22 + 26 22 + 27 22 32 24 36 25 3a 26 @@ -132,6 +214,34 @@ class 'pkg/TestSwitchOnEnumJ21' { 0 31 4 31 b 31 + c 31 + d 31 + e 31 + f 31 + 10 31 + 11 31 + 12 31 + 13 31 + 14 31 + 15 31 + 16 31 + 17 31 + 18 31 + 19 31 + 1a 31 + 1b 31 + 1c 31 + 1d 31 + 1e 31 + 1f 31 + 20 31 + 21 31 + 22 31 + 23 31 + 24 31 + 25 31 + 26 31 + 27 31 32 33 36 34 3a 35 @@ -142,10 +252,39 @@ class 'pkg/TestSwitchOnEnumJ21' { method 'test5 (Lpkg/TestSwitchOnEnumJ21$TestEnum;Z)I' { 0 40 4 40 + 5 40 + 6 40 + 7 40 + 8 40 + 9 40 + a 40 + b 40 + c 40 + d 40 + e 40 + f 40 + 10 40 + 11 40 + 12 40 + 13 40 + 14 40 + 15 40 + 16 40 + 17 40 + 18 40 + 19 40 + 1a 40 + 1b 40 + 1c 40 + 1d 40 + 1e 40 + 1f 40 2a 41 2e 42 32 44 33 44 + 34 44 + 35 44 36 45 37 45 38 46 @@ -158,6 +297,25 @@ class 'pkg/TestSwitchOnEnumJ21' { method 'testDefault (Lpkg/TestSwitchOnEnumJ21$TestEnum;)I' { 0 56 4 56 + 5 56 + 6 56 + 7 56 + 8 56 + 9 56 + a 56 + b 56 + c 56 + d 56 + e 56 + f 56 + 10 56 + 11 56 + 12 56 + 13 56 + 14 56 + 15 56 + 16 56 + 17 56 18 57 1c 58 1d 56 @@ -167,6 +325,25 @@ class 'pkg/TestSwitchOnEnumJ21' { 3 63 7 63 8 63 + 9 63 + a 63 + b 63 + c 63 + d 63 + e 63 + f 63 + 10 63 + 11 63 + 12 63 + 13 63 + 14 63 + 15 63 + 16 63 + 17 63 + 18 63 + 19 63 + 1a 63 + 1b 63 1c 64 20 65 21 63 @@ -175,6 +352,33 @@ class 'pkg/TestSwitchOnEnumJ21' { method 'testStatement (Lpkg/TestSwitchOnEnumJ21$TestEnum;)V' { 0 70 4 70 + 5 70 + 6 70 + 7 70 + 8 70 + 9 70 + a 70 + b 70 + c 70 + d 70 + e 70 + f 70 + 10 70 + 11 70 + 12 70 + 13 70 + 14 70 + 15 70 + 16 70 + 17 70 + 18 70 + 19 70 + 1a 70 + 1b 70 + 1c 70 + 1d 70 + 1e 70 + 1f 70 20 72 21 72 22 72 @@ -199,12 +403,33 @@ class 'pkg/TestSwitchOnEnumJ21' { 39 78 3a 78 3b 78 + 3c 78 + 3d 78 3e 80 } method 'testStatementDefault (Lpkg/TestSwitchOnEnumJ21$TestEnum;)V' { 0 83 4 83 + 5 83 + 6 83 + 7 83 + 8 83 + 9 83 + a 83 + b 83 + c 83 + d 83 + e 83 + f 83 + 10 83 + 11 83 + 12 83 + 13 83 + 14 83 + 15 83 + 16 83 + 17 83 18 85 19 85 1a 85 @@ -220,6 +445,8 @@ class 'pkg/TestSwitchOnEnumJ21' { 26 88 27 88 28 88 + 29 88 + 2a 88 2b 90 } } diff --git a/testData/results/pkg/TestSwitchOnStrings.dec b/testData/results/pkg/TestSwitchOnStrings.dec index da052f9679..92c703c399 100644 --- a/testData/results/pkg/TestSwitchOnStrings.dec +++ b/testData/results/pkg/TestSwitchOnStrings.dec @@ -54,6 +54,31 @@ class 'pkg/TestSwitchOnStrings' { 33 7 34 7 3e 4 + 3f 4 + 40 4 + 41 4 + 42 4 + 43 4 + 44 4 + 45 4 + 46 4 + 47 4 + 48 4 + 49 4 + 4a 4 + 4b 4 + 4c 4 + 4d 4 + 4e 4 + 4f 4 + 50 4 + 51 4 + 52 4 + 53 4 + 54 4 + 55 4 + 56 4 + 57 4 58 6 59 6 5a 8 @@ -76,6 +101,41 @@ class 'pkg/TestSwitchOnStrings' { 65 20 66 20 70 15 + 71 15 + 72 15 + 73 15 + 74 15 + 75 15 + 76 15 + 77 15 + 78 15 + 79 15 + 7a 15 + 7b 15 + 7c 15 + 7d 15 + 7e 15 + 7f 15 + 80 15 + 81 15 + 82 15 + 83 15 + 84 15 + 85 15 + 86 15 + 87 15 + 88 15 + 89 15 + 8a 15 + 8b 15 + 8c 15 + 8d 15 + 8e 15 + 8f 15 + 90 15 + 91 15 + 92 15 + 93 15 94 17 95 17 96 19 @@ -104,6 +164,41 @@ class 'pkg/TestSwitchOnStrings' { 65 37 66 37 70 32 + 71 32 + 72 32 + 73 32 + 74 32 + 75 32 + 76 32 + 77 32 + 78 32 + 79 32 + 7a 32 + 7b 32 + 7c 32 + 7d 32 + 7e 32 + 7f 32 + 80 32 + 81 32 + 82 32 + 83 32 + 84 32 + 85 32 + 86 32 + 87 32 + 88 32 + 89 32 + 8a 32 + 8b 32 + 8c 32 + 8d 32 + 8e 32 + 8f 32 + 90 32 + 91 32 + 92 32 + 93 32 94 34 95 34 96 36 diff --git a/testData/results/pkg/TestSwitchOnlyDefault.dec b/testData/results/pkg/TestSwitchOnlyDefault.dec index bebe3df299..84c9cd4493 100644 --- a/testData/results/pkg/TestSwitchOnlyDefault.dec +++ b/testData/results/pkg/TestSwitchOnlyDefault.dec @@ -18,6 +18,16 @@ class 'pkg/TestSwitchOnlyDefault' { method 'test (I)V' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 c 6 d 6 e 6 @@ -32,6 +42,16 @@ class 'pkg/TestSwitchOnlyDefault' { method 'test2 (I)V' { 0 11 1 11 + 2 11 + 3 11 + 4 11 + 5 11 + 6 11 + 7 11 + 8 11 + 9 11 + a 11 + b 11 c 13 } } diff --git a/testData/results/pkg/TestSwitchPatternMatching1.dec b/testData/results/pkg/TestSwitchPatternMatching1.dec index cfb82d736d..0694c6e770 100644 --- a/testData/results/pkg/TestSwitchPatternMatching1.dec +++ b/testData/results/pkg/TestSwitchPatternMatching1.dec @@ -26,6 +26,33 @@ class 'pkg/TestSwitchPatternMatching1' { 4 6 9 7 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 + 20 7 + 21 7 + 22 7 + 23 7 + 24 7 + 25 7 + 26 7 + 27 7 + 28 7 + 29 7 + 2a 7 + 2b 7 30 8 31 8 32 9 @@ -54,6 +81,8 @@ class 'pkg/TestSwitchPatternMatching1' { 51 15 52 15 53 15 + 54 15 + 55 15 56 17 } } diff --git a/testData/results/pkg/TestSwitchPatternMatching10.dec b/testData/results/pkg/TestSwitchPatternMatching10.dec index 1dda92424c..2383d74e85 100644 --- a/testData/results/pkg/TestSwitchPatternMatching10.dec +++ b/testData/results/pkg/TestSwitchPatternMatching10.dec @@ -25,6 +25,30 @@ class 'pkg/TestSwitchPatternMatching10' { 37 8 38 8 47 4 + 48 4 + 49 4 + 4a 4 + 4b 4 + 4c 4 + 4d 4 + 4e 4 + 4f 4 + 50 4 + 51 4 + 52 4 + 53 4 + 54 4 + 55 4 + 56 4 + 57 4 + 58 4 + 59 4 + 5a 4 + 5b 4 + 5c 4 + 5d 4 + 5e 4 + 5f 4 60 6 61 6 62 6 @@ -49,6 +73,8 @@ class 'pkg/TestSwitchPatternMatching10' { 79 13 7a 13 7b 13 + 7c 13 + 7d 13 7e 15 } } diff --git a/testData/results/pkg/TestSwitchPatternMatching11.dec b/testData/results/pkg/TestSwitchPatternMatching11.dec index 85091cccaa..14440177d4 100644 --- a/testData/results/pkg/TestSwitchPatternMatching11.dec +++ b/testData/results/pkg/TestSwitchPatternMatching11.dec @@ -20,12 +20,37 @@ class 'pkg/TestSwitchPatternMatching11' { 37 6 38 6 47 4 + 48 4 + 49 4 + 4a 4 + 4b 4 + 4c 4 + 4d 4 + 4e 4 + 4f 4 + 50 4 + 51 4 + 52 4 + 53 4 + 54 4 + 55 4 + 56 4 + 57 4 + 58 4 + 59 4 + 5a 4 + 5b 4 + 5c 4 + 5d 4 + 5e 4 + 5f 4 60 5 61 5 65 6 66 6 6a 7 6e 8 + 6f 8 70 4 } } diff --git a/testData/results/pkg/TestSwitchPatternMatching12.dec b/testData/results/pkg/TestSwitchPatternMatching12.dec index e92a706a4a..ad73f01381 100644 --- a/testData/results/pkg/TestSwitchPatternMatching12.dec +++ b/testData/results/pkg/TestSwitchPatternMatching12.dec @@ -18,12 +18,61 @@ class 'pkg/TestSwitchPatternMatching12' { method 'testTriangle (ZLext/Direction;Lext/Direction;)I' { 0 6 1 6 + 2 6 + 3 6 4 6 8 6 9 6 b 8 + c 8 + d 8 11 8 1a 8 + 1b 8 + 1c 8 + 1d 8 + 1e 8 + 1f 8 + 20 8 + 21 8 + 22 8 + 23 8 + 24 8 + 25 8 + 26 8 + 27 8 + 28 8 + 29 8 + 2a 8 + 2b 8 + 2c 8 + 2d 8 + 2e 8 + 2f 8 + 30 8 + 31 8 + 32 8 + 33 8 + 34 8 + 35 8 + 36 8 + 37 8 + 38 8 + 39 8 + 3a 8 + 3b 8 + 3c 8 + 3d 8 + 3e 8 + 3f 8 + 40 8 + 41 8 + 42 8 + 43 8 + 44 8 + 45 8 + 46 8 + 47 8 48 10 4c 11 50 9 diff --git a/testData/results/pkg/TestSwitchPatternMatching13.dec b/testData/results/pkg/TestSwitchPatternMatching13.dec index f27170645d..20d07fc533 100644 --- a/testData/results/pkg/TestSwitchPatternMatching13.dec +++ b/testData/results/pkg/TestSwitchPatternMatching13.dec @@ -54,6 +54,38 @@ class 'pkg/TestSwitchPatternMatching13' { 0 4 4 4 b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 + 24 4 + 25 4 + 26 4 + 27 4 + 28 4 + 29 4 + 2a 4 + 2b 4 30 10 31 10 32 10 @@ -68,12 +100,16 @@ class 'pkg/TestSwitchPatternMatching13' { 43 11 44 11 45 11 + 46 11 + 47 11 48 12 49 12 4a 12 4b 12 4c 12 4d 12 + 4e 12 + 4f 12 50 15 51 15 52 15 @@ -124,6 +160,8 @@ class 'pkg/TestSwitchPatternMatching13' { 9b 21 9c 21 9d 21 + 9e 21 + 9f 21 a0 23 a1 23 a2 23 @@ -147,12 +185,16 @@ class 'pkg/TestSwitchPatternMatching13' { be 28 bf 28 c0 28 + c1 28 + c2 28 c3 29 c4 29 c5 29 c6 29 c7 29 c8 29 + c9 29 + ca 29 cb 32 cc 32 cd 32 @@ -168,6 +210,8 @@ class 'pkg/TestSwitchPatternMatching13' { d9 6 da 6 db 6 + dc 6 + dd 6 de 7 df 7 e0 7 diff --git a/testData/results/pkg/TestSwitchPatternMatching14.dec b/testData/results/pkg/TestSwitchPatternMatching14.dec index 81c1e66849..122b4c2783 100644 --- a/testData/results/pkg/TestSwitchPatternMatching14.dec +++ b/testData/results/pkg/TestSwitchPatternMatching14.dec @@ -37,18 +37,46 @@ class 'pkg/TestSwitchPatternMatching14' { 0 4 4 4 b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 28 10 29 11 2a 11 2b 11 2c 11 2d 11 + 2e 11 + 2f 11 30 12 31 12 32 12 33 12 34 12 35 12 + 36 12 + 37 12 38 15 39 15 3a 15 @@ -68,6 +96,8 @@ class 'pkg/TestSwitchPatternMatching14' { 4a 6 4b 6 4c 6 + 4d 6 + 4e 6 4f 7 50 7 51 7 @@ -82,6 +112,8 @@ class 'pkg/TestSwitchPatternMatching14' { 5d 18 5e 18 5f 18 + 60 18 + 61 18 62 20 } } diff --git a/testData/results/pkg/TestSwitchPatternMatching15.dec b/testData/results/pkg/TestSwitchPatternMatching15.dec index 41379f8783..233d6e7c5f 100644 --- a/testData/results/pkg/TestSwitchPatternMatching15.dec +++ b/testData/results/pkg/TestSwitchPatternMatching15.dec @@ -30,12 +30,45 @@ class 'pkg/TestSwitchPatternMatching15' { 4 6 9 7 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 + 20 7 + 21 7 + 22 7 + 23 7 + 24 7 + 25 7 + 26 7 + 27 7 + 28 7 + 29 7 + 2a 7 + 2b 7 + 2c 7 + 2d 7 + 2e 7 + 2f 7 34 8 35 8 36 8 37 8 38 8 39 8 + 3a 8 + 3b 8 41 9 42 9 43 9 @@ -57,6 +90,8 @@ class 'pkg/TestSwitchPatternMatching15' { 59 11 5a 11 5b 11 + 5c 11 + 5d 11 63 12 64 12 65 12 diff --git a/testData/results/pkg/TestSwitchPatternMatching16.dec b/testData/results/pkg/TestSwitchPatternMatching16.dec index 8cdfb6b85d..ac90bca278 100644 --- a/testData/results/pkg/TestSwitchPatternMatching16.dec +++ b/testData/results/pkg/TestSwitchPatternMatching16.dec @@ -13,18 +13,18 @@ public class TestSwitchPatternMatching16 { System.out.println("Normal number: " + n);// 15 break;// 16 case Integer ix:// 18 - if (Math.random() < 0.5) {// 21 22 23 26 27 31 + if (Math.random() < 0.5) {// 31 int oh = 0;// 32 int hello = 3;// 33 } else { System.out.println("hello");// 36 } break; - case Number nx: - System.out.println("Number: " + nx); - break; + case Number nx:// 21 + System.out.println("Number: " + nx);// 22 + break;// 23 default: - System.out.println("default"); + System.out.println("default");// 26 } }// 38 } @@ -37,12 +37,45 @@ class 'pkg/TestSwitchPatternMatching16' { 4 6 9 7 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 + 20 7 + 21 7 + 22 7 + 23 7 + 24 7 + 25 7 + 26 7 + 27 7 + 28 7 + 29 7 + 2a 7 + 2b 7 + 2c 7 + 2d 7 + 2e 7 + 2f 7 34 8 35 8 36 8 37 8 38 8 39 8 + 3a 8 + 3b 8 41 9 42 9 43 9 @@ -64,6 +97,8 @@ class 'pkg/TestSwitchPatternMatching16' { 59 11 5a 11 5b 11 + 5c 11 + 5d 11 63 12 64 12 65 12 @@ -83,46 +118,37 @@ class 'pkg/TestSwitchPatternMatching16' { 79 15 7a 15 7b 15 - 7c 15 - 7d 15 - 7e 15 - 7f 15 - 80 15 - 81 15 - 82 15 - 83 15 - 84 15 - 85 15 - 86 15 - 87 15 - 88 15 - 89 15 - 8a 15 - 8b 15 - 8c 15 - 8d 15 - 8e 15 - 8f 15 - 90 15 - 91 15 - 92 15 - 93 15 - 94 15 - 95 15 - 96 15 - 97 15 - 98 15 - 99 15 - 9a 15 - 9b 15 - 9c 15 + 80 22 + 81 22 + 82 23 + 83 23 + 84 23 + 85 23 + 86 23 + 87 23 + 88 23 + 89 23 + 8a 23 + 8b 23 + 8c 23 + 8d 23 + 8e 23 + 8f 24 + 92 26 + 93 26 + 94 26 + 95 26 + 96 26 + 97 26 + 98 26 + 99 26 9d 15 9e 15 9f 15 a0 15 - a1 15 - a2 15 a3 15 + a4 15 + a5 15 a7 16 a8 16 a9 17 @@ -133,6 +159,8 @@ class 'pkg/TestSwitchPatternMatching16' { b1 19 b2 19 b3 19 + b4 19 + b5 19 b6 28 } } @@ -146,15 +174,15 @@ Lines mapping: 15 <-> 13 16 <-> 14 18 <-> 15 -21 <-> 16 -22 <-> 16 -23 <-> 16 -26 <-> 16 -27 <-> 16 +21 <-> 23 +22 <-> 24 +23 <-> 25 +26 <-> 27 31 <-> 16 32 <-> 17 33 <-> 18 36 <-> 20 38 <-> 29 Not mapped: +27 34 diff --git a/testData/results/pkg/TestSwitchPatternMatching17.dec b/testData/results/pkg/TestSwitchPatternMatching17.dec index 8862dfa336..b94d52b1e6 100644 --- a/testData/results/pkg/TestSwitchPatternMatching17.dec +++ b/testData/results/pkg/TestSwitchPatternMatching17.dec @@ -49,6 +49,25 @@ class 'pkg/TestSwitchPatternMatching17' { e 12 f 12 10 12 + 11 12 + 12 12 + 13 12 + 14 12 + 15 12 + 16 12 + 17 12 + 18 12 + 19 12 + 1a 12 + 1b 12 + 1c 12 + 1d 12 + 1e 12 + 1f 12 + 20 12 + 21 12 + 22 12 + 23 12 24 14 25 14 26 14 @@ -60,12 +79,39 @@ class 'pkg/TestSwitchPatternMatching17' { 2c 15 2d 15 2e 15 + 2f 15 + 30 15 + 31 15 + 32 15 + 33 15 + 34 15 + 35 15 + 36 15 + 37 15 + 38 15 + 39 15 + 3a 15 + 3b 15 + 3c 15 + 3d 15 + 3e 15 + 3f 15 + 40 15 + 41 15 + 42 15 + 43 15 + 44 15 + 45 15 + 46 15 + 47 15 4b 17 4c 17 4d 17 4e 17 4f 17 50 17 + 51 17 + 52 17 56 25 57 25 58 26 @@ -74,6 +120,8 @@ class 'pkg/TestSwitchPatternMatching17' { 5d 21 5e 21 5f 21 + 60 21 + 61 21 66 22 67 22 6b 22 diff --git a/testData/results/pkg/TestSwitchPatternMatching18.dec b/testData/results/pkg/TestSwitchPatternMatching18.dec index 3e07377c9a..a913ecdb44 100644 --- a/testData/results/pkg/TestSwitchPatternMatching18.dec +++ b/testData/results/pkg/TestSwitchPatternMatching18.dec @@ -69,6 +69,33 @@ class 'pkg/TestSwitchPatternMatching18' { 4 7 9 9 10 9 + 11 9 + 12 9 + 13 9 + 14 9 + 15 9 + 16 9 + 17 9 + 18 9 + 19 9 + 1a 9 + 1b 9 + 1c 9 + 1d 9 + 1e 9 + 1f 9 + 20 9 + 21 9 + 22 9 + 23 9 + 24 9 + 25 9 + 26 9 + 27 9 + 28 9 + 29 9 + 2a 9 + 2b 9 2c 11 2d 11 2e 11 @@ -86,6 +113,8 @@ class 'pkg/TestSwitchPatternMatching18' { 3d 13 3e 13 3f 13 + 40 13 + 41 13 47 14 48 14 49 14 @@ -109,6 +138,8 @@ class 'pkg/TestSwitchPatternMatching18' { 5f 16 60 16 61 16 + 62 16 + 63 16 69 17 6a 17 6b 17 @@ -133,6 +164,34 @@ class 'pkg/TestSwitchPatternMatching18' { 0 27 4 27 b 27 + c 27 + d 27 + e 27 + f 27 + 10 27 + 11 27 + 12 27 + 13 27 + 14 27 + 15 27 + 16 27 + 17 27 + 18 27 + 19 27 + 1a 27 + 1b 27 + 1c 27 + 1d 27 + 1e 27 + 1f 27 + 20 27 + 21 27 + 22 27 + 23 27 + 24 27 + 25 27 + 26 27 + 27 27 28 33 29 33 2a 33 @@ -159,6 +218,8 @@ class 'pkg/TestSwitchPatternMatching18' { 44 35 45 35 46 35 + 47 35 + 48 35 4e 36 4f 36 50 36 @@ -183,6 +244,34 @@ class 'pkg/TestSwitchPatternMatching18' { 0 46 4 46 b 46 + c 46 + d 46 + e 46 + f 46 + 10 46 + 11 46 + 12 46 + 13 46 + 14 46 + 15 46 + 16 46 + 17 46 + 18 46 + 19 46 + 1a 46 + 1b 46 + 1c 46 + 1d 46 + 1e 46 + 1f 46 + 20 46 + 21 46 + 22 46 + 23 46 + 24 46 + 25 46 + 26 46 + 27 46 28 52 29 52 2a 52 @@ -200,6 +289,8 @@ class 'pkg/TestSwitchPatternMatching18' { 39 54 3a 54 3b 54 + 3c 54 + 3d 54 43 55 44 55 45 55 diff --git a/testData/results/pkg/TestSwitchPatternMatching19.dec b/testData/results/pkg/TestSwitchPatternMatching19.dec index 2b790b95fc..6661b91b7d 100644 --- a/testData/results/pkg/TestSwitchPatternMatching19.dec +++ b/testData/results/pkg/TestSwitchPatternMatching19.dec @@ -78,6 +78,42 @@ class 'pkg/TestSwitchPatternMatching19' { 0 6 4 6 b 6 + c 6 + d 6 + e 6 + f 6 + 10 6 + 11 6 + 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 + 24 6 + 25 6 + 26 6 + 27 6 + 28 6 + 29 6 + 2a 6 + 2b 6 + 2c 6 + 2d 6 + 2e 6 + 2f 6 30 12 31 12 32 12 @@ -93,6 +129,8 @@ class 'pkg/TestSwitchPatternMatching19' { 3f 14 40 14 41 14 + 42 14 + 43 14 49 15 4a 15 4b 15 @@ -123,6 +161,8 @@ class 'pkg/TestSwitchPatternMatching19' { 74 20 75 20 76 20 + 77 20 + 78 20 7e 21 7f 21 80 21 @@ -148,6 +188,34 @@ class 'pkg/TestSwitchPatternMatching19' { 0 28 4 28 b 28 + c 28 + d 28 + e 28 + f 28 + 10 28 + 11 28 + 12 28 + 13 28 + 14 28 + 15 28 + 16 28 + 17 28 + 18 28 + 19 28 + 1a 28 + 1b 28 + 1c 28 + 1d 28 + 1e 28 + 1f 28 + 20 28 + 21 28 + 22 28 + 23 28 + 24 28 + 25 28 + 26 28 + 27 28 28 34 29 34 2a 34 diff --git a/testData/results/pkg/TestSwitchPatternMatching2.dec b/testData/results/pkg/TestSwitchPatternMatching2.dec index 8b74613ff9..b4ed6adec6 100644 --- a/testData/results/pkg/TestSwitchPatternMatching2.dec +++ b/testData/results/pkg/TestSwitchPatternMatching2.dec @@ -34,6 +34,30 @@ class 'pkg/TestSwitchPatternMatching2' { 0 4 4 4 b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 28 8 29 8 2a 8 diff --git a/testData/results/pkg/TestSwitchPatternMatching20.dec b/testData/results/pkg/TestSwitchPatternMatching20.dec index f303aa7bdd..aa7178ff41 100644 --- a/testData/results/pkg/TestSwitchPatternMatching20.dec +++ b/testData/results/pkg/TestSwitchPatternMatching20.dec @@ -8,8 +8,8 @@ public class TestSwitchPatternMatching20 { switch (o) { case Integer var6 when false: break; - case String s: - System.out.println(s);// 7 + case String s:// 7 + System.out.println(s); break; default: System.out.println("Default");// 8 @@ -25,6 +25,33 @@ class 'pkg/TestSwitchPatternMatching20' { 4 6 9 7 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 + 20 7 + 21 7 + 22 7 + 23 7 + 24 7 + 25 7 + 26 7 + 27 7 + 28 7 + 29 7 + 2a 7 + 2b 7 3b 10 3c 10 3d 11 @@ -50,7 +77,7 @@ class 'pkg/TestSwitchPatternMatching20' { Lines mapping: 5 <-> 7 -7 <-> 12 +7 <-> 11 8 <-> 15 10 <-> 17 Not mapped: diff --git a/testData/results/pkg/TestSwitchPatternMatching21.dec b/testData/results/pkg/TestSwitchPatternMatching21.dec index c3d5d1d28c..e94a79326a 100644 --- a/testData/results/pkg/TestSwitchPatternMatching21.dec +++ b/testData/results/pkg/TestSwitchPatternMatching21.dec @@ -74,6 +74,41 @@ class 'pkg/TestSwitchPatternMatching21' { 4 7 9 9 10 9 + 11 9 + 12 9 + 13 9 + 14 9 + 15 9 + 16 9 + 17 9 + 18 9 + 19 9 + 1a 9 + 1b 9 + 1c 9 + 1d 9 + 1e 9 + 1f 9 + 20 9 + 21 9 + 22 9 + 23 9 + 24 9 + 25 9 + 26 9 + 27 9 + 28 9 + 29 9 + 2a 9 + 2b 9 + 2c 9 + 2d 9 + 2e 9 + 2f 9 + 30 9 + 31 9 + 32 9 + 33 9 34 11 35 11 36 11 @@ -169,6 +204,38 @@ class 'pkg/TestSwitchPatternMatching21' { 0 31 4 31 b 31 + c 31 + d 31 + e 31 + f 31 + 10 31 + 11 31 + 12 31 + 13 31 + 14 31 + 15 31 + 16 31 + 17 31 + 18 31 + 19 31 + 1a 31 + 1b 31 + 1c 31 + 1d 31 + 1e 31 + 1f 31 + 20 31 + 21 31 + 22 31 + 23 31 + 24 31 + 25 31 + 26 31 + 27 31 + 28 31 + 29 31 + 2a 31 + 2b 31 2c 37 2d 37 2e 37 @@ -214,6 +281,8 @@ class 'pkg/TestSwitchPatternMatching21' { 68 45 69 45 6a 45 + 6b 45 + 6c 45 72 46 73 46 74 46 @@ -249,6 +318,34 @@ class 'pkg/TestSwitchPatternMatching21' { 0 51 4 51 b 51 + c 51 + d 51 + e 51 + f 51 + 10 51 + 11 51 + 12 51 + 13 51 + 14 51 + 15 51 + 16 51 + 17 51 + 18 51 + 19 51 + 1a 51 + 1b 51 + 1c 51 + 1d 51 + 1e 51 + 1f 51 + 20 51 + 21 51 + 22 51 + 23 51 + 24 51 + 25 51 + 26 51 + 27 51 28 54 29 54 2a 54 diff --git a/testData/results/pkg/TestSwitchPatternMatching22.dec b/testData/results/pkg/TestSwitchPatternMatching22.dec index c6208b9d92..3f3d205577 100644 --- a/testData/results/pkg/TestSwitchPatternMatching22.dec +++ b/testData/results/pkg/TestSwitchPatternMatching22.dec @@ -62,8 +62,8 @@ public class TestSwitchPatternMatching22 { try { System.out.println("hello");// 59 } catch (Exception var8) {// 60 - Object var2 = new Object(); - switch (var2) {// 61 + Object var2 = new Object();// 61 + switch (var2) { case Short var4:// 66 case null: default: @@ -100,6 +100,8 @@ class 'pkg/TestSwitchPatternMatching22' { 3 7 4 7 5 7 + 6 7 + 7 7 13 8 1c 10 1d 10 @@ -107,6 +109,23 @@ class 'pkg/TestSwitchPatternMatching22' { 20 11 23 12 2a 12 + 2b 12 + 2c 12 + 2d 12 + 2e 12 + 2f 12 + 30 12 + 31 12 + 32 12 + 33 12 + 34 12 + 35 12 + 36 12 + 37 12 + 38 12 + 39 12 + 3a 12 + 3b 12 3c 16 3d 16 3e 16 @@ -124,6 +143,8 @@ class 'pkg/TestSwitchPatternMatching22' { 62 20 63 20 64 20 + 65 20 + 66 20 6a 22 } @@ -134,6 +155,8 @@ class 'pkg/TestSwitchPatternMatching22' { 3 26 4 26 5 26 + 6 26 + 7 26 10 27 19 29 1a 29 @@ -141,6 +164,22 @@ class 'pkg/TestSwitchPatternMatching22' { 1d 30 20 31 27 31 + 28 31 + 29 31 + 2a 31 + 2b 31 + 2c 31 + 2d 31 + 2e 31 + 2f 31 + 30 31 + 31 31 + 32 31 + 33 31 + 34 31 + 35 31 + 36 31 + 37 31 38 34 39 34 3a 34 @@ -162,10 +201,38 @@ class 'pkg/TestSwitchPatternMatching22' { 3 44 4 44 5 44 + 6 44 + 7 44 13 45 1b 46 1e 47 25 47 + 26 47 + 27 47 + 28 47 + 29 47 + 2a 47 + 2b 47 + 2c 47 + 2d 47 + 2e 47 + 2f 47 + 30 47 + 31 47 + 32 47 + 33 47 + 34 47 + 35 47 + 36 47 + 37 47 + 38 47 + 39 47 + 3a 47 + 3b 47 + 3c 47 + 3d 47 + 3e 47 + 3f 47 40 52 41 52 42 52 @@ -183,6 +250,8 @@ class 'pkg/TestSwitchPatternMatching22' { 66 56 67 56 68 56 + 69 56 + 6a 56 6e 58 } @@ -193,10 +262,37 @@ class 'pkg/TestSwitchPatternMatching22' { 3 62 4 62 5 62 + 6 62 + 7 62 10 63 18 64 1b 65 22 65 + 23 65 + 24 65 + 25 65 + 26 65 + 27 65 + 28 65 + 29 65 + 2a 65 + 2b 65 + 2c 65 + 2d 65 + 2e 65 + 2f 65 + 30 65 + 31 65 + 32 65 + 33 65 + 34 65 + 35 65 + 36 65 + 37 65 + 38 65 + 39 65 + 3a 65 + 3b 65 3c 69 3d 69 3e 69 @@ -218,9 +314,36 @@ class 'pkg/TestSwitchPatternMatching22' { 3 79 4 79 5 79 + 6 79 + 7 79 10 80 11 81 12 81 + 13 81 + 14 81 + 15 81 + 16 81 + 17 81 + 18 81 + 19 81 + 1a 81 + 1b 81 + 1c 81 + 1d 81 + 1e 81 + 1f 81 + 20 81 + 21 81 + 22 81 + 23 81 + 24 81 + 25 81 + 26 81 + 27 81 + 28 81 + 29 81 + 2a 81 + 2b 81 2c 85 2d 85 2e 85 @@ -260,7 +383,7 @@ Lines mapping: 55 <-> 59 59 <-> 63 60 <-> 64 -61 <-> 66 +61 <-> 65 63 <-> 70 64 <-> 71 66 <-> 67 diff --git a/testData/results/pkg/TestSwitchPatternMatching3.dec b/testData/results/pkg/TestSwitchPatternMatching3.dec index f7897b96ed..8b90bea7b2 100644 --- a/testData/results/pkg/TestSwitchPatternMatching3.dec +++ b/testData/results/pkg/TestSwitchPatternMatching3.dec @@ -17,6 +17,22 @@ class 'pkg/TestSwitchPatternMatching3' { 0 4 4 4 b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 6 1d 6 1e 6 @@ -32,6 +48,8 @@ class 'pkg/TestSwitchPatternMatching3' { 2a 9 2b 9 2c 9 + 2d 9 + 2e 9 2f 11 } } diff --git a/testData/results/pkg/TestSwitchPatternMatching4.dec b/testData/results/pkg/TestSwitchPatternMatching4.dec index b0511c17f4..a987afc09b 100644 --- a/testData/results/pkg/TestSwitchPatternMatching4.dec +++ b/testData/results/pkg/TestSwitchPatternMatching4.dec @@ -20,6 +20,17 @@ class 'pkg/TestSwitchPatternMatching4' { 4 6 9 7 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 1c 9 1d 9 1e 9 diff --git a/testData/results/pkg/TestSwitchPatternMatching5.dec b/testData/results/pkg/TestSwitchPatternMatching5.dec index 665cca4729..5c3b0633af 100644 --- a/testData/results/pkg/TestSwitchPatternMatching5.dec +++ b/testData/results/pkg/TestSwitchPatternMatching5.dec @@ -40,6 +40,38 @@ class 'pkg/TestSwitchPatternMatching5' { 0 4 4 4 b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 + 24 4 + 25 4 + 26 4 + 27 4 + 28 4 + 29 4 + 2a 4 + 2b 4 30 8 31 8 32 8 diff --git a/testData/results/pkg/TestSwitchPatternMatching6.dec b/testData/results/pkg/TestSwitchPatternMatching6.dec index e9c6eae9a0..b01ef8397b 100644 --- a/testData/results/pkg/TestSwitchPatternMatching6.dec +++ b/testData/results/pkg/TestSwitchPatternMatching6.dec @@ -16,8 +16,55 @@ class 'pkg/TestSwitchPatternMatching6' { method 'testTriangle (Lext/Direction;)I' { 0 6 3 6 + 4 6 + 5 6 9 6 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 + 24 6 + 25 6 + 26 6 + 27 6 + 28 6 + 29 6 + 2a 6 + 2b 6 + 2c 6 + 2d 6 + 2e 6 + 2f 6 + 30 6 + 31 6 + 32 6 + 33 6 + 34 6 + 35 6 + 36 6 + 37 6 + 38 6 + 39 6 + 3a 6 + 3b 6 + 3c 6 + 3d 6 + 3e 6 + 3f 6 40 8 44 9 48 7 diff --git a/testData/results/pkg/TestSwitchPatternMatching7.dec b/testData/results/pkg/TestSwitchPatternMatching7.dec index 4c575e37b8..f5b53b9d24 100644 --- a/testData/results/pkg/TestSwitchPatternMatching7.dec +++ b/testData/results/pkg/TestSwitchPatternMatching7.dec @@ -15,6 +15,22 @@ class 'pkg/TestSwitchPatternMatching7' { 0 4 4 4 b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 1c 7 1d 7 1e 7 diff --git a/testData/results/pkg/TestSwitchPatternMatching8.dec b/testData/results/pkg/TestSwitchPatternMatching8.dec index 5e2d1424c6..27c1c9f42a 100644 --- a/testData/results/pkg/TestSwitchPatternMatching8.dec +++ b/testData/results/pkg/TestSwitchPatternMatching8.dec @@ -19,11 +19,36 @@ class 'pkg/TestSwitchPatternMatching8' { 37 6 38 6 47 4 + 48 4 + 49 4 + 4a 4 + 4b 4 + 4c 4 + 4d 4 + 4e 4 + 4f 4 + 50 4 + 51 4 + 52 4 + 53 4 + 54 4 + 55 4 + 56 4 + 57 4 + 58 4 + 59 4 + 5a 4 + 5b 4 + 5c 4 + 5d 4 + 5e 4 + 5f 4 60 5 61 5 65 6 66 6 6a 7 + 6b 7 6c 4 } } diff --git a/testData/results/pkg/TestSwitchPatternMatching9.dec b/testData/results/pkg/TestSwitchPatternMatching9.dec index 220d587459..b6ce00a86a 100644 --- a/testData/results/pkg/TestSwitchPatternMatching9.dec +++ b/testData/results/pkg/TestSwitchPatternMatching9.dec @@ -22,6 +22,36 @@ class 'pkg/TestSwitchPatternMatching9' { 4d 7 4e 7 5d 4 + 5e 4 + 5f 4 + 60 4 + 61 4 + 62 4 + 63 4 + 64 4 + 65 4 + 66 4 + 67 4 + 68 4 + 69 4 + 6a 4 + 6b 4 + 6c 4 + 6d 4 + 6e 4 + 6f 4 + 70 4 + 71 4 + 72 4 + 73 4 + 74 4 + 75 4 + 76 4 + 77 4 + 78 4 + 79 4 + 7a 4 + 7b 4 7c 5 7d 5 81 6 @@ -29,6 +59,7 @@ class 'pkg/TestSwitchPatternMatching9' { 86 7 87 7 8b 8 + 8c 8 8d 4 } } diff --git a/testData/results/pkg/TestSwitchPatternMatchingConstructor1.dec b/testData/results/pkg/TestSwitchPatternMatchingConstructor1.dec index 79b7a70994..44699cc3eb 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingConstructor1.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingConstructor1.dec @@ -42,6 +42,33 @@ class 'pkg/TestSwitchPatternMatchingConstructor1' { 1 8 5 8 c 8 + d 8 + e 8 + f 8 + 10 8 + 11 8 + 12 8 + 13 8 + 14 8 + 15 8 + 16 8 + 17 8 + 18 8 + 19 8 + 1a 8 + 1b 8 + 1c 8 + 1d 8 + 1e 8 + 1f 8 + 20 8 + 21 8 + 22 8 + 23 8 + 24 8 + 25 8 + 26 8 + 27 8 2c 10 2d 10 2e 10 diff --git a/testData/results/pkg/TestSwitchPatternMatchingConstructor2.dec b/testData/results/pkg/TestSwitchPatternMatchingConstructor2.dec index 7bd20af9d5..c45b4f91b1 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingConstructor2.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingConstructor2.dec @@ -39,9 +39,29 @@ class 'pkg/TestSwitchPatternMatchingConstructor2' { 1 10 5 10 c 10 + d 10 + e 10 + f 10 + 10 10 + 11 10 + 12 10 + 13 10 + 14 10 + 15 10 + 16 10 + 17 10 + 18 10 + 19 10 + 1a 10 + 1b 10 + 1c 10 + 1d 10 + 1e 10 + 1f 10 20 11 21 11 25 12 + 26 12 27 10 28 10 29 10 @@ -55,6 +75,14 @@ class 'pkg/TestSwitchPatternMatchingConstructor2' { 5 17 b 18 13 18 + 14 18 + 15 18 + 16 18 + 17 18 + 18 18 + 19 18 + 1a 18 + 1b 18 1c 20 1d 20 1e 20 diff --git a/testData/results/pkg/TestSwitchPatternMatchingFuzz1.dec b/testData/results/pkg/TestSwitchPatternMatchingFuzz1.dec index 7b3a89ce63..81ffe8b1ab 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingFuzz1.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingFuzz1.dec @@ -41,6 +41,23 @@ class 'pkg/TestSwitchPatternMatchingFuzz1' { c 8 f 9 16 9 + 17 9 + 18 9 + 19 9 + 1a 9 + 1b 9 + 1c 9 + 1d 9 + 1e 9 + 1f 9 + 20 9 + 21 9 + 22 9 + 23 9 + 24 9 + 25 9 + 26 9 + 27 9 2f 30 30 11 31 11 @@ -63,6 +80,8 @@ class 'pkg/TestSwitchPatternMatchingFuzz1' { 44 15 45 15 46 15 + 47 15 + 48 15 49 16 4a 16 4b 16 diff --git a/testData/results/pkg/TestSwitchPatternMatchingInstanceof1.dec b/testData/results/pkg/TestSwitchPatternMatchingInstanceof1.dec index 067a747473..8ab527681a 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingInstanceof1.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingInstanceof1.dec @@ -29,6 +29,33 @@ class 'pkg/TestSwitchPatternMatchingInstanceof1' { 4 6 9 7 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 + 20 7 + 21 7 + 22 7 + 23 7 + 24 7 + 25 7 + 26 7 + 27 7 + 28 7 + 29 7 + 2a 7 + 2b 7 30 8 31 8 32 8 @@ -36,21 +63,18 @@ class 'pkg/TestSwitchPatternMatchingInstanceof1' { 34 8 35 8 36 8 + 37 8 + 38 8 3d 8 3e 8 3f 9 40 9 41 9 - 42 9 - 43 9 - 44 9 - 45 9 - 46 9 47 9 48 9 - 49 9 4a 9 4b 9 + 4c 9 4f 10 56 11 57 11 diff --git a/testData/results/pkg/TestSwitchPatternMatchingInstanceof2.dec b/testData/results/pkg/TestSwitchPatternMatchingInstanceof2.dec index 43e9ce8cd4..5e91307acd 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingInstanceof2.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingInstanceof2.dec @@ -29,6 +29,33 @@ class 'pkg/TestSwitchPatternMatchingInstanceof2' { 4 6 9 7 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 + 20 7 + 21 7 + 22 7 + 23 7 + 24 7 + 25 7 + 26 7 + 27 7 + 28 7 + 29 7 + 2a 7 + 2b 7 30 8 31 8 32 8 @@ -37,21 +64,18 @@ class 'pkg/TestSwitchPatternMatchingInstanceof2' { 35 8 36 8 37 8 + 38 8 + 39 8 3f 8 40 8 41 9 42 9 43 9 - 44 9 - 45 9 - 46 9 - 47 9 - 48 9 49 9 4a 9 - 4b 9 4c 9 4d 9 + 4e 9 51 10 58 11 59 11 diff --git a/testData/results/pkg/TestSwitchPatternMatchingInstanceof3.dec b/testData/results/pkg/TestSwitchPatternMatchingInstanceof3.dec index f205d70f71..ba5defe6c2 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingInstanceof3.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingInstanceof3.dec @@ -29,6 +29,33 @@ class 'pkg/TestSwitchPatternMatchingInstanceof3' { 4 6 9 7 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 + 20 7 + 21 7 + 22 7 + 23 7 + 24 7 + 25 7 + 26 7 + 27 7 + 28 7 + 29 7 + 2a 7 + 2b 7 30 8 31 8 32 8 @@ -37,6 +64,8 @@ class 'pkg/TestSwitchPatternMatchingInstanceof3' { 35 8 36 8 37 8 + 38 8 + 39 8 3f 8 40 8 41 8 @@ -45,6 +74,8 @@ class 'pkg/TestSwitchPatternMatchingInstanceof3' { 44 8 45 8 46 8 + 47 8 + 48 8 4e 9 4f 9 50 9 diff --git a/testData/results/pkg/TestSwitchPatternMatchingInstanceof4.dec b/testData/results/pkg/TestSwitchPatternMatchingInstanceof4.dec index 529ece6b54..b8eb47d23b 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingInstanceof4.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingInstanceof4.dec @@ -23,6 +23,25 @@ class 'pkg/TestSwitchPatternMatchingInstanceof4' { 4 6 9 7 10 7 + 11 7 + 12 7 + 13 7 + 14 7 + 15 7 + 16 7 + 17 7 + 18 7 + 19 7 + 1a 7 + 1b 7 + 1c 7 + 1d 7 + 1e 7 + 1f 7 + 20 7 + 21 7 + 22 7 + 23 7 28 8 29 8 2a 8 @@ -30,6 +49,8 @@ class 'pkg/TestSwitchPatternMatchingInstanceof4' { 2c 8 2d 8 2e 8 + 2f 8 + 30 8 35 8 36 8 37 8 @@ -43,19 +64,15 @@ class 'pkg/TestSwitchPatternMatchingInstanceof4' { 43 8 44 8 45 8 + 46 8 + 47 8 4d 8 4e 8 4f 9 50 9 51 9 - 52 9 - 53 9 - 54 9 - 55 9 - 56 9 57 9 58 9 - 59 9 5a 9 5b 9 5c 9 @@ -63,8 +80,6 @@ class 'pkg/TestSwitchPatternMatchingInstanceof4' { 5e 9 5f 9 60 9 - 61 9 - 62 9 66 10 69 12 6a 12 diff --git a/testData/results/pkg/TestSwitchPatternMatchingLoop.dec b/testData/results/pkg/TestSwitchPatternMatchingLoop.dec index e833beb523..9d691e77fd 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingLoop.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingLoop.dec @@ -28,6 +28,33 @@ class 'pkg/TestSwitchPatternMatchingLoop' { 4 7 9 8 10 8 + 11 8 + 12 8 + 13 8 + 14 8 + 15 8 + 16 8 + 17 8 + 18 8 + 19 8 + 1a 8 + 1b 8 + 1c 8 + 1d 8 + 1e 8 + 1f 8 + 20 8 + 21 8 + 22 8 + 23 8 + 24 8 + 25 8 + 26 8 + 27 8 + 28 8 + 29 8 + 2a 8 + 2b 8 30 9 31 9 32 10 @@ -56,6 +83,8 @@ class 'pkg/TestSwitchPatternMatchingLoop' { 51 16 52 16 53 16 + 54 16 + 55 16 } } diff --git a/testData/results/pkg/TestSwitchPatternMatchingReturn1.dec b/testData/results/pkg/TestSwitchPatternMatchingReturn1.dec index 284d225ff7..b648eea7b3 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingReturn1.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingReturn1.dec @@ -22,6 +22,33 @@ class 'pkg/TestSwitchPatternMatchingReturn1' { 4 6 9 8 10 8 + 11 8 + 12 8 + 13 8 + 14 8 + 15 8 + 16 8 + 17 8 + 18 8 + 19 8 + 1a 8 + 1b 8 + 1c 8 + 1d 8 + 1e 8 + 1f 8 + 20 8 + 21 8 + 22 8 + 23 8 + 24 8 + 25 8 + 26 8 + 27 8 + 28 8 + 29 8 + 2a 8 + 2b 8 30 9 31 9 32 9 diff --git a/testData/results/pkg/TestSwitchPatternMatchingReturn2.dec b/testData/results/pkg/TestSwitchPatternMatchingReturn2.dec index 4a41d9a716..558c9c2bb1 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingReturn2.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingReturn2.dec @@ -23,6 +23,33 @@ class 'pkg/TestSwitchPatternMatchingReturn2' { 4 6 9 8 10 8 + 11 8 + 12 8 + 13 8 + 14 8 + 15 8 + 16 8 + 17 8 + 18 8 + 19 8 + 1a 8 + 1b 8 + 1c 8 + 1d 8 + 1e 8 + 1f 8 + 20 8 + 21 8 + 22 8 + 23 8 + 24 8 + 25 8 + 26 8 + 27 8 + 28 8 + 29 8 + 2a 8 + 2b 8 30 9 31 9 32 9 @@ -33,6 +60,8 @@ class 'pkg/TestSwitchPatternMatchingReturn2' { 37 9 38 9 39 9 + 3a 9 + 3b 9 41 9 42 9 43 9 diff --git a/testData/results/pkg/TestSwitchPatternMatchingWithNull.dec b/testData/results/pkg/TestSwitchPatternMatchingWithNull.dec index 8bbaf5d867..b9f52968ff 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingWithNull.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingWithNull.dec @@ -7,8 +7,8 @@ public class TestSwitchPatternMatchingWithNull { case null: System.out.println(i); break; - case String s: - System.out.println(s);// 7 + case String s:// 7 + System.out.println(s); break; default: System.out.println("Default");// 8 @@ -21,8 +21,8 @@ public class TestSwitchPatternMatchingWithNull { case null: System.out.println(i); break; - case String s: - System.out.println(s);// 15 + case String s:// 15 + System.out.println(s); break; default: System.out.println("Default");// 16 @@ -35,6 +35,30 @@ class 'pkg/TestSwitchPatternMatchingWithNull' { 0 4 4 4 b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 28 5 29 5 2a 7 @@ -63,6 +87,8 @@ class 'pkg/TestSwitchPatternMatchingWithNull' { 49 13 4a 13 4b 13 + 4c 13 + 4d 13 4e 15 } @@ -70,6 +96,30 @@ class 'pkg/TestSwitchPatternMatchingWithNull' { 0 18 4 18 b 18 + c 18 + d 18 + e 18 + f 18 + 10 18 + 11 18 + 12 18 + 13 18 + 14 18 + 15 18 + 16 18 + 17 18 + 18 18 + 19 18 + 1a 18 + 1b 18 + 1c 18 + 1d 18 + 1e 18 + 1f 18 + 20 18 + 21 18 + 22 18 + 23 18 28 19 29 19 2a 21 @@ -98,6 +148,8 @@ class 'pkg/TestSwitchPatternMatchingWithNull' { 49 27 4a 27 4b 27 + 4c 27 + 4d 27 4e 29 } } @@ -105,11 +157,11 @@ class 'pkg/TestSwitchPatternMatchingWithNull' { Lines mapping: 5 <-> 5 6 <-> 6 -7 <-> 11 +7 <-> 10 8 <-> 14 10 <-> 16 13 <-> 19 14 <-> 20 -15 <-> 25 +15 <-> 24 16 <-> 28 18 <-> 30 diff --git a/testData/results/pkg/TestSwitchReturn.dec b/testData/results/pkg/TestSwitchReturn.dec index f874e9b8fa..10aaa431f2 100644 --- a/testData/results/pkg/TestSwitchReturn.dec +++ b/testData/results/pkg/TestSwitchReturn.dec @@ -21,6 +21,64 @@ class 'pkg/TestSwitchReturn' { method 'test (I)I' { 0 4 1 4 + 2 4 + 3 4 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 + 24 4 + 25 4 + 26 4 + 27 4 + 28 4 + 29 4 + 2a 4 + 2b 4 + 2c 4 + 2d 4 + 2e 4 + 2f 4 + 30 4 + 31 4 + 32 4 + 33 4 + 34 4 + 35 4 + 36 4 + 37 4 + 38 4 + 39 4 + 3a 4 + 3b 4 3c 8 3d 8 3e 12 diff --git a/testData/results/pkg/TestSwitchSimpleMultiLine.dec b/testData/results/pkg/TestSwitchSimpleMultiLine.dec index 29ef04249d..db49f53fcc 100644 --- a/testData/results/pkg/TestSwitchSimpleMultiLine.dec +++ b/testData/results/pkg/TestSwitchSimpleMultiLine.dec @@ -27,6 +27,33 @@ class 'pkg/TestSwitchSimpleMultiLine' { a 7 b 9 c 9 + d 9 + e 9 + f 9 + 10 9 + 11 9 + 12 9 + 13 9 + 14 9 + 15 9 + 16 9 + 17 9 + 18 9 + 19 9 + 1a 9 + 1b 9 + 1c 9 + 1d 9 + 1e 9 + 1f 9 + 20 9 + 21 9 + 22 9 + 23 9 + 24 9 + 25 9 + 26 9 + 27 9 3d 9 } @@ -51,8 +78,12 @@ class 'pkg/TestSwitchSimpleMultiLine' { 15 14 16 15 17 15 + 18 15 + 19 15 1a 15 1b 15 + 1c 15 + 1d 15 1e 15 27 15 28 15 diff --git a/testData/results/pkg/TestSwitchStringHashcodeCollision.dec b/testData/results/pkg/TestSwitchStringHashcodeCollision.dec index b923886ca6..218b4d63a4 100644 --- a/testData/results/pkg/TestSwitchStringHashcodeCollision.dec +++ b/testData/results/pkg/TestSwitchStringHashcodeCollision.dec @@ -26,6 +26,33 @@ class 'pkg/TestSwitchStringHashcodeCollision' { 41 8 42 8 4c 4 + 4d 4 + 4e 4 + 4f 4 + 50 4 + 51 4 + 52 4 + 53 4 + 54 4 + 55 4 + 56 4 + 57 4 + 58 4 + 59 4 + 5a 4 + 5b 4 + 5c 4 + 5d 4 + 5e 4 + 5f 4 + 60 4 + 61 4 + 62 4 + 63 4 + 64 4 + 65 4 + 66 4 + 67 4 68 11 69 11 6a 11 @@ -35,8 +62,6 @@ class 'pkg/TestSwitchStringHashcodeCollision' { 6e 11 6f 11 70 12 - 71 12 - 72 12 73 6 74 6 75 9 diff --git a/testData/results/pkg/TestSwitchTernary.dec b/testData/results/pkg/TestSwitchTernary.dec index 0808a1c03a..8a9c4667f4 100644 --- a/testData/results/pkg/TestSwitchTernary.dec +++ b/testData/results/pkg/TestSwitchTernary.dec @@ -49,9 +49,37 @@ class 'pkg/TestSwitchTernary' { method 'test (IIZ)V' { 0 4 1 4 + 2 4 + 3 4 4 4 8 4 9 4 + a 4 + b 4 + c 4 + d 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 24 6 25 6 26 6 @@ -67,18 +95,24 @@ class 'pkg/TestSwitchTernary' { 32 9 33 9 34 9 + 35 9 + 36 9 37 11 38 11 39 11 3a 11 3b 11 3c 11 + 3d 11 + 3e 11 3f 13 } method 'testString (Ljava/lang/String;Ljava/lang/String;Z)V' { 0 16 1 16 + 2 16 + 3 16 4 16 8 16 9 16 @@ -90,6 +124,30 @@ class 'pkg/TestSwitchTernary' { 3e 21 3f 21 4b 17 + 4c 17 + 4d 17 + 4e 17 + 4f 17 + 50 17 + 51 17 + 52 17 + 53 17 + 54 17 + 55 17 + 56 17 + 57 17 + 58 17 + 59 17 + 5a 17 + 5b 17 + 5c 17 + 5d 17 + 5e 17 + 5f 17 + 60 17 + 61 17 + 62 17 + 63 17 64 19 65 19 66 19 @@ -105,22 +163,55 @@ class 'pkg/TestSwitchTernary' { 72 22 73 22 74 22 + 75 22 + 76 22 77 24 78 24 79 24 7a 24 7b 24 7c 24 + 7d 24 + 7e 24 7f 26 } method 'testEnum (Lpkg/TestSwitchTernary$TestEnum;Lpkg/TestSwitchTernary$TestEnum;Z)V' { 3 29 4 29 + 5 29 + 6 29 7 29 b 29 f 29 10 29 + 11 29 + 12 29 + 13 29 + 14 29 + 15 29 + 16 29 + 17 29 + 18 29 + 19 29 + 1a 29 + 1b 29 + 1c 29 + 1d 29 + 1e 29 + 1f 29 + 20 29 + 21 29 + 22 29 + 23 29 + 24 29 + 25 29 + 26 29 + 27 29 + 28 29 + 29 29 + 2a 29 + 2b 29 2c 31 2d 31 2e 31 @@ -136,12 +227,16 @@ class 'pkg/TestSwitchTernary' { 3a 34 3b 34 3c 34 + 3d 34 + 3e 34 3f 36 40 36 41 36 42 36 43 36 44 36 + 45 36 + 46 36 47 38 } } diff --git a/testData/results/pkg/TestSynchronized.dec b/testData/results/pkg/TestSynchronized.dec index ea0028a258..871263d40a 100644 --- a/testData/results/pkg/TestSynchronized.dec +++ b/testData/results/pkg/TestSynchronized.dec @@ -358,6 +358,32 @@ class 'pkg/TestSynchronized' { method 'test11 (I)V' { 0 85 1 85 + 2 85 + 3 85 + 4 85 + 5 85 + 6 85 + 7 85 + 8 85 + 9 85 + a 85 + b 85 + c 85 + d 85 + e 85 + f 85 + 10 85 + 11 85 + 12 85 + 13 85 + 14 85 + 15 85 + 16 85 + 17 85 + 18 85 + 19 85 + 1a 85 + 1b 85 1c 87 1f 87 21 89 @@ -386,6 +412,8 @@ class 'pkg/TestSynchronized' { 5a 101 5b 101 5c 101 + 5d 101 + 5e 101 5f 103 } diff --git a/testData/results/pkg/TestSynchronizedLoop.dec b/testData/results/pkg/TestSynchronizedLoop.dec index 7749a5a12c..c874aedaa6 100644 --- a/testData/results/pkg/TestSynchronizedLoop.dec +++ b/testData/results/pkg/TestSynchronizedLoop.dec @@ -97,6 +97,8 @@ class 'pkg/TestSynchronizedLoop' { 4 7 5 7 6 7 + 7 7 + 8 7 9 8 a 8 b 8 @@ -124,6 +126,8 @@ class 'pkg/TestSynchronizedLoop' { 3 30 4 31 5 31 + 6 31 + 7 31 8 32 9 32 a 32 @@ -144,8 +148,12 @@ class 'pkg/TestSynchronizedLoop' { 6 39 7 39 8 39 + 9 39 + a 39 b 42 c 42 + d 42 + e 42 f 50 10 50 11 50 @@ -156,6 +164,8 @@ class 'pkg/TestSynchronizedLoop' { 16 51 17 51 18 51 + 19 51 + 1a 51 1b 54 1c 54 1d 54 @@ -163,6 +173,8 @@ class 'pkg/TestSynchronizedLoop' { 1f 54 20 54 21 54 + 22 54 + 23 54 38 56 39 56 3a 56 @@ -175,6 +187,8 @@ class 'pkg/TestSynchronizedLoop' { 41 57 42 57 43 57 + 44 57 + 45 57 50 43 51 43 52 43 @@ -186,20 +200,28 @@ class 'pkg/TestSynchronizedLoop' { 58 44 59 44 5a 44 + 5b 44 + 5c 44 5d 45 5e 45 5f 45 60 45 61 45 + 62 45 + 63 45 70 64 71 64 72 64 + 73 64 + 74 64 75 65 76 65 77 65 78 65 79 65 7a 65 + 7b 65 + 7c 65 7d 67 } @@ -210,6 +232,8 @@ class 'pkg/TestSynchronizedLoop' { 3 70 4 70 5 70 + 6 70 + 7 70 8 71 b 71 c 73 @@ -298,4 +322,4 @@ Not mapped: 53 60 76 -79 \ No newline at end of file +79 diff --git a/testData/results/pkg/TestSynchronizedTernary.dec b/testData/results/pkg/TestSynchronizedTernary.dec index cecb47bb8f..874b0ef4c8 100644 --- a/testData/results/pkg/TestSynchronizedTernary.dec +++ b/testData/results/pkg/TestSynchronizedTernary.dec @@ -12,6 +12,8 @@ class 'pkg/TestSynchronizedTernary' { method 'test (ZLjava/lang/Object;Ljava/lang/Object;)V' { 0 4 1 4 + 2 4 + 3 4 4 4 8 4 a 4 diff --git a/testData/results/pkg/TestSynchronizedThrow.dec b/testData/results/pkg/TestSynchronizedThrow.dec index 1d7f4b3b19..1f1bc11c97 100644 --- a/testData/results/pkg/TestSynchronizedThrow.dec +++ b/testData/results/pkg/TestSynchronizedThrow.dec @@ -94,6 +94,8 @@ class 'pkg/TestSynchronizedThrow' { 3 18 4 19 5 19 + 6 19 + 7 19 f 20 1a 23 } @@ -119,6 +121,8 @@ class 'pkg/TestSynchronizedThrow' { 13 28 14 29 15 29 + 16 29 + 17 29 1f 30 20 33 21 33 @@ -159,6 +163,8 @@ class 'pkg/TestSynchronizedThrow' { 3 50 4 51 5 51 + 6 51 + 7 51 8 53 9 53 a 53 diff --git a/testData/results/pkg/TestSynchronizedTry.dec b/testData/results/pkg/TestSynchronizedTry.dec index c05ccd1a21..48c5314126 100644 --- a/testData/results/pkg/TestSynchronizedTry.dec +++ b/testData/results/pkg/TestSynchronizedTry.dec @@ -122,6 +122,8 @@ class 'pkg/TestSynchronizedTry' { 11 20 12 21 13 21 + 14 21 + 15 21 1b 25 1c 25 1d 25 @@ -134,18 +136,26 @@ class 'pkg/TestSynchronizedTry' { 2e 28 2f 28 30 28 + 31 28 + 32 28 36 30 37 31 38 31 + 39 31 + 3a 31 3b 34 3c 34 3d 34 + 3e 34 + 3f 34 40 35 41 35 42 35 43 35 44 35 45 35 + 46 35 + 47 35 48 37 } @@ -168,6 +178,8 @@ class 'pkg/TestSynchronizedTry' { 11 44 12 45 13 45 + 14 45 + 15 45 1b 49 1c 49 1d 49 @@ -180,18 +192,26 @@ class 'pkg/TestSynchronizedTry' { 2e 52 2f 52 30 52 + 31 52 + 32 52 36 54 37 55 38 55 + 39 55 + 3a 55 3b 58 3c 58 3d 58 + 3e 58 + 3f 58 40 59 41 59 42 59 43 59 44 59 45 59 + 46 59 + 47 59 48 61 } @@ -209,6 +229,8 @@ class 'pkg/TestSynchronizedTry' { c 68 d 71 e 71 + f 71 + 10 71 13 72 16 78 17 74 diff --git a/testData/results/pkg/TestSynchronizedTryReturn.dec b/testData/results/pkg/TestSynchronizedTryReturn.dec index 6b82cad2ac..b93817657a 100644 --- a/testData/results/pkg/TestSynchronizedTryReturn.dec +++ b/testData/results/pkg/TestSynchronizedTryReturn.dec @@ -29,6 +29,8 @@ class 'pkg/TestSynchronizedTryReturn' { 3 4 4 7 5 7 + 6 7 + 7 7 a 12 b 8 10 9 diff --git a/testData/results/pkg/TestSynchronizedTrySharing.dec b/testData/results/pkg/TestSynchronizedTrySharing.dec index 910a049a6d..7e57a56c45 100644 --- a/testData/results/pkg/TestSynchronizedTrySharing.dec +++ b/testData/results/pkg/TestSynchronizedTrySharing.dec @@ -64,6 +64,8 @@ class 'pkg/TestSynchronizedTrySharing' { 2a 16 2b 17 2c 17 + 2d 17 + 2e 17 2f 19 } @@ -102,6 +104,8 @@ class 'pkg/TestSynchronizedTrySharing' { 41 34 42 35 43 35 + 44 35 + 45 35 46 37 } } diff --git a/testData/results/pkg/TestSynchronizedUnprotected.dec b/testData/results/pkg/TestSynchronizedUnprotected.dec index 0f2ef725f5..acf2f582a5 100644 --- a/testData/results/pkg/TestSynchronizedUnprotected.dec +++ b/testData/results/pkg/TestSynchronizedUnprotected.dec @@ -41,13 +41,6 @@ class 'pkg/TestSynchronizedUnprotected' { 13 18 14 18 17 20 - 18 20 - 19 20 - 1a 20 - 1b 20 - 1c 20 - 1d 20 - 1e 20 } } diff --git a/testData/results/pkg/TestTempAssign.dec b/testData/results/pkg/TestTempAssign.dec index ea65e15f73..4e50c47b1b 100644 --- a/testData/results/pkg/TestTempAssign.dec +++ b/testData/results/pkg/TestTempAssign.dec @@ -54,6 +54,8 @@ class 'pkg/TestTempAssign' { 1 9 2 9 3 9 + 4 9 + 5 9 6 10 7 10 8 10 diff --git a/testData/results/pkg/TestTernaryAssign.dec b/testData/results/pkg/TestTernaryAssign.dec index d39b44b381..fadeaccfda 100644 --- a/testData/results/pkg/TestTernaryAssign.dec +++ b/testData/results/pkg/TestTernaryAssign.dec @@ -18,6 +18,8 @@ class 'pkg/TestTernaryAssign' { 2 5 3 5 4 5 + 5 5 + 6 5 7 5 b 5 c 5 diff --git a/testData/results/pkg/TestTernaryCall.dec b/testData/results/pkg/TestTernaryCall.dec index 0677a583a5..4b0ed7a605 100644 --- a/testData/results/pkg/TestTernaryCall.dec +++ b/testData/results/pkg/TestTernaryCall.dec @@ -19,10 +19,14 @@ class 'pkg/TestTernaryCall' { 2 4 3 4 4 4 + 5 4 + 6 4 7 4 e 4 12 4 13 4 + 14 4 + 15 4 16 4 1d 4 26 4 @@ -34,15 +38,23 @@ class 'pkg/TestTernaryCall' { method 'test2 (ZZZ)V' { 0 8 1 8 + 2 8 + 3 8 4 8 5 8 + 6 8 + 7 8 b 8 c 8 + d 8 + e 8 f 9 10 9 11 9 12 9 13 9 + 14 9 + 15 9 16 11 } } diff --git a/testData/results/pkg/TestTernaryReturn.dec b/testData/results/pkg/TestTernaryReturn.dec index 793f2b3c9e..4d1d4da501 100644 --- a/testData/results/pkg/TestTernaryReturn.dec +++ b/testData/results/pkg/TestTernaryReturn.dec @@ -21,6 +21,8 @@ class 'pkg/TestTernaryReturn' { 2 7 3 7 4 7 + 5 7 + 6 7 7 8 8 8 9 10 @@ -33,11 +35,15 @@ class 'pkg/TestTernaryReturn' { 10 11 11 11 12 11 + 13 11 + 14 11 15 11 16 11 17 11 18 11 19 11 + 1a 11 + 1b 11 1f 11 20 11 21 11 @@ -54,11 +60,15 @@ class 'pkg/TestTernaryReturn' { 2f 11 30 11 31 11 + 32 11 + 33 11 34 11 35 11 36 11 37 11 38 11 + 39 11 + 3a 11 3e 11 3f 11 40 11 diff --git a/testData/results/pkg/TestTernaryReturn2.dec b/testData/results/pkg/TestTernaryReturn2.dec index 5b189fa8e7..bc699a0a9c 100644 --- a/testData/results/pkg/TestTernaryReturn2.dec +++ b/testData/results/pkg/TestTernaryReturn2.dec @@ -47,11 +47,14 @@ class 'pkg/TestTernaryReturn2' { 19 4 1a 4 1b 4 + 1c 4 + 1d 4 1e 4 1f 4 20 4 21 4 25 4 + 26 4 27 4 28 4 29 4 @@ -66,6 +69,8 @@ class 'pkg/TestTernaryReturn2' { method 'b (Lpkg/TestTernaryReturn2$T;)Z' { 0 8 1 8 + 2 8 + 3 8 9 8 } diff --git a/testData/results/pkg/TestTextTokens3.dec b/testData/results/pkg/TestTextTokens3.dec index 684260fdf8..e9bbd157c3 100644 --- a/testData/results/pkg/TestTextTokens3.dec +++ b/testData/results/pkg/TestTextTokens3.dec @@ -31,6 +31,30 @@ class 'pkg/TestTextTokens3' { 6 5 a 5 b 5 + c 5 + d 5 + e 5 + f 5 + 10 5 + 11 5 + 12 5 + 13 5 + 14 5 + 15 5 + 16 5 + 17 5 + 18 5 + 19 5 + 1a 5 + 1b 5 + 1c 5 + 1d 5 + 1e 5 + 1f 5 + 20 5 + 21 5 + 22 5 + 23 5 24 7 25 7 26 7 diff --git a/testData/results/pkg/TestThrowException.dec b/testData/results/pkg/TestThrowException.dec index b4ca681aaf..3a249fd113 100644 --- a/testData/results/pkg/TestThrowException.dec +++ b/testData/results/pkg/TestThrowException.dec @@ -21,6 +21,8 @@ class 'pkg/TestThrowException' { method ' (I)V' { 4 6 5 6 + 6 6 + 7 6 c 7 d 7 11 7 diff --git a/testData/results/pkg/TestThrowLoop.dec b/testData/results/pkg/TestThrowLoop.dec index b0d4269f54..1aa0492d4d 100644 --- a/testData/results/pkg/TestThrowLoop.dec +++ b/testData/results/pkg/TestThrowLoop.dec @@ -32,9 +32,13 @@ class 'pkg/TestThrowLoop' { 7 7 8 7 9 7 + a 7 + b 7 c 7 d 7 e 7 + f 7 + 10 7 11 8 12 8 13 8 @@ -43,10 +47,14 @@ class 'pkg/TestThrowLoop' { 16 8 17 9 18 9 + 19 9 + 1a 9 1b 9 1c 9 1d 9 1e 9 + 1f 9 + 20 9 28 10 29 7 2a 7 @@ -56,13 +64,19 @@ class 'pkg/TestThrowLoop' { 31 14 32 14 33 14 + 34 14 + 35 14 36 15 37 15 + 38 15 + 39 15 3a 15 3b 15 3c 15 3d 15 3e 15 + 3f 15 + 40 15 48 16 49 14 4a 14 diff --git a/testData/results/pkg/TestTryCatchFinally.dec b/testData/results/pkg/TestTryCatchFinally.dec index 07e8bb2a6b..65bb97a308 100644 --- a/testData/results/pkg/TestTryCatchFinally.dec +++ b/testData/results/pkg/TestTryCatchFinally.dec @@ -30,10 +30,10 @@ public class TestTryCatchFinally { } catch (Exception var6) {// 52 System.out.println("Error" + var6);// 53 } finally { - System.out.println("Finally"); + System.out.println("Finally");// 55 } - return -1;// 55 56 57 + return -1;// 56 57 } } @@ -45,12 +45,16 @@ class 'pkg/TestTryCatchFinally' { 3 5 4 5 5 5 + 6 5 + 7 5 14 8 15 8 16 8 17 8 18 8 19 8 + 1a 8 + 1b 8 1f 9 2d 12 2e 12 @@ -58,6 +62,8 @@ class 'pkg/TestTryCatchFinally' { 30 12 31 12 32 12 + 33 12 + 34 12 38 14 } @@ -65,10 +71,14 @@ class 'pkg/TestTryCatchFinally' { 0 17 1 17 2 17 + 3 17 + 4 17 c 18 d 19 e 19 f 19 + 10 19 + 11 19 12 20 13 20 1b 22 @@ -91,20 +101,17 @@ class 'pkg/TestTryCatchFinally' { 24 30 25 30 26 30 + 27 30 + 28 30 31 35 - 32 35 - 33 35 - 34 35 35 32 36 32 37 32 38 32 39 32 3a 32 - 3b 35 - 3c 35 - 3d 35 - 3e 35 + 3b 32 + 3c 32 3f 35 } } @@ -123,7 +130,7 @@ Lines mapping: 51 <-> 29 52 <-> 30 53 <-> 31 -55 <-> 36 +55 <-> 33 56 <-> 36 57 <-> 36 Not mapped: diff --git a/testData/results/pkg/TestTryCatchNested.dec b/testData/results/pkg/TestTryCatchNested.dec index 9285fa4963..541be5438e 100644 --- a/testData/results/pkg/TestTryCatchNested.dec +++ b/testData/results/pkg/TestTryCatchNested.dec @@ -34,6 +34,8 @@ class 'pkg/TestTryCatchNested' { 12 11 13 11 14 11 + 15 11 + 16 11 17 13 } } diff --git a/testData/results/pkg/TestTryFinally.dec b/testData/results/pkg/TestTryFinally.dec index a3c18f4f1f..d224d33d14 100644 --- a/testData/results/pkg/TestTryFinally.dec +++ b/testData/results/pkg/TestTryFinally.dec @@ -13,10 +13,10 @@ public class TestTryFinally { try { System.out.println("Hello");// 14 } finally { - System.out.println("Finally"); + System.out.println("Finally");// 16 } - System.out.println("Bye");// 16 17 19 + System.out.println("Bye");// 17 19 } public void test2(int i) { @@ -42,6 +42,8 @@ class 'pkg/TestTryFinally' { 3 5 4 5 5 5 + 6 5 + 7 5 c 9 10 7 11 7 @@ -57,26 +59,24 @@ class 'pkg/TestTryFinally' { 3 13 4 13 5 13 + 6 13 + 7 13 10 18 11 18 12 18 - 13 18 14 15 15 15 16 15 17 15 18 15 19 15 - 1a 18 - 1b 18 - 1c 18 - 1d 18 + 1a 15 + 1b 15 1e 18 1f 18 - 20 18 21 18 22 18 - 23 19 + 23 18 } method 'test2 (I)V' { @@ -86,6 +86,8 @@ class 'pkg/TestTryFinally' { 3 23 4 23 5 23 + 6 23 + 7 23 1d 25 1e 25 1f 25 @@ -96,6 +98,8 @@ class 'pkg/TestTryFinally' { 24 25 25 26 26 26 + 27 26 + 28 26 29 27 2a 27 2b 27 @@ -121,7 +125,7 @@ Lines mapping: 8 <-> 8 9 <-> 10 14 <-> 14 -16 <-> 19 +16 <-> 16 17 <-> 19 19 <-> 19 25 <-> 24 diff --git a/testData/results/pkg/TestTryLoop.dec b/testData/results/pkg/TestTryLoop.dec index 0b355ae40e..7f141998f2 100644 --- a/testData/results/pkg/TestTryLoop.dec +++ b/testData/results/pkg/TestTryLoop.dec @@ -50,6 +50,8 @@ class 'pkg/TestTryLoop' { 16 19 17 20 18 20 + 19 20 + 1a 20 1b 22 } @@ -60,6 +62,8 @@ class 'pkg/TestTryLoop' { 6 27 7 27 8 27 + 9 27 + a 27 b 28 c 28 d 28 diff --git a/testData/results/pkg/TestTryLoop2.dec b/testData/results/pkg/TestTryLoop2.dec index 5badc65877..6c9cf925c4 100644 --- a/testData/results/pkg/TestTryLoop2.dec +++ b/testData/results/pkg/TestTryLoop2.dec @@ -29,6 +29,8 @@ class 'pkg/TestTryLoop2' { 2 12 3 12 4 12 + 5 12 + 6 12 b 16 16 17 17 18 diff --git a/testData/results/pkg/TestTryLoopNoCatch.dec b/testData/results/pkg/TestTryLoopNoCatch.dec index eee77992a6..ce23c0ab1a 100644 --- a/testData/results/pkg/TestTryLoopNoCatch.dec +++ b/testData/results/pkg/TestTryLoopNoCatch.dec @@ -34,6 +34,8 @@ class 'pkg/TestTryLoopNoCatch' { 5 6 6 6 7 6 + 8 6 + 9 6 a 8 b 8 c 8 @@ -64,6 +66,8 @@ class 'pkg/TestTryLoopNoCatch' { 4 18 5 18 6 18 + 7 18 + 8 18 10 19 11 21 12 21 @@ -72,6 +76,8 @@ class 'pkg/TestTryLoopNoCatch' { 15 21 16 21 17 21 + 18 21 + 19 21 1f 21 } } diff --git a/testData/results/pkg/TestTryLoopRecompile.dec b/testData/results/pkg/TestTryLoopRecompile.dec index 7fb43de408..24e65b936e 100644 --- a/testData/results/pkg/TestTryLoopRecompile.dec +++ b/testData/results/pkg/TestTryLoopRecompile.dec @@ -30,10 +30,14 @@ class 'pkg/TestTryLoopRecompile' { 2 12 3 12 4 12 + 5 12 + 6 12 b 13 16 16 17 17 18 17 + 19 17 + 1a 17 1b 20 } } diff --git a/testData/results/pkg/TestTryLoopReturnFinally.dec b/testData/results/pkg/TestTryLoopReturnFinally.dec index 0b53f10ca5..c2a842e58a 100644 --- a/testData/results/pkg/TestTryLoopReturnFinally.dec +++ b/testData/results/pkg/TestTryLoopReturnFinally.dec @@ -32,16 +32,22 @@ class 'pkg/TestTryLoopReturnFinally' { 3 11 7 12 8 12 + 9 12 + a 12 13 13 18 16 2c 19 2d 19 + 2e 19 + 2f 19 3c 21 3d 21 3e 21 3f 21 40 21 41 21 + 42 21 + 43 21 46 23 } } diff --git a/testData/results/pkg/TestTryLoopSimpleFinally.dec b/testData/results/pkg/TestTryLoopSimpleFinally.dec index 59126197d4..fa6e8de806 100644 --- a/testData/results/pkg/TestTryLoopSimpleFinally.dec +++ b/testData/results/pkg/TestTryLoopSimpleFinally.dec @@ -48,18 +48,24 @@ class 'pkg/TestTryLoopSimpleFinally' { 1e 16 1f 17 20 17 + 21 17 + 22 17 2f 19 30 19 31 19 32 19 33 19 34 19 + 35 19 + 36 19 39 21 } method 'test2 (ILjava/nio/file/Path;)V' { 0 25 1 25 + 2 25 + 3 25 8 26 c 26 d 27 @@ -67,12 +73,16 @@ class 'pkg/TestTryLoopSimpleFinally' { f 27 10 27 11 27 + 12 27 + 13 27 14 28 15 28 16 28 17 28 18 28 19 28 + 1a 28 + 1b 28 24 29 26 32 27 32 @@ -86,6 +96,8 @@ class 'pkg/TestTryLoopSimpleFinally' { 3f 35 40 35 41 35 + 42 35 + 43 35 } } @@ -108,4 +120,4 @@ Not mapped: 17 22 36 -40 \ No newline at end of file +40 diff --git a/testData/results/pkg/TestTryReturn.dec b/testData/results/pkg/TestTryReturn.dec index 6df5be330d..b78cc23df7 100644 --- a/testData/results/pkg/TestTryReturn.dec +++ b/testData/results/pkg/TestTryReturn.dec @@ -32,13 +32,13 @@ public class TestTryReturn { break label27; } } finally { - System.out.println("Finally"); + System.out.println("Finally");// 31 } return;// 28 } - System.out.println("suc");// 31 32 34 + System.out.println("suc");// 32 34 } public boolean testFinally2(Supplier supplier) { @@ -46,10 +46,10 @@ public class TestTryReturn { try { b = supplier.get();// 40 } finally { - System.out.println("Finally"); + System.out.println("Finally");// 42 } - return b;// 42 43 45 + return b;// 43 45 } public boolean testFinally3(boolean b, boolean c, int a, Supplier supplier) { @@ -77,10 +77,10 @@ public class TestTryReturn { try { b = supplier.get();// 67 } finally { - System.out.println("Finally"); + System.out.println("Finally");// 69 } - return b;// 69 70 72 + return b;// 70 72 } public boolean testFinally5(Supplier supplier) { @@ -262,6 +262,8 @@ class 'pkg/TestTryReturn' { 1b 19 1c 19 1d 19 + 1e 19 + 1f 19 } method 'testFinally1 (Ljava/util/function/Supplier;)V' { @@ -271,6 +273,8 @@ class 'pkg/TestTryReturn' { 3 26 4 26 5 26 + 6 26 + 7 26 8 30 9 30 a 30 @@ -281,27 +285,25 @@ class 'pkg/TestTryReturn' { 12 30 13 30 14 30 + 15 30 + 16 30 1f 37 28 40 29 40 2a 40 - 2b 40 2c 34 2d 34 2e 34 2f 34 30 34 31 34 - 32 40 - 33 40 - 34 40 - 35 40 + 32 34 + 33 34 36 40 37 40 - 38 40 39 40 3a 40 - 3b 41 + 3b 40 } method 'testFinally2 (Ljava/util/function/Supplier;)Z' { @@ -316,27 +318,26 @@ class 'pkg/TestTryReturn' { b 46 c 46 15 51 - 16 51 - 17 51 - 18 51 19 48 1a 48 1b 48 1c 48 1d 48 1e 48 - 1f 51 - 20 51 - 21 51 - 22 51 + 1f 48 + 20 48 23 51 } method 'testFinally3 (ZZILjava/util/function/Supplier;)Z' { 0 57 1 57 + 2 57 + 3 57 4 65 5 65 + 6 65 + 7 65 8 65 9 65 a 65 @@ -348,6 +349,8 @@ class 'pkg/TestTryReturn' { 13 65 14 65 15 65 + 16 65 + 17 65 1d 65 1e 65 27 70 @@ -355,9 +358,13 @@ class 'pkg/TestTryReturn' { 29 70 2a 58 2b 58 + 2c 58 + 2d 58 2e 59 2f 59 30 59 + 31 59 + 32 59 44 59 45 62 46 62 @@ -376,6 +383,8 @@ class 'pkg/TestTryReturn' { 64 67 65 67 66 67 + 67 67 + 68 67 } method 'testFinally4 (Ljava/util/function/Supplier;)Z' { @@ -392,19 +401,14 @@ class 'pkg/TestTryReturn' { d 77 e 77 17 82 - 18 82 - 19 82 - 1a 82 1b 79 1c 79 1d 79 1e 79 1f 79 20 79 - 21 82 - 22 82 - 23 82 - 24 82 + 21 79 + 22 79 25 82 } @@ -446,6 +450,8 @@ class 'pkg/TestTryReturn' { 40 94 41 94 42 94 + 43 94 + 44 94 48 97 49 97 } @@ -455,6 +461,8 @@ class 'pkg/TestTryReturn' { 1 101 2 104 3 104 + 4 104 + 5 104 6 105 7 105 8 106 @@ -463,6 +471,8 @@ class 'pkg/TestTryReturn' { b 106 c 106 d 106 + e 106 + f 106 10 109 11 109 12 109 @@ -498,6 +508,8 @@ class 'pkg/TestTryReturn' { 4f 114 50 114 51 114 + 52 114 + 53 114 57 117 58 117 } @@ -507,6 +519,8 @@ class 'pkg/TestTryReturn' { 1 121 2 125 3 125 + 4 125 + 5 125 e 126 1b 129 1c 129 @@ -514,6 +528,8 @@ class 'pkg/TestTryReturn' { 1e 129 1f 129 20 129 + 21 129 + 22 129 } method 'testPostdomFailure ()V' { @@ -522,6 +538,8 @@ class 'pkg/TestTryReturn' { 2 171 3 171 4 171 + 5 171 + 6 171 e 173 f 173 10 173 @@ -530,12 +548,16 @@ class 'pkg/TestTryReturn' { 16 176 17 176 18 176 + 19 176 + 1a 176 21 177 22 178 23 178 24 178 25 178 26 178 + 27 178 + 28 178 3a 183 3b 183 3c 183 @@ -550,16 +572,22 @@ class 'pkg/TestTryReturn' { 3 190 4 190 5 190 + 6 190 + 7 190 b 191 e 192 f 193 10 193 + 11 193 + 12 193 16 200 17 194 18 194 19 194 1a 194 1b 194 + 1c 194 + 1d 194 21 195 24 198 25 198 @@ -578,6 +606,8 @@ class 'pkg/TestTryReturn' { 7 209 8 209 9 209 + a 209 + b 209 13 210 14 211 15 216 @@ -585,6 +615,8 @@ class 'pkg/TestTryReturn' { 17 216 18 216 19 216 + 1a 216 + 1b 216 26 218 36 225 39 220 @@ -592,12 +624,16 @@ class 'pkg/TestTryReturn' { 3b 220 3c 220 3d 220 + 3e 220 + 3f 220 4a 217 4f 223 50 223 51 223 52 223 53 223 + 54 223 + 55 223 } } @@ -610,11 +646,11 @@ Lines mapping: 24 <-> 27 27 <-> 31 28 <-> 38 -31 <-> 41 +31 <-> 35 32 <-> 41 34 <-> 41 40 <-> 47 -42 <-> 52 +42 <-> 49 43 <-> 52 45 <-> 52 50 <-> 58 @@ -625,7 +661,7 @@ Lines mapping: 60 <-> 68 65 <-> 75 67 <-> 78 -69 <-> 83 +69 <-> 80 70 <-> 83 72 <-> 83 76 <-> 87 diff --git a/testData/results/pkg/TestTryReturnNoDebug.dec b/testData/results/pkg/TestTryReturnNoDebug.dec index b8fd38eaa9..3574ddefc8 100644 --- a/testData/results/pkg/TestTryReturnNoDebug.dec +++ b/testData/results/pkg/TestTryReturnNoDebug.dec @@ -72,6 +72,8 @@ class 'pkg/TestTryReturnNoDebug' { 1b 22 1c 22 1d 22 + 1e 22 + 1f 22 23 23 2f 24 30 24 diff --git a/testData/results/pkg/TestTrySplit.dec b/testData/results/pkg/TestTrySplit.dec index 51eb2fe90b..a39ced299e 100644 --- a/testData/results/pkg/TestTrySplit.dec +++ b/testData/results/pkg/TestTrySplit.dec @@ -32,17 +32,23 @@ class 'pkg/TestTrySplit' { 15 9 16 10 17 10 + 18 10 + 19 10 1a 11 1b 11 1c 11 1d 11 1e 11 1f 11 + 20 11 + 21 11 22 14 23 14 24 14 25 14 26 14 + 27 14 + 28 14 31 18 33 16 34 16 @@ -50,6 +56,8 @@ class 'pkg/TestTrySplit' { 36 16 37 16 38 16 + 39 16 + 3a 16 } method 'throwMyException (Ljava/lang/String;)V' { @@ -70,4 +78,4 @@ Lines mapping: 17 <-> 9 21 <-> 22 Not mapped: -18 \ No newline at end of file +18 diff --git a/testData/results/pkg/TestTrySynchronized.dec b/testData/results/pkg/TestTrySynchronized.dec index f50946cc84..cc770ca891 100644 --- a/testData/results/pkg/TestTrySynchronized.dec +++ b/testData/results/pkg/TestTrySynchronized.dec @@ -65,6 +65,8 @@ class 'pkg/TestTrySynchronized' { 27 17 28 18 29 18 + 2a 18 + 2b 18 2c 20 } @@ -104,6 +106,8 @@ class 'pkg/TestTrySynchronized' { 39 34 3a 35 3b 35 + 3c 35 + 3d 35 3e 37 } diff --git a/testData/results/pkg/TestTryVar.dec b/testData/results/pkg/TestTryVar.dec index e8dc67027d..00cd99acda 100644 --- a/testData/results/pkg/TestTryVar.dec +++ b/testData/results/pkg/TestTryVar.dec @@ -35,6 +35,8 @@ class 'pkg/TestTryVar' { 3 4 4 4 5 4 + 6 4 + 7 4 8 6 9 6 a 6 @@ -64,6 +66,8 @@ class 'pkg/TestTryVar' { 3 17 4 17 5 17 + 6 17 + 7 17 8 19 9 19 a 19 diff --git a/testData/results/pkg/TestTryVarNoDebug.dec b/testData/results/pkg/TestTryVarNoDebug.dec index 952d3d2cad..17d05639f4 100644 --- a/testData/results/pkg/TestTryVarNoDebug.dec +++ b/testData/results/pkg/TestTryVarNoDebug.dec @@ -35,6 +35,8 @@ class 'pkg/TestTryVarNoDebug' { 3 4 4 4 5 4 + 6 4 + 7 4 8 6 9 6 a 6 @@ -64,6 +66,8 @@ class 'pkg/TestTryVarNoDebug' { 3 17 4 17 5 17 + 6 17 + 7 17 8 19 9 19 a 19 diff --git a/testData/results/pkg/TestTryWithResourcesAfterSwitch.dec b/testData/results/pkg/TestTryWithResourcesAfterSwitch.dec index 139bcc11ce..7c607b2714 100644 --- a/testData/results/pkg/TestTryWithResourcesAfterSwitch.dec +++ b/testData/results/pkg/TestTryWithResourcesAfterSwitch.dec @@ -51,6 +51,8 @@ class 'pkg/TestTryWithResourcesAfterSwitch' { 3 7 4 8 5 8 + 6 8 + 7 8 f 9 10 11 11 11 @@ -59,6 +61,25 @@ class 'pkg/TestTryWithResourcesAfterSwitch' { 2d 13 2e 13 38 12 + 39 12 + 3a 12 + 3b 12 + 3c 12 + 3d 12 + 3e 12 + 3f 12 + 40 12 + 41 12 + 42 12 + 43 12 + 44 12 + 45 12 + 46 12 + 47 12 + 48 12 + 49 12 + 4a 12 + 4b 12 4c 15 4d 15 4e 15 @@ -73,6 +94,8 @@ class 'pkg/TestTryWithResourcesAfterSwitch' { 61 18 62 18 63 18 + 64 18 + 65 18 bf 24 c4 20 c5 20 @@ -80,6 +103,8 @@ class 'pkg/TestTryWithResourcesAfterSwitch' { c7 20 c8 20 c9 20 + ca 20 + cb 20 } method 'test2 ()V' { @@ -89,6 +114,8 @@ class 'pkg/TestTryWithResourcesAfterSwitch' { 3 27 4 28 5 28 + 6 28 + 7 28 f 29 10 31 11 31 @@ -97,6 +124,25 @@ class 'pkg/TestTryWithResourcesAfterSwitch' { 2d 33 2e 33 38 32 + 39 32 + 3a 32 + 3b 32 + 3c 32 + 3d 32 + 3e 32 + 3f 32 + 40 32 + 41 32 + 42 32 + 43 32 + 44 32 + 45 32 + 46 32 + 47 32 + 48 32 + 49 32 + 4a 32 + 4b 32 50 35 51 35 52 35 @@ -107,6 +153,8 @@ class 'pkg/TestTryWithResourcesAfterSwitch' { 5c 36 5d 36 5e 36 + 5f 36 + 60 36 b5 42 ba 38 bb 38 @@ -114,6 +162,8 @@ class 'pkg/TestTryWithResourcesAfterSwitch' { bd 38 be 38 bf 38 + c0 38 + c1 38 } } diff --git a/testData/results/pkg/TestTryWithResourcesCatchFinallyJ16.dec b/testData/results/pkg/TestTryWithResourcesCatchFinallyJ16.dec index bd6ed208b9..4c112900a6 100644 --- a/testData/results/pkg/TestTryWithResourcesCatchFinallyJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesCatchFinallyJ16.dec @@ -41,12 +41,16 @@ class 'pkg/TestTryWithResourcesCatchFinallyJ16' { 32 10 33 11 34 11 + 35 11 + 36 11 44 13 45 13 46 13 47 13 48 13 49 13 + 4a 13 + 4b 13 4f 15 } @@ -64,12 +68,16 @@ class 'pkg/TestTryWithResourcesCatchFinallyJ16' { 37 20 38 21 39 21 + 3a 21 + 3b 21 49 23 4a 23 4b 23 4c 23 4d 23 4e 23 + 4f 23 + 50 23 54 25 } diff --git a/testData/results/pkg/TestTryWithResourcesCatchJ16.dec b/testData/results/pkg/TestTryWithResourcesCatchJ16.dec index fa7f365e19..3448352b1b 100644 --- a/testData/results/pkg/TestTryWithResourcesCatchJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesCatchJ16.dec @@ -63,6 +63,8 @@ class 'pkg/TestTryWithResourcesCatchJ16' { 2a 10 2b 11 2c 11 + 2d 11 + 2e 11 2f 13 } @@ -80,6 +82,8 @@ class 'pkg/TestTryWithResourcesCatchJ16' { 2f 18 30 19 31 19 + 32 19 + 33 19 34 21 } @@ -111,14 +115,20 @@ class 'pkg/TestTryWithResourcesCatchJ16' { 18 33 19 33 1b 34 + 1c 34 + 1d 34 6d 36 6e 37 6f 37 70 37 71 37 72 37 + 73 37 + 74 37 75 40 76 40 + 77 40 + 78 40 79 41 7a 41 7b 41 @@ -131,6 +141,8 @@ class 'pkg/TestTryWithResourcesCatchJ16' { 85 43 86 43 87 43 + 88 43 + 89 43 8a 46 8b 46 } diff --git a/testData/results/pkg/TestTryWithResourcesFake.dec b/testData/results/pkg/TestTryWithResourcesFake.dec index 29f08bc9f1..fce47998ad 100644 --- a/testData/results/pkg/TestTryWithResourcesFake.dec +++ b/testData/results/pkg/TestTryWithResourcesFake.dec @@ -52,6 +52,8 @@ class 'pkg/TestTryWithResourcesFake' { 7 15 8 15 9 15 + a 15 + b 15 c 16 d 16 e 16 @@ -61,6 +63,8 @@ class 'pkg/TestTryWithResourcesFake' { 15 18 16 18 17 18 + 18 18 + 19 18 1a 22 1b 22 1c 22 @@ -76,10 +80,14 @@ class 'pkg/TestTryWithResourcesFake' { 30 26 36 29 37 29 + 38 29 + 39 29 3d 30 3e 31 3f 31 40 31 + 41 31 + 42 31 43 34 44 34 4b 37 diff --git a/testData/results/pkg/TestTryWithResourcesFakeTrigger.dec b/testData/results/pkg/TestTryWithResourcesFakeTrigger.dec index d40a7d24f0..334cd494d2 100644 --- a/testData/results/pkg/TestTryWithResourcesFakeTrigger.dec +++ b/testData/results/pkg/TestTryWithResourcesFakeTrigger.dec @@ -82,6 +82,8 @@ class 'pkg/TestTryWithResourcesFakeTrigger' { 6 13 7 13 8 13 + 9 13 + a 13 e 14 f 22 16 19 @@ -93,15 +95,21 @@ class 'pkg/TestTryWithResourcesFakeTrigger' { 1 25 2 27 3 27 + 4 27 + 5 27 6 29 7 29 8 29 9 29 a 29 b 29 + c 29 + d 29 11 30 12 31 13 31 + 14 31 + 15 31 19 35 1a 35 1b 35 @@ -121,11 +129,15 @@ class 'pkg/TestTryWithResourcesFakeTrigger' { c 44 12 47 13 47 + 14 47 + 15 47 19 48 1b 49 1c 49 1d 49 1e 49 + 1f 49 + 20 49 21 52 22 52 23 54 @@ -140,11 +152,15 @@ class 'pkg/TestTryWithResourcesFakeTrigger' { c 60 12 63 13 63 + 14 63 + 15 63 19 64 1b 65 1c 65 1d 65 1e 65 + 1f 65 + 20 65 21 68 22 68 23 70 diff --git a/testData/results/pkg/TestTryWithResourcesFinallyJ16.dec b/testData/results/pkg/TestTryWithResourcesFinallyJ16.dec index 5f1f03eacc..02601177c3 100644 --- a/testData/results/pkg/TestTryWithResourcesFinallyJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesFinallyJ16.dec @@ -41,6 +41,8 @@ class 'pkg/TestTryWithResourcesFinallyJ16' { 37 11 38 11 39 11 + 3a 11 + 3b 11 } method 'testFunc (Ljava/io/File;)V' { @@ -61,6 +63,8 @@ class 'pkg/TestTryWithResourcesFinallyJ16' { 3c 19 3d 19 3e 19 + 3f 19 + 40 19 } method 'create (Ljava/io/File;)Ljava/util/Scanner;' { diff --git a/testData/results/pkg/TestTryWithResourcesJ16.dec b/testData/results/pkg/TestTryWithResourcesJ16.dec index e7e0ed69d9..acdbbbebe4 100644 --- a/testData/results/pkg/TestTryWithResourcesJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesJ16.dec @@ -6,10 +6,10 @@ import java.util.Scanner; public class TestTryWithResourcesJ16 { public void test(File file) throws FileNotFoundException { - try (Scanner scanner = new Scanner(file)) { + try (Scanner scanner = new Scanner(file)) {// 11 scanner.next();// 12 } - }// 11 13 + }// 13 public void testFunc(File file) throws FileNotFoundException { try (Scanner scanner = this.create(file)) {// 17 @@ -31,26 +31,6 @@ class 'pkg/TestTryWithResourcesJ16' { b 9 c 9 12 11 - 13 11 - 14 11 - 15 11 - 16 11 - 17 11 - 18 11 - 19 11 - 1a 11 - 1b 11 - 1c 11 - 1d 11 - 1e 11 - 1f 11 - 20 11 - 21 11 - 22 11 - 23 11 - 24 11 - 25 11 - 26 11 } method 'testFunc (Ljava/io/File;)V' { @@ -74,7 +54,7 @@ class 'pkg/TestTryWithResourcesJ16' { } Lines mapping: -11 <-> 12 +11 <-> 9 12 <-> 10 13 <-> 12 17 <-> 15 diff --git a/testData/results/pkg/TestTryWithResourcesLoopJ16.dec b/testData/results/pkg/TestTryWithResourcesLoopJ16.dec index 6fb74aec21..902bd97a34 100644 --- a/testData/results/pkg/TestTryWithResourcesLoopJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesLoopJ16.dec @@ -96,6 +96,8 @@ class 'pkg/TestTryWithResourcesLoopJ16' { 8 10 9 10 a 10 + b 10 + c 10 18 11 19 11 1a 11 @@ -119,6 +121,8 @@ class 'pkg/TestTryWithResourcesLoopJ16' { f 23 10 23 11 23 + 12 23 + 13 23 1f 24 20 24 21 24 @@ -148,6 +152,8 @@ class 'pkg/TestTryWithResourcesLoopJ16' { 15 38 16 38 17 38 + 18 38 + 19 38 2d 42 2e 42 2f 42 @@ -177,11 +183,15 @@ class 'pkg/TestTryWithResourcesLoopJ16' { 15 53 16 53 17 53 + 18 53 + 19 53 2d 57 2e 57 2f 57 30 57 31 57 + 32 57 + 33 57 44 63 45 58 46 58 @@ -212,6 +222,8 @@ class 'pkg/TestTryWithResourcesLoopJ16' { 15 73 16 73 17 73 + 18 73 + 19 73 2d 74 2e 74 2f 74 diff --git a/testData/results/pkg/TestTryWithResourcesManyJ16.dec b/testData/results/pkg/TestTryWithResourcesManyJ16.dec index b9c75a8897..56b5698eb4 100644 --- a/testData/results/pkg/TestTryWithResourcesManyJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesManyJ16.dec @@ -19,7 +19,7 @@ public class TestTryWithResourcesManyJ16 { System.out.println(s4.nextLine());// 19 System.out.println(s5.nextLine());// 20 } - }// 9 21 + }// 21 } class 'pkg/TestTryWithResourcesManyJ16' { @@ -88,32 +88,13 @@ class 'pkg/TestTryWithResourcesManyJ16' { 60 19 61 19 62 19 + 63 19 + 64 19 df 21 - e0 21 - e1 21 - e2 21 - e3 21 - e4 21 - e5 21 - e6 21 - e7 21 - e8 21 - e9 21 - ea 21 - eb 21 - ec 21 - ed 21 - ee 21 - ef 21 - f0 21 - f1 21 - f2 21 - f3 21 } } Lines mapping: -9 <-> 22 10 <-> 10 11 <-> 11 12 <-> 12 @@ -126,4 +107,5 @@ Lines mapping: 20 <-> 20 21 <-> 22 Not mapped: +9 22 diff --git a/testData/results/pkg/TestTryWithResourcesMultiJ16.dec b/testData/results/pkg/TestTryWithResourcesMultiJ16.dec index 6430ae2817..e91ffeacc2 100644 --- a/testData/results/pkg/TestTryWithResourcesMultiJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesMultiJ16.dec @@ -8,13 +8,13 @@ import java.util.Scanner; public class TestTryWithResourcesMultiJ16 { public void testMulti(File file) throws IOException { try ( - Scanner scanner = new Scanner(file); + Scanner scanner = new Scanner(file);// 10 FileWriter writer = new FileWriter(file); ) { scanner.next();// 11 writer.write("hello");// 12 } - }// 10 13 + }// 13 } class 'pkg/TestTryWithResourcesMultiJ16' { @@ -31,32 +31,14 @@ class 'pkg/TestTryWithResourcesMultiJ16' { 18 14 19 14 1a 14 + 1b 14 + 1c 14 3d 16 - 3e 16 - 3f 16 - 40 16 - 41 16 - 42 16 - 43 16 - 44 16 - 45 16 - 46 16 - 47 16 - 48 16 - 49 16 - 4a 16 - 4b 16 - 4c 16 - 4d 16 - 4e 16 - 4f 16 - 50 16 - 51 16 } } Lines mapping: -10 <-> 17 +10 <-> 11 11 <-> 14 12 <-> 15 13 <-> 17 diff --git a/testData/results/pkg/TestTryWithResourcesNestedJ16.dec b/testData/results/pkg/TestTryWithResourcesNestedJ16.dec index 9d2de4e9cc..1cbbf63be5 100644 --- a/testData/results/pkg/TestTryWithResourcesNestedJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesNestedJ16.dec @@ -7,14 +7,14 @@ import java.util.Scanner; public class TestTryWithResourcesNestedJ16 { public void testNested(File file) throws IOException { try ( - Scanner scanner = new Scanner(file); + Scanner scanner = new Scanner(file);// 10 Scanner scanner1 = new Scanner(file);// 11 Scanner scanner2 = new Scanner(file);// 12 Scanner scanner3 = new Scanner(file);// 13 ) { scanner.next();// 14 } - }// 10 18 + }// 18 public void testNestedFinally(File file) throws IOException { try (Scanner scanner = new Scanner(file)) {// 22 @@ -54,26 +54,6 @@ class 'pkg/TestTryWithResourcesNestedJ16' { 28 14 29 14 87 16 - 88 16 - 89 16 - 8a 16 - 8b 16 - 8c 16 - 8d 16 - 8e 16 - 8f 16 - 90 16 - 91 16 - 92 16 - 93 16 - 94 16 - 95 16 - 96 16 - 97 16 - 98 16 - 99 16 - 9a 16 - 9b 16 } method 'testNestedFinally (Ljava/io/File;)V' { @@ -96,27 +76,35 @@ class 'pkg/TestTryWithResourcesNestedJ16' { 57 25 58 25 59 25 + 5a 25 + 5b 25 89 28 8a 28 8b 28 8c 28 8d 28 + 8e 28 + 8f 28 bb 31 bc 31 bd 31 be 31 bf 31 + c0 31 + c1 31 e5 36 ea 34 eb 34 ec 34 ed 34 ee 34 + ef 34 + f0 34 } } Lines mapping: -10 <-> 17 +10 <-> 10 11 <-> 11 12 <-> 12 13 <-> 13 diff --git a/testData/results/pkg/TestTryWithResourcesNestedLoop.dec b/testData/results/pkg/TestTryWithResourcesNestedLoop.dec index 03a6f6feb4..e51c2a74f3 100644 --- a/testData/results/pkg/TestTryWithResourcesNestedLoop.dec +++ b/testData/results/pkg/TestTryWithResourcesNestedLoop.dec @@ -71,6 +71,8 @@ class 'pkg/TestTryWithResourcesNestedLoop' { 27 16 28 16 29 16 + 2a 16 + 2b 16 2c 16 2d 16 2e 16 @@ -79,6 +81,8 @@ class 'pkg/TestTryWithResourcesNestedLoop' { 31 16 32 16 33 16 + 34 16 + 35 16 3a 17 3d 17 3e 17 @@ -107,6 +111,8 @@ class 'pkg/TestTryWithResourcesNestedLoop' { 58 20 59 20 5a 20 + 5b 20 + 5c 20 5d 21 5e 21 5f 21 @@ -121,6 +127,8 @@ class 'pkg/TestTryWithResourcesNestedLoop' { 68 21 69 21 6a 21 + 6b 21 + 6c 21 6d 22 6e 22 6f 22 diff --git a/testData/results/pkg/TestTryWithResourcesOuterJ16.dec b/testData/results/pkg/TestTryWithResourcesOuterJ16.dec index 6579f98eb2..c3f1276292 100644 --- a/testData/results/pkg/TestTryWithResourcesOuterJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesOuterJ16.dec @@ -309,7 +309,7 @@ public class TestTryWithResourcesOuterJ16 { }// 93 public void testSame4(File file) throws FileNotFoundException { - try (Scanner scanner = new Scanner(file)) { + try (Scanner scanner = new Scanner(file)) {// 96 Scanner var3 = scanner; try { @@ -330,7 +330,7 @@ public class TestTryWithResourcesOuterJ16 { scanner.close(); } } - }// 96 100 + }// 100 private Scanner create(File file) throws FileNotFoundException { return new Scanner(file);// 104 @@ -349,6 +349,8 @@ class 'pkg/TestTryWithResourcesOuterJ16' { e 14 10 27 11 27 + 12 27 + 13 27 14 28 15 28 16 28 @@ -356,14 +358,20 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 1b 15 1d 16 1e 16 + 1f 16 + 20 16 21 18 22 18 + 23 18 + 24 18 28 19 2a 20 2b 20 2c 20 2d 20 2e 20 + 2f 20 + 30 20 31 24 32 24 33 24 @@ -385,6 +393,8 @@ class 'pkg/TestTryWithResourcesOuterJ16' { b 37 d 50 e 50 + f 50 + 10 50 11 51 12 51 13 51 @@ -392,14 +402,20 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 18 38 1a 39 1b 39 + 1c 39 + 1d 39 1e 41 1f 41 + 20 41 + 21 41 25 42 27 43 28 43 29 43 2a 43 2b 43 + 2c 43 + 2d 43 2e 47 2f 47 30 47 @@ -425,9 +441,13 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 1e 65 1f 65 20 65 + 21 65 + 22 65 23 78 24 78 25 78 + 26 78 + 27 78 28 79 29 79 2a 79 @@ -437,21 +457,29 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 32 67 33 67 34 67 + 35 67 + 36 67 37 69 38 69 39 69 + 3a 69 + 3b 69 3f 70 41 71 42 71 43 71 44 71 45 71 + 46 71 + 47 71 48 75 49 75 4a 75 4b 93 4c 93 4d 93 + 4e 93 + 4f 93 50 94 51 94 52 94 @@ -461,15 +489,21 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 5a 82 5b 82 5c 82 + 5d 82 + 5e 82 5f 84 60 84 61 84 + 62 84 + 63 84 67 85 69 86 6a 86 6b 86 6c 86 6d 86 + 6e 86 + 6f 86 70 90 71 90 72 90 @@ -495,9 +529,13 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 1e 108 1f 108 20 108 + 21 108 + 22 108 23 121 24 121 25 121 + 26 121 + 27 121 28 122 29 122 2a 122 @@ -507,21 +545,29 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 32 110 33 110 34 110 + 35 110 + 36 110 37 112 38 112 39 112 + 3a 112 + 3b 112 3f 113 41 114 42 114 43 114 44 114 45 114 + 46 114 + 47 114 48 118 49 118 4a 118 4b 136 4c 136 4d 136 + 4e 136 + 4f 136 50 137 51 137 52 137 @@ -531,15 +577,21 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 5a 125 5b 125 5c 125 + 5d 125 + 5e 125 5f 127 60 127 61 127 + 62 127 + 63 127 67 128 69 129 6a 129 6b 129 6c 129 6d 129 + 6e 129 + 6f 129 70 133 71 133 72 133 @@ -565,9 +617,13 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 1e 151 1f 151 20 151 + 21 151 + 22 151 23 164 24 164 25 164 + 26 164 + 27 164 28 165 29 165 2a 165 @@ -577,21 +633,29 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 32 153 33 153 34 153 + 35 153 + 36 153 37 155 38 155 39 155 + 3a 155 + 3b 155 3f 156 41 157 42 157 43 157 44 157 45 157 + 46 157 + 47 157 48 161 49 161 4a 161 4b 179 4c 179 4d 179 + 4e 179 + 4f 179 50 180 51 180 52 180 @@ -601,15 +665,21 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 5a 168 5b 168 5c 168 + 5d 168 + 5e 168 5f 170 60 170 61 170 + 62 170 + 63 170 67 171 69 172 6a 172 6b 172 6c 172 6d 172 + 6e 172 + 6f 172 70 176 71 176 72 176 @@ -635,6 +705,8 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 18 206 19 206 1a 206 + 1b 206 + 1c 206 1d 207 1e 207 1f 207 @@ -644,20 +716,28 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 27 195 28 195 29 195 + 2a 195 + 2b 195 2c 197 2d 197 2e 197 + 2f 197 + 30 197 34 198 36 199 37 199 38 199 39 199 3a 199 + 3b 199 + 3c 199 3d 203 3e 203 3f 203 40 221 41 221 + 42 221 + 43 221 44 222 45 222 46 222 @@ -665,14 +745,20 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 4b 209 4d 210 4e 210 + 4f 210 + 50 210 51 212 52 212 + 53 212 + 54 212 58 213 5a 214 5b 214 5c 214 5d 214 5e 214 + 5f 214 + 60 214 61 218 62 218 63 218 @@ -694,6 +780,8 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 13 247 14 247 15 247 + 16 247 + 17 247 18 248 19 248 1a 248 @@ -703,20 +791,28 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 22 236 23 236 24 236 + 25 236 + 26 236 27 238 28 238 29 238 + 2a 238 + 2b 238 2f 239 31 240 32 240 33 240 34 240 35 240 + 36 240 + 37 240 38 244 39 244 3a 244 3b 262 3c 262 + 3d 262 + 3e 262 3f 263 40 263 41 263 @@ -724,14 +820,20 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 46 250 48 251 49 251 + 4a 251 + 4b 251 4c 253 4d 253 + 4e 253 + 4f 253 53 254 55 255 56 255 57 255 58 255 59 255 + 5a 255 + 5b 255 5c 259 5d 259 5e 259 @@ -753,6 +855,8 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 13 288 14 288 15 288 + 16 288 + 17 288 18 289 19 289 1a 289 @@ -762,15 +866,21 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 22 277 23 277 24 277 + 25 277 + 26 277 27 279 28 279 29 279 + 2a 279 + 2b 279 2f 280 31 281 32 281 33 281 34 281 35 281 + 36 281 + 37 281 38 285 39 285 3a 285 @@ -780,6 +890,8 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 3e 292 40 305 41 305 + 42 305 + 43 305 44 306 45 306 46 306 @@ -787,14 +899,20 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 4b 293 4d 294 4e 294 + 4f 294 + 50 294 51 296 52 296 + 53 296 + 54 296 58 297 5a 298 5b 298 5c 298 5d 298 5e 298 + 5f 298 + 60 298 61 302 62 302 63 302 @@ -812,6 +930,8 @@ class 'pkg/TestTryWithResourcesOuterJ16' { e 315 10 328 11 328 + 12 328 + 13 328 14 329 15 329 16 329 @@ -819,38 +939,24 @@ class 'pkg/TestTryWithResourcesOuterJ16' { 1b 316 1d 317 1e 317 + 1f 317 + 20 317 21 319 22 319 + 23 319 + 24 319 28 320 2a 321 2b 321 2c 321 2d 321 2e 321 + 2f 321 + 30 321 31 325 32 325 33 325 38 332 - 39 332 - 3a 332 - 3b 332 - 3c 332 - 3d 332 - 3e 332 - 3f 332 - 40 332 - 41 332 - 42 332 - 43 332 - 44 332 - 45 332 - 46 332 - 47 332 - 48 332 - 49 332 - 4a 332 - 4b 332 - 4c 332 } method 'create (Ljava/io/File;)Ljava/util/Scanner;' { @@ -918,7 +1024,7 @@ Lines mapping: 91 <-> 293 92 <-> 306 93 <-> 309 -96 <-> 333 +96 <-> 312 97 <-> 317 98 <-> 316 99 <-> 329 diff --git a/testData/results/pkg/TestTryWithResourcesReturnJ16.dec b/testData/results/pkg/TestTryWithResourcesReturnJ16.dec index d9a132f31b..2d6e7f7463 100644 --- a/testData/results/pkg/TestTryWithResourcesReturnJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesReturnJ16.dec @@ -203,12 +203,16 @@ class 'pkg/TestTryWithResourcesReturnJ16' { 17 99 18 99 19 99 + 1a 99 + 1b 99 1c 99 1d 99 1e 99 1f 99 20 99 21 99 + 22 99 + 23 99 24 111 25 111 26 111 @@ -238,6 +242,8 @@ class 'pkg/TestTryWithResourcesReturnJ16' { 53 103 54 103 55 103 + 56 103 + 57 103 58 104 59 104 5a 104 @@ -278,12 +284,16 @@ class 'pkg/TestTryWithResourcesReturnJ16' { 11 122 12 122 13 122 + 14 122 + 15 122 16 122 17 122 18 122 19 122 1a 122 1b 122 + 1c 122 + 1d 122 1e 123 1f 123 20 123 @@ -313,6 +323,8 @@ class 'pkg/TestTryWithResourcesReturnJ16' { a 134 b 134 c 134 + d 134 + e 134 f 135 10 135 11 135 diff --git a/testData/results/pkg/TestTryWithResourcesSwitchJ16.dec b/testData/results/pkg/TestTryWithResourcesSwitchJ16.dec index 6431d6f233..e9da125776 100644 --- a/testData/results/pkg/TestTryWithResourcesSwitchJ16.dec +++ b/testData/results/pkg/TestTryWithResourcesSwitchJ16.dec @@ -91,6 +91,31 @@ class 'pkg/TestTryWithResourcesSwitchJ16' { 8 9 9 9 a 9 + b 9 + c 9 + d 9 + e 9 + f 9 + 10 9 + 11 9 + 12 9 + 13 9 + 14 9 + 15 9 + 16 9 + 17 9 + 18 9 + 19 9 + 1a 9 + 1b 9 + 1c 9 + 1d 9 + 1e 9 + 1f 9 + 20 9 + 21 9 + 22 9 + 23 9 24 11 25 11 26 11 @@ -115,6 +140,8 @@ class 'pkg/TestTryWithResourcesSwitchJ16' { 3d 17 3e 17 3f 17 + 40 17 + 41 17 63 20 } @@ -130,6 +157,31 @@ class 'pkg/TestTryWithResourcesSwitchJ16' { 8 25 9 25 a 25 + b 25 + c 25 + d 25 + e 25 + f 25 + 10 25 + 11 25 + 12 25 + 13 25 + 14 25 + 15 25 + 16 25 + 17 25 + 18 25 + 19 25 + 1a 25 + 1b 25 + 1c 25 + 1d 25 + 1e 25 + 1f 25 + 20 25 + 21 25 + 22 25 + 23 25 24 27 25 27 26 27 @@ -145,18 +197,24 @@ class 'pkg/TestTryWithResourcesSwitchJ16' { 32 30 33 30 34 30 + 35 30 + 36 30 42 33 43 33 44 33 45 33 46 33 47 33 + 48 33 + 49 33 4a 36 4b 36 4c 36 4d 36 4e 36 4f 36 + 50 36 + 51 36 73 40 74 40 75 40 @@ -170,12 +228,16 @@ class 'pkg/TestTryWithResourcesSwitchJ16' { 7d 41 7e 41 7f 41 + 80 41 + 81 41 82 42 83 42 84 42 85 42 86 42 87 42 + 88 42 + 89 42 8a 44 } @@ -191,6 +253,31 @@ class 'pkg/TestTryWithResourcesSwitchJ16' { 8 49 9 49 a 49 + b 49 + c 49 + d 49 + e 49 + f 49 + 10 49 + 11 49 + 12 49 + 13 49 + 14 49 + 15 49 + 16 49 + 17 49 + 18 49 + 19 49 + 1a 49 + 1b 49 + 1c 49 + 1d 49 + 1e 49 + 1f 49 + 20 49 + 21 49 + 22 49 + 23 49 24 51 25 51 26 51 @@ -206,6 +293,8 @@ class 'pkg/TestTryWithResourcesSwitchJ16' { 32 54 33 54 34 54 + 35 54 + 36 54 42 57 43 57 44 57 @@ -222,12 +311,16 @@ class 'pkg/TestTryWithResourcesSwitchJ16' { 59 60 5a 60 5b 60 + 5c 60 + 5d 60 5e 63 5f 63 60 63 61 63 62 63 63 63 + 64 63 + 65 63 87 67 88 67 89 67 @@ -241,12 +334,16 @@ class 'pkg/TestTryWithResourcesSwitchJ16' { 91 68 92 68 93 68 + 94 68 + 95 68 96 69 97 69 98 69 99 69 9a 69 9b 69 + 9c 69 + 9d 69 9e 72 9f 72 } diff --git a/testData/results/pkg/TestUnionTypeAssign.dec b/testData/results/pkg/TestUnionTypeAssign.dec index 2ac099f85b..71337fbebc 100644 --- a/testData/results/pkg/TestUnionTypeAssign.dec +++ b/testData/results/pkg/TestUnionTypeAssign.dec @@ -132,4 +132,4 @@ Lines mapping: 23 <-> 23 24 <-> 24 27 <-> 27 -28 <-> 28 \ No newline at end of file +28 <-> 28 diff --git a/testData/results/pkg/TestUnknownCast.dec b/testData/results/pkg/TestUnknownCast.dec index 3a976f71a7..dc309b7654 100644 --- a/testData/results/pkg/TestUnknownCast.dec +++ b/testData/results/pkg/TestUnknownCast.dec @@ -31,6 +31,8 @@ class 'pkg/TestUnknownCast' { 3 5 4 8 5 8 + 6 8 + 7 8 f 9 10 12 11 12 @@ -40,6 +42,8 @@ class 'pkg/TestUnknownCast' { 1d 19 1e 19 1f 19 + 20 19 + 21 19 22 19 24 20 25 20 diff --git a/testData/results/pkg/TestUnknownCastJ17.dec b/testData/results/pkg/TestUnknownCastJ17.dec index 27deb46c4a..d0626a4a52 100644 --- a/testData/results/pkg/TestUnknownCastJ17.dec +++ b/testData/results/pkg/TestUnknownCastJ17.dec @@ -105,6 +105,15 @@ class 'pkg/TestUnknownCastJ17' { 22 33 26 37 2e 37 + 2f 37 + 30 37 + 31 37 + 32 37 + 33 37 + 34 37 + 35 37 + 36 37 + 37 37 38 39 39 39 3a 39 @@ -128,6 +137,8 @@ class 'pkg/TestUnknownCastJ17' { 4d 43 4e 43 4f 43 + 50 43 + 51 43 52 44 53 44 54 44 diff --git a/testData/results/pkg/TestUnnamedVar1.dec b/testData/results/pkg/TestUnnamedVar1.dec index 63186cd056..b7b5dfcd72 100644 --- a/testData/results/pkg/TestUnnamedVar1.dec +++ b/testData/results/pkg/TestUnnamedVar1.dec @@ -103,20 +103,28 @@ class 'pkg/TestUnnamedVar1' { 2 10 3 10 4 10 + 5 10 + 6 10 b 10 c 11 d 17 + e 17 + f 17 10 24 11 24 12 40 13 40 15 25 16 28 + 17 28 + 18 28 1b 40 1c 40 1d 40 1e 40 1f 40 + 20 40 + 21 40 25 36 2a 37 2b 37 @@ -133,15 +141,21 @@ class 'pkg/TestUnnamedVar1' { 2 46 3 46 4 46 + 5 46 + 6 46 b 46 c 47 d 53 + e 53 + f 53 10 60 11 60 12 78 13 78 15 61 16 64 + 17 64 + 18 64 19 76 1a 76 1b 77 @@ -150,11 +164,15 @@ class 'pkg/TestUnnamedVar1' { 1e 77 1f 77 20 77 + 21 77 + 22 77 23 78 24 78 25 78 26 78 27 78 + 28 78 + 29 78 2d 72 32 73 33 73 @@ -210,4 +228,4 @@ Lines mapping: 30 <-> 91 33 <-> 93 Not mapped: -32 \ No newline at end of file +32 diff --git a/testData/results/pkg/TestVarRedef.dec b/testData/results/pkg/TestVarRedef.dec index 51b6265a66..e084080e9a 100644 --- a/testData/results/pkg/TestVarRedef.dec +++ b/testData/results/pkg/TestVarRedef.dec @@ -47,6 +47,8 @@ class 'pkg/TestVarRedef' { 1 13 2 17 3 17 + 4 17 + 5 17 6 24 7 24 8 25 @@ -77,12 +79,16 @@ class 'pkg/TestVarRedef' { 56 27 59 29 5a 29 + 5b 29 + 5c 29 5d 30 5e 30 5f 30 60 30 61 30 62 30 + 63 30 + 64 30 } } diff --git a/testData/results/pkg/TestWhileCondition.dec b/testData/results/pkg/TestWhileCondition.dec index 5080951453..f2450b4663 100644 --- a/testData/results/pkg/TestWhileCondition.dec +++ b/testData/results/pkg/TestWhileCondition.dec @@ -30,13 +30,19 @@ class 'pkg/TestWhileCondition' { 5 6 6 6 7 6 + 8 6 + 9 6 a 6 b 6 + c 6 + d 6 e 6 f 6 10 6 11 6 12 6 + 13 6 + 14 6 15 7 16 7 17 7 @@ -57,15 +63,23 @@ class 'pkg/TestWhileCondition' { 7 15 8 15 9 15 + a 15 + b 15 c 15 d 15 + e 15 + f 15 10 15 11 15 12 15 13 15 14 15 + 15 15 + 16 15 17 15 18 15 + 19 15 + 1a 15 1b 16 1c 16 1d 16 @@ -74,6 +88,8 @@ class 'pkg/TestWhileCondition' { 20 17 21 15 22 15 + 23 15 + 24 15 2a 15 2e 19 } diff --git a/testData/results/pkg/TestWhileConditionTernary.dec b/testData/results/pkg/TestWhileConditionTernary.dec index 0dfe5c2152..de013ba3db 100644 --- a/testData/results/pkg/TestWhileConditionTernary.dec +++ b/testData/results/pkg/TestWhileConditionTernary.dec @@ -29,16 +29,22 @@ class 'pkg/TestWhileConditionTernary' { 2 4 3 4 4 4 + 5 4 + 6 4 7 5 8 5 9 5 a 5 b 5 + c 5 + d 5 e 5 f 5 10 5 11 5 12 5 + 13 5 + 14 5 15 5 16 5 17 5 @@ -49,11 +55,15 @@ class 'pkg/TestWhileConditionTernary' { 1c 5 1d 5 1e 5 + 1f 5 + 20 5 24 5 25 5 26 5 27 5 28 5 + 29 5 + 2a 5 2b 6 2c 6 2d 6 diff --git a/testData/results/pkg/TestWhileForeach.dec b/testData/results/pkg/TestWhileForeach.dec index 7321d6b081..515cf33205 100644 --- a/testData/results/pkg/TestWhileForeach.dec +++ b/testData/results/pkg/TestWhileForeach.dec @@ -51,6 +51,8 @@ class 'pkg/TestWhileForeach' { 13 13 14 13 15 13 + 16 13 + 17 13 18 14 19 14 1a 14 @@ -72,6 +74,8 @@ class 'pkg/TestWhileForeach' { 33 15 34 15 35 15 + 36 15 + 37 15 38 16 39 16 3a 16 @@ -108,4 +112,4 @@ Lines mapping: 31 <-> 29 Not mapped: 22 -25 \ No newline at end of file +25 diff --git a/testData/results/pkg/TestWhileIterator.dec b/testData/results/pkg/TestWhileIterator.dec index e875c815d6..a4bb8288e6 100644 --- a/testData/results/pkg/TestWhileIterator.dec +++ b/testData/results/pkg/TestWhileIterator.dec @@ -47,6 +47,8 @@ class 'pkg/TestWhileIterator' { 16 12 17 12 18 12 + 19 12 + 1a 12 1b 12 1c 12 1d 12 @@ -55,6 +57,8 @@ class 'pkg/TestWhileIterator' { 20 12 21 12 22 12 + 23 12 + 24 12 25 13 26 13 27 13 @@ -72,6 +76,8 @@ class 'pkg/TestWhileIterator' { 33 13 34 13 35 13 + 36 13 + 37 13 38 14 39 14 3a 14 diff --git a/testData/results/pkg/TestWhileLambda.dec b/testData/results/pkg/TestWhileLambda.dec index 346d73e27d..b9e6638c60 100644 --- a/testData/results/pkg/TestWhileLambda.dec +++ b/testData/results/pkg/TestWhileLambda.dec @@ -18,6 +18,8 @@ class 'pkg/TestWhileLambda' { 7 6 8 8 9 8 + a 8 + b 8 13 9 1a 10 1e 12 diff --git a/testData/results/pkg/TestWhileTernary1.dec b/testData/results/pkg/TestWhileTernary1.dec index 10c03079ed..4f357caeaa 100644 --- a/testData/results/pkg/TestWhileTernary1.dec +++ b/testData/results/pkg/TestWhileTernary1.dec @@ -19,14 +19,22 @@ class 'pkg/TestWhileTernary1' { method 'test (ZII)I' { 0 4 1 4 + 2 4 + 3 4 4 7 5 7 + 6 7 + 7 7 8 7 9 7 a 7 + b 7 + c 7 10 7 11 7 12 7 + 13 7 + 14 7 15 8 16 8 17 8 diff --git a/testData/results/pkg/TestWhileTernary10.dec b/testData/results/pkg/TestWhileTernary10.dec index b3ef2d2a07..351f887047 100644 --- a/testData/results/pkg/TestWhileTernary10.dec +++ b/testData/results/pkg/TestWhileTernary10.dec @@ -60,14 +60,20 @@ class 'pkg/TestWhileTernary10' { c 8 d 8 e 8 + f 8 + 10 8 11 8 12 8 13 8 14 8 + 15 8 + 16 8 1a 8 1b 8 1c 8 1d 8 + 1e 8 + 1f 8 20 9 21 9 22 9 @@ -75,6 +81,8 @@ class 'pkg/TestWhileTernary10' { 24 9 25 9 26 9 + 27 9 + 28 9 29 10 2a 10 2b 10 @@ -87,7 +95,11 @@ class 'pkg/TestWhileTernary10' { 32 11 33 11 34 11 + 35 11 + 36 11 37 12 + 38 12 + 39 12 3a 9 3b 9 3c 9 @@ -128,14 +140,20 @@ class 'pkg/TestWhileTernary10' { c 24 d 24 e 24 + f 24 + 10 24 11 24 12 24 13 24 14 24 + 15 24 + 16 24 1a 24 1b 24 1c 24 1d 24 + 1e 24 + 1f 24 20 25 21 25 22 25 @@ -180,14 +198,20 @@ class 'pkg/TestWhileTernary10' { c 35 d 35 e 35 + f 35 + 10 35 11 35 12 35 13 35 14 35 + 15 35 + 16 35 1a 35 1b 35 1c 35 1d 35 + 1e 35 + 1f 35 20 36 21 36 22 36 @@ -195,6 +219,8 @@ class 'pkg/TestWhileTernary10' { 24 36 25 36 26 36 + 27 36 + 28 36 29 37 2a 37 2b 37 @@ -203,6 +229,8 @@ class 'pkg/TestWhileTernary10' { 2e 37 2f 37 30 37 + 31 37 + 32 37 33 38 34 38 35 38 @@ -215,7 +243,11 @@ class 'pkg/TestWhileTernary10' { 3c 39 3d 39 3e 39 + 3f 39 + 40 39 41 40 + 42 40 + 43 40 44 37 45 37 46 37 diff --git a/testData/results/pkg/TestWhileTernary2.dec b/testData/results/pkg/TestWhileTernary2.dec index 745f49db13..b5dd3cf3bc 100644 --- a/testData/results/pkg/TestWhileTernary2.dec +++ b/testData/results/pkg/TestWhileTernary2.dec @@ -13,12 +13,18 @@ class 'pkg/TestWhileTernary2' { method 'test (ZII)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 c 4 d 4 e 4 + f 4 + 10 4 11 5 12 5 13 5 diff --git a/testData/results/pkg/TestWhileTernary3.dec b/testData/results/pkg/TestWhileTernary3.dec index b05b60b7fd..aa4158cecf 100644 --- a/testData/results/pkg/TestWhileTernary3.dec +++ b/testData/results/pkg/TestWhileTernary3.dec @@ -15,12 +15,18 @@ class 'pkg/TestWhileTernary3' { method 'test (ZII)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 c 4 d 4 e 4 + f 4 + 10 4 11 5 12 5 13 5 diff --git a/testData/results/pkg/TestWhileTernary4.dec b/testData/results/pkg/TestWhileTernary4.dec index cfce795dfe..668909c927 100644 --- a/testData/results/pkg/TestWhileTernary4.dec +++ b/testData/results/pkg/TestWhileTernary4.dec @@ -13,12 +13,18 @@ class 'pkg/TestWhileTernary4' { method 'test (ZII)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 c 4 d 4 e 4 + f 4 + 10 4 14 7 15 7 16 7 diff --git a/testData/results/pkg/TestWhileTernary5.dec b/testData/results/pkg/TestWhileTernary5.dec index 5225fbd46d..ea8da41436 100644 --- a/testData/results/pkg/TestWhileTernary5.dec +++ b/testData/results/pkg/TestWhileTernary5.dec @@ -22,6 +22,8 @@ class 'pkg/TestWhileTernary5' { 1 4 2 4 3 4 + 4 4 + 5 4 6 5 7 5 8 5 @@ -30,14 +32,22 @@ class 'pkg/TestWhileTernary5' { b 6 c 6 d 6 + e 6 + f 6 10 8 11 8 + 12 8 + 13 8 14 8 15 8 16 8 + 17 8 + 18 8 1c 8 1d 8 1e 8 + 1f 8 + 20 8 21 9 22 9 23 9 diff --git a/testData/results/pkg/TestWhileTernary6.dec b/testData/results/pkg/TestWhileTernary6.dec index 6e39175f92..6e8a2c5001 100644 --- a/testData/results/pkg/TestWhileTernary6.dec +++ b/testData/results/pkg/TestWhileTernary6.dec @@ -27,15 +27,25 @@ class 'pkg/TestWhileTernary6' { a 7 b 7 c 7 + d 7 + e 7 f 8 + 10 8 + 11 8 12 10 13 10 + 14 10 + 15 10 16 10 17 10 18 10 + 19 10 + 1a 10 1e 10 1f 10 20 10 + 21 10 + 22 10 23 11 } } diff --git a/testData/results/pkg/TestWhileTernary7.dec b/testData/results/pkg/TestWhileTernary7.dec index cca8ef7edd..d32660b4e7 100644 --- a/testData/results/pkg/TestWhileTernary7.dec +++ b/testData/results/pkg/TestWhileTernary7.dec @@ -15,14 +15,20 @@ class 'pkg/TestWhileTernary7' { 2 4 3 4 4 4 + 5 4 + 6 4 7 4 8 4 9 4 a 4 + b 4 + c 4 10 4 11 4 12 4 13 4 + 14 4 + 15 4 16 5 17 5 18 5 diff --git a/testData/results/pkg/TestWhileTernary8.dec b/testData/results/pkg/TestWhileTernary8.dec index 71a55c113d..483f74338e 100644 --- a/testData/results/pkg/TestWhileTernary8.dec +++ b/testData/results/pkg/TestWhileTernary8.dec @@ -13,18 +13,28 @@ class 'pkg/TestWhileTernary8' { method 'test (ZII)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 9 4 a 4 b 4 + c 4 + d 4 11 4 12 4 13 4 + 14 4 + 15 4 19 4 1a 4 1b 4 + 1c 4 + 1d 4 1e 5 1f 5 20 5 diff --git a/testData/results/pkg/TestWhileTernary9.dec b/testData/results/pkg/TestWhileTernary9.dec index 3fcefc1190..93b2edebc5 100644 --- a/testData/results/pkg/TestWhileTernary9.dec +++ b/testData/results/pkg/TestWhileTernary9.dec @@ -45,10 +45,16 @@ class 'pkg/TestWhileTernary9' { 2 4 3 6 4 6 + 5 6 + 6 6 7 6 8 6 + 9 6 + a 6 e 6 f 6 + 10 6 + 11 6 12 7 13 7 14 7 @@ -57,6 +63,8 @@ class 'pkg/TestWhileTernary9' { 17 7 18 7 19 7 + 1a 7 + 1b 7 1f 11 } @@ -69,15 +77,23 @@ class 'pkg/TestWhileTernary9' { 5 14 6 14 7 14 + 8 14 + 9 14 a 15 b 15 c 15 d 17 e 17 + f 17 + 10 17 11 17 12 17 + 13 17 + 14 17 18 17 19 17 + 1a 17 + 1b 17 1c 18 1d 18 1e 18 @@ -86,6 +102,8 @@ class 'pkg/TestWhileTernary9' { 21 18 22 18 23 18 + 24 18 + 25 18 29 23 } @@ -98,15 +116,23 @@ class 'pkg/TestWhileTernary9' { 5 26 6 26 7 26 + 8 26 + 9 26 a 27 b 27 c 27 d 29 e 29 + f 29 + 10 29 11 29 12 29 + 13 29 + 14 29 18 29 19 29 + 1a 29 + 1b 29 1c 30 1d 30 1e 30 @@ -115,12 +141,16 @@ class 'pkg/TestWhileTernary9' { 21 30 22 30 23 30 + 24 30 + 25 30 29 35 2a 35 2b 35 2c 35 2d 35 2e 35 + 2f 35 + 30 35 31 37 } } diff --git a/testData/results/pkg/TestWhileTernaryFake.dec b/testData/results/pkg/TestWhileTernaryFake.dec index 2d7a6e6d67..e05a4409b0 100644 --- a/testData/results/pkg/TestWhileTernaryFake.dec +++ b/testData/results/pkg/TestWhileTernaryFake.dec @@ -13,12 +13,18 @@ class 'pkg/TestWhileTernaryFake' { method 'test2 (ZII)V' { 0 4 1 4 + 2 4 + 3 4 4 4 5 4 6 4 + 7 4 + 8 4 c 4 d 4 e 4 + f 4 + 10 4 14 5 15 5 16 5 From 84cf6f06f2cb0c9ae248dd71daaf6df8d08a9f86 Mon Sep 17 00:00:00 2001 From: coehlrich Date: Mon, 20 May 2024 14:09:26 +1200 Subject: [PATCH 20/25] Fix default case not always being last (#391) --- .../SwitchPatternMatchProcessor.java | 20 ++ .../java/decompiler/SingleClassesTest.java | 1 + .../pkg/TestSwitchPatternMatching19.dec | 151 ++++++++------- .../pkg/TestSwitchPatternMatching21.dec | 174 +++++++++--------- .../pkg/TestSwitchPatternMatchingJ21.dec | 68 +++++++ .../pkg/TestSwitchPatternMatchingJ21.java | 10 + 6 files changed, 261 insertions(+), 163 deletions(-) create mode 100644 testData/results/pkg/TestSwitchPatternMatchingJ21.dec create mode 100644 testData/src/java21/pkg/TestSwitchPatternMatchingJ21.java diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchPatternMatchProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchPatternMatchProcessor.java index 3f526e824f..daa4a53204 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchPatternMatchProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchPatternMatchProcessor.java @@ -186,6 +186,26 @@ private static boolean processStatement(SwitchStatement stat, Statement root) { } } + for (int i = 0; i < stat.getCaseValues().size(); i++) { + if (stat.getCaseValues().get(i).contains(null)) { + // Default case statements are required to be last + stat.getCaseValues().add(stat.getCaseValues().remove(i)); + stat.getCaseStatements().add(stat.getCaseStatements().remove(i)); + stat.getCaseEdges().add(stat.getCaseEdges().remove(i)); + if (i < stat.getCaseGuards().size()) { + if (stat.getCaseGuards().get(i) != null) { + while (stat.getCaseGuards().size() < stat.getCaseStatements().size()) { + stat.getCaseGuards().add(null); + } + stat.getCaseGuards().add(stat.getCaseGuards().remove(i)); + } else { + stat.getCaseGuards().remove(i); + } + } + break; + } + } + // go through bootstrap arguments to ensure types are correct & add enum/integer/string constants for (int i = 0; i < value.getBootstrapArguments().size(); i++) { PooledConstant bsa = value.getBootstrapArguments().get(i); diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index da4bb8d68a..c80934709a 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -704,6 +704,7 @@ private void registerDefault() { register(JAVA_21, "TestInnerClasses3J21"); register(JAVA_8, "TestInnerClassesJ8"); register(JAVA_8, "TestSwitchInTry"); + register(JAVA_21, "TestSwitchPatternMatchingJ21"); } private void registerEntireClassPath() { diff --git a/testData/results/pkg/TestSwitchPatternMatching19.dec b/testData/results/pkg/TestSwitchPatternMatching19.dec index 6661b91b7d..76a5a64f11 100644 --- a/testData/results/pkg/TestSwitchPatternMatching19.dec +++ b/testData/results/pkg/TestSwitchPatternMatching19.dec @@ -5,10 +5,6 @@ public class TestSwitchPatternMatching19 { static void test(TestSwitchPatternMatching19.XXX s) { var1; switch (s) {// 5 - case null: - default: - System.out.println("f");// 11 - break; case X1: System.out.println("x1");// 6 break; @@ -22,6 +18,10 @@ public class TestSwitchPatternMatching19 { System.out.println("d"); break; case TestSwitchPatternMatching19.XXX var11 when false: + break; + case null: + default: + System.out.println("f");// 11 } }// 13 @@ -114,73 +114,72 @@ class 'pkg/TestSwitchPatternMatching19' { 2d 6 2e 6 2f 6 - 30 12 - 31 12 - 32 12 - 33 12 - 34 12 - 35 12 - 36 12 - 37 12 - 38 13 - 3b 14 - 3d 14 - 3e 14 - 3f 14 - 40 14 - 41 14 - 42 14 - 43 14 - 49 15 - 4a 15 - 4b 15 - 4c 15 - 4d 15 - 4e 15 - 4f 15 - 50 15 - 51 16 - 54 17 - 57 17 - 58 17 - 59 17 - 5a 17 - 5b 17 - 64 18 - 65 18 - 66 18 - 67 18 - 68 18 - 69 18 - 6a 18 - 6b 18 - 6c 19 - 6f 20 - 72 20 - 73 20 - 74 20 - 75 20 - 76 20 - 77 20 - 78 20 - 7e 21 - 7f 21 - 80 21 - 81 21 - 82 21 - 83 21 - 84 21 - 85 21 - 86 22 - 94 9 - 95 9 - 96 9 - 97 9 - 98 9 - 99 9 - 9a 9 - 9b 9 - 9c 10 + 30 8 + 31 8 + 32 8 + 33 8 + 34 8 + 35 8 + 36 8 + 37 8 + 38 9 + 3b 10 + 3d 10 + 3e 10 + 3f 10 + 40 10 + 41 10 + 42 10 + 43 10 + 49 11 + 4a 11 + 4b 11 + 4c 11 + 4d 11 + 4e 11 + 4f 11 + 50 11 + 51 12 + 54 13 + 57 13 + 58 13 + 59 13 + 5a 13 + 5b 13 + 64 14 + 65 14 + 66 14 + 67 14 + 68 14 + 69 14 + 6a 14 + 6b 14 + 6c 15 + 6f 16 + 72 16 + 73 16 + 74 16 + 75 16 + 76 16 + 77 16 + 78 16 + 7e 17 + 7f 17 + 80 17 + 81 17 + 82 17 + 83 17 + 84 17 + 85 17 + 86 18 + 94 23 + 95 23 + 96 23 + 97 23 + 98 23 + 99 23 + 9a 23 + 9b 23 9f 25 } @@ -262,11 +261,11 @@ class 'pkg/TestSwitchPatternMatching19' { Lines mapping: 5 <-> 7 -6 <-> 13 -7 <-> 15 -8 <-> 18 -9 <-> 21 -11 <-> 10 +6 <-> 9 +7 <-> 11 +8 <-> 14 +9 <-> 17 +11 <-> 24 13 <-> 26 16 <-> 29 17 <-> 35 diff --git a/testData/results/pkg/TestSwitchPatternMatching21.dec b/testData/results/pkg/TestSwitchPatternMatching21.dec index e94a79326a..2e99a40bd6 100644 --- a/testData/results/pkg/TestSwitchPatternMatching21.dec +++ b/testData/results/pkg/TestSwitchPatternMatching21.dec @@ -30,10 +30,6 @@ public class TestSwitchPatternMatching21 { public void test2(String it) { switch (it) {// 19 - case null: - default: - System.out.println(it + "?");// 26 27 - break; case "": System.out.println("nothing");// 20 break; @@ -45,6 +41,10 @@ public class TestSwitchPatternMatching21 { break; case String var8 when Math.random() > 0.0: System.out.println(it + "!!");// 24 25 + break; + case null: + default: + System.out.println(it + "?");// 26 27 } }// 29 @@ -236,81 +236,81 @@ class 'pkg/TestSwitchPatternMatching21' { 29 31 2a 31 2b 31 - 2c 37 - 2d 37 - 2e 37 - 2f 37 - 30 37 - 31 37 - 32 37 - 33 37 - 34 38 - 37 40 - 38 40 - 39 40 - 3a 40 - 3b 40 - 3c 40 - 3d 40 - 3e 40 - 3f 41 - 42 43 - 45 42 - 46 42 - 47 42 - 48 42 - 49 42 - 52 43 - 53 43 - 54 43 - 55 43 - 56 43 - 57 43 - 58 43 - 59 43 - 5a 43 - 5b 43 - 5c 43 - 5d 43 - 5e 43 - 5f 44 - 62 46 - 65 45 - 66 45 - 67 45 - 68 45 - 69 45 - 6a 45 - 6b 45 - 6c 45 - 72 46 - 73 46 - 74 46 - 75 46 - 76 46 - 77 46 - 78 46 - 79 46 - 7a 46 - 7b 46 - 7c 46 - 7d 46 - 7e 46 - 82 34 - 85 34 - 86 34 - 87 34 - 88 34 - 89 34 - 8a 34 - 8b 34 - 8c 34 - 8d 34 - 8e 34 - 8f 34 - 90 34 - 91 34 - 92 35 + 2c 33 + 2d 33 + 2e 33 + 2f 33 + 30 33 + 31 33 + 32 33 + 33 33 + 34 34 + 37 36 + 38 36 + 39 36 + 3a 36 + 3b 36 + 3c 36 + 3d 36 + 3e 36 + 3f 37 + 42 39 + 45 38 + 46 38 + 47 38 + 48 38 + 49 38 + 52 39 + 53 39 + 54 39 + 55 39 + 56 39 + 57 39 + 58 39 + 59 39 + 5a 39 + 5b 39 + 5c 39 + 5d 39 + 5e 39 + 5f 40 + 62 42 + 65 41 + 66 41 + 67 41 + 68 41 + 69 41 + 6a 41 + 6b 41 + 6c 41 + 72 42 + 73 42 + 74 42 + 75 42 + 76 42 + 77 42 + 78 42 + 79 42 + 7a 42 + 7b 42 + 7c 42 + 7d 42 + 7e 42 + 7f 43 + 82 46 + 85 46 + 86 46 + 87 46 + 88 46 + 89 46 + 8a 46 + 8b 46 + 8c 46 + 8d 46 + 8e 46 + 8f 46 + 90 46 + 91 46 95 48 } @@ -409,14 +409,14 @@ Lines mapping: 14 <-> 27 16 <-> 29 19 <-> 32 -20 <-> 38 -21 <-> 41 -22 <-> 44 -23 <-> 44 -24 <-> 47 -25 <-> 47 -26 <-> 35 -27 <-> 35 +20 <-> 34 +21 <-> 37 +22 <-> 40 +23 <-> 40 +24 <-> 43 +25 <-> 43 +26 <-> 47 +27 <-> 47 29 <-> 49 32 <-> 52 33 <-> 55 diff --git a/testData/results/pkg/TestSwitchPatternMatchingJ21.dec b/testData/results/pkg/TestSwitchPatternMatchingJ21.dec new file mode 100644 index 0000000000..f578579d43 --- /dev/null +++ b/testData/results/pkg/TestSwitchPatternMatchingJ21.dec @@ -0,0 +1,68 @@ +package pkg; + +public class TestSwitchPatternMatchingJ21 { + public void test1(Object o) { + System.out.println(switch (o) {// 5 + case Integer i -> Integer.toString(i);// 6 + case null, default -> "null";// 7 + }); + }// 9 +} + +class 'pkg/TestSwitchPatternMatchingJ21' { + method 'test1 (Ljava/lang/Object;)V' { + 0 4 + 1 4 + 2 4 + 3 4 + 7 4 + e 4 + f 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 + 24 4 + 25 4 + 26 4 + 27 4 + 2c 5 + 2d 5 + 2e 5 + 2f 5 + 30 5 + 31 5 + 32 5 + 33 5 + 34 5 + 35 5 + 39 6 + 3a 6 + 3b 4 + 3c 4 + 3d 4 + 3e 8 + } +} + +Lines mapping: +5 <-> 5 +6 <-> 6 +7 <-> 7 +9 <-> 9 diff --git a/testData/src/java21/pkg/TestSwitchPatternMatchingJ21.java b/testData/src/java21/pkg/TestSwitchPatternMatchingJ21.java new file mode 100644 index 0000000000..db6546abc3 --- /dev/null +++ b/testData/src/java21/pkg/TestSwitchPatternMatchingJ21.java @@ -0,0 +1,10 @@ +package pkg; + +public class TestSwitchPatternMatchingJ21 { + public void test1(Object o) { + System.out.println(switch (o) { + case Integer i -> Integer.toString(i); + case null, default -> "null"; + }); + } +} From 349d163c53919cafb1486a26e9005b0a77eef526 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sun, 19 May 2024 19:46:05 -0700 Subject: [PATCH 21/25] Add back casts in numeric operations where it increases the size of the number (#395) * Add failing test for number casts issue * make sure to include casts for numeric operations --- .../decompiler/SecondaryFunctionsHelper.java | 3 + testData/results/pkg/TestNumberCasts.dec | 621 +++++++++++------- testData/src/java8/pkg/TestNumberCasts.java | 13 + 3 files changed, 387 insertions(+), 250 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/SecondaryFunctionsHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/SecondaryFunctionsHelper.java index b9056afa06..dc8ffaa8ef 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/SecondaryFunctionsHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/SecondaryFunctionsHelper.java @@ -436,6 +436,9 @@ private static Exprent identifySecondaryFunctions(Exprent exprent, boolean state return ret; } break; + case ADD: + case SUB: + case MUL: case DIV: Exprent left = lstOperands.get(0); boolean leftImplicitCast = left instanceof FunctionExprent && ((FunctionExprent) left).getSimpleCastType() != null && !((FunctionExprent) left).doesCast(); diff --git a/testData/results/pkg/TestNumberCasts.dec b/testData/results/pkg/TestNumberCasts.dec index ed9dd15a90..620f05e44a 100644 --- a/testData/results/pkg/TestNumberCasts.dec +++ b/testData/results/pkg/TestNumberCasts.dec @@ -27,42 +27,55 @@ public class TestNumberCasts { l(b);// 27 f(b);// 28 d(b);// 29 - short s = 32767;// 31 - b((byte)s);// 32 - s(s);// 33 - i(s);// 34 - l(s);// 35 - f(s);// 36 - d(s);// 37 - int i = 2147483647;// 39 - b((byte)i);// 40 - s((short)i);// 41 - i(i);// 42 - l(i);// 43 - f(i);// 44 - d(i);// 45 - long l = 9223372036854775807L;// 47 - b((byte)l);// 48 - s((short)l);// 49 - i((int)l);// 50 - l(l);// 51 - f((float)l);// 52 - d(l);// 53 - float f = 3.4028235E38F;// 55 - b((byte)f);// 56 - s((short)f);// 57 - i((int)f);// 58 - l((long)f);// 59 - f(f);// 60 - d(f);// 61 - double d = 1.7976931348623157E308;// 63 - b((byte)d);// 64 - s((short)d);// 65 - i((int)d);// 66 - l((long)d);// 67 - f((float)d);// 68 - d(d);// 69 - }// 70 + s((short)(b * b));// 30 + s((short)(b + b));// 31 + s((short)(-b - b));// 32 + short s = 32767;// 34 + b((byte)s);// 35 + s(s);// 36 + i(s);// 37 + l(s);// 38 + f(s);// 39 + d(s);// 40 + i(s * s);// 41 + i(s + s);// 42 + i(-s - s);// 43 + int i = 2147483647;// 45 + b((byte)i);// 46 + s((short)i);// 47 + i(i);// 48 + l(i);// 49 + f(i);// 50 + d(i);// 51 + l(i * i);// 52 + l(i + b);// 53 + l(i * i);// 54 + l((long)i * i);// 55 + l((long)i + i);// 56 + l((long)(-i) - i);// 57 + l((long)i + b);// 58 + long l = 9223372036854775807L;// 60 + b((byte)l);// 61 + s((short)l);// 62 + i((int)l);// 63 + l(l);// 64 + f((float)l);// 65 + d(l);// 66 + float f = 3.4028235E38F;// 68 + b((byte)f);// 69 + s((short)f);// 70 + i((int)f);// 71 + l((long)f);// 72 + f(f);// 73 + d(f);// 74 + double d = 1.7976931348623157E308;// 76 + b((byte)d);// 77 + s((short)d);// 78 + i((int)d);// 79 + l((long)d);// 80 + f((float)d);// 81 + d(d);// 82 + }// 83 } class 'pkg/TestNumberCasts' { @@ -126,192 +139,287 @@ class 'pkg/TestNumberCasts' { 20 29 21 29 22 29 - 23 30 - 24 30 - 25 30 + 23 29 + 24 29 + 25 29 26 30 27 30 - 28 31 - 29 31 - 2a 31 - 2b 31 - 2c 32 - 2d 32 - 2e 32 - 2f 32 - 30 33 - 31 33 - 32 33 - 33 33 - 34 33 - 35 34 - 36 34 - 37 34 - 38 34 - 39 34 - 3a 35 - 3b 35 - 3c 35 - 3d 35 - 3e 35 - 3f 36 - 40 36 - 41 36 - 42 37 - 43 37 - 44 37 - 45 37 - 46 37 - 47 38 - 48 38 - 49 38 - 4a 38 - 4b 38 - 4c 39 - 4d 39 - 4e 39 - 4f 39 - 50 40 - 51 40 - 52 40 - 53 40 - 54 40 - 55 41 - 56 41 - 57 41 - 58 41 - 59 41 - 5a 42 - 5b 42 - 5c 42 - 5d 42 - 5e 42 - 5f 43 - 60 43 - 61 43 - 62 43 - 63 43 - 64 44 - 65 44 - 66 44 - 67 44 - 68 44 - 69 44 - 6a 44 - 6b 45 - 6c 45 - 6d 45 - 6e 45 - 6f 45 - 70 45 - 71 45 - 72 46 - 73 46 - 74 46 - 75 46 - 76 46 - 77 46 - 78 47 - 79 47 - 7a 47 - 7b 47 - 7c 47 - 7d 48 - 7e 48 - 7f 48 - 80 48 - 81 48 - 82 48 - 83 49 - 84 49 - 85 49 - 86 49 - 87 49 + 28 30 + 29 30 + 2a 30 + 2b 30 + 2c 30 + 2d 31 + 2e 31 + 2f 31 + 30 31 + 31 31 + 32 31 + 33 31 + 34 31 + 35 32 + 36 32 + 37 32 + 38 32 + 39 33 + 3a 33 + 3b 33 + 3c 33 + 3d 33 + 3e 34 + 3f 34 + 40 34 + 41 34 + 42 35 + 43 35 + 44 35 + 45 35 + 46 36 + 47 36 + 48 36 + 49 36 + 4a 36 + 4b 37 + 4c 37 + 4d 37 + 4e 37 + 4f 37 + 50 38 + 51 38 + 52 38 + 53 38 + 54 38 + 55 39 + 56 39 + 57 39 + 58 39 + 59 39 + 5a 39 + 5b 40 + 5c 40 + 5d 40 + 5e 40 + 5f 40 + 60 40 + 61 41 + 62 41 + 63 41 + 64 41 + 65 41 + 66 41 + 67 41 + 68 42 + 69 42 + 6a 42 + 6b 43 + 6c 43 + 6d 43 + 6e 43 + 6f 43 + 70 44 + 71 44 + 72 44 + 73 44 + 74 44 + 75 45 + 76 45 + 77 45 + 78 45 + 79 46 + 7a 46 + 7b 46 + 7c 46 + 7d 46 + 7e 47 + 7f 47 + 80 47 + 81 47 + 82 47 + 83 48 + 84 48 + 85 48 + 86 48 + 87 48 88 49 - 89 50 - 8a 50 - 8b 50 - 8c 50 - 8d 51 - 8e 51 - 8f 51 - 90 51 - 91 51 - 92 51 - 93 51 - 94 52 - 95 52 - 96 52 - 97 52 - 98 52 - 99 52 - 9a 52 - 9b 53 - 9c 53 - 9d 53 - 9e 53 - 9f 53 - a0 53 - a1 54 - a2 54 - a3 54 - a4 54 - a5 54 - a6 54 - a7 55 - a8 55 - a9 55 - aa 55 - ab 55 - ac 56 - ad 56 - ae 56 - af 56 - b0 56 - b1 56 - b2 57 - b3 57 - b4 57 - b5 57 - b6 57 - b7 58 - b8 58 - b9 58 - ba 58 - bb 58 - bc 58 - bd 58 - be 59 - bf 59 - c0 59 - c1 59 - c2 59 - c3 59 - c4 59 - c5 60 - c6 60 - c7 60 - c8 60 - c9 60 - ca 60 - cb 61 - cc 61 - cd 61 - ce 61 - cf 61 - d0 61 - d1 62 - d2 62 - d3 62 - d4 62 - d5 62 - d6 62 - d7 63 - d8 63 - d9 63 - da 63 - db 63 - dc 64 + 89 49 + 8a 49 + 8b 49 + 8c 49 + 8d 49 + 8e 49 + 8f 50 + 90 50 + 91 50 + 92 50 + 93 50 + 94 50 + 95 50 + 96 51 + 97 51 + 98 51 + 99 51 + 9a 51 + 9b 51 + 9c 51 + 9d 52 + 9e 52 + 9f 52 + a0 52 + a1 52 + a2 52 + a3 52 + a4 52 + a5 53 + a6 53 + a7 53 + a8 53 + a9 53 + aa 53 + ab 53 + ac 53 + ad 54 + ae 54 + af 54 + b0 54 + b1 54 + b2 54 + b3 54 + b4 54 + b5 54 + b6 55 + b7 55 + b8 55 + b9 55 + ba 55 + bb 55 + bc 55 + bd 55 + be 56 + bf 56 + c0 56 + c1 56 + c2 56 + c3 57 + c4 57 + c5 57 + c6 57 + c7 57 + c8 57 + c9 57 + ca 58 + cb 58 + cc 58 + cd 58 + ce 58 + cf 58 + d0 58 + d1 59 + d2 59 + d3 59 + d4 59 + d5 59 + d6 59 + d7 60 + d8 60 + d9 60 + da 60 + db 60 + dc 61 + dd 61 + de 61 + df 61 + e0 61 + e1 61 + e2 62 + e3 62 + e4 62 + e5 62 + e6 62 + e7 62 + e8 63 + e9 63 + ea 63 + eb 63 + ec 64 + ed 64 + ee 64 + ef 64 + f0 64 + f1 64 + f2 64 + f3 65 + f4 65 + f5 65 + f6 65 + f7 65 + f8 65 + f9 65 + fa 66 + fb 66 + fc 66 + fd 66 + fe 66 + ff 66 + 100 67 + 101 67 + 102 67 + 103 67 + 104 67 + 105 67 + 106 68 + 107 68 + 108 68 + 109 68 + 10a 68 + 10b 69 + 10c 69 + 10d 69 + 10e 69 + 10f 69 + 110 69 + 111 70 + 112 70 + 113 70 + 114 70 + 115 70 + 116 71 + 117 71 + 118 71 + 119 71 + 11a 71 + 11b 71 + 11c 71 + 11d 72 + 11e 72 + 11f 72 + 120 72 + 121 72 + 122 72 + 123 72 + 124 73 + 125 73 + 126 73 + 127 73 + 128 73 + 129 73 + 12a 74 + 12b 74 + 12c 74 + 12d 74 + 12e 74 + 12f 74 + 130 75 + 131 75 + 132 75 + 133 75 + 134 75 + 135 75 + 136 76 + 137 76 + 138 76 + 139 76 + 13a 76 + 13b 77 } } @@ -329,39 +437,52 @@ Lines mapping: 27 <-> 27 28 <-> 28 29 <-> 29 -31 <-> 30 -32 <-> 31 -33 <-> 32 +30 <-> 30 +31 <-> 31 +32 <-> 32 34 <-> 33 35 <-> 34 36 <-> 35 37 <-> 36 -39 <-> 37 -40 <-> 38 -41 <-> 39 -42 <-> 40 -43 <-> 41 -44 <-> 42 +38 <-> 37 +39 <-> 38 +40 <-> 39 +41 <-> 40 +42 <-> 41 +43 <-> 42 45 <-> 43 -47 <-> 44 -48 <-> 45 -49 <-> 46 -50 <-> 47 -51 <-> 48 -52 <-> 49 -53 <-> 50 -55 <-> 51 -56 <-> 52 -57 <-> 53 -58 <-> 54 -59 <-> 55 -60 <-> 56 -61 <-> 57 -63 <-> 58 -64 <-> 59 -65 <-> 60 -66 <-> 61 -67 <-> 62 -68 <-> 63 -69 <-> 64 -70 <-> 65 +46 <-> 44 +47 <-> 45 +48 <-> 46 +49 <-> 47 +50 <-> 48 +51 <-> 49 +52 <-> 50 +53 <-> 51 +54 <-> 52 +55 <-> 53 +56 <-> 54 +57 <-> 55 +58 <-> 56 +60 <-> 57 +61 <-> 58 +62 <-> 59 +63 <-> 60 +64 <-> 61 +65 <-> 62 +66 <-> 63 +68 <-> 64 +69 <-> 65 +70 <-> 66 +71 <-> 67 +72 <-> 68 +73 <-> 69 +74 <-> 70 +76 <-> 71 +77 <-> 72 +78 <-> 73 +79 <-> 74 +80 <-> 75 +81 <-> 76 +82 <-> 77 +83 <-> 78 diff --git a/testData/src/java8/pkg/TestNumberCasts.java b/testData/src/java8/pkg/TestNumberCasts.java index 0b111c4504..ab2e6c08cd 100644 --- a/testData/src/java8/pkg/TestNumberCasts.java +++ b/testData/src/java8/pkg/TestNumberCasts.java @@ -27,6 +27,9 @@ public void test() { l(b); f(b); d(b); + s((short) (b * b)); + s((short) (b + b)); + s((short) (-b - b)); short s = 32767; b((byte) s); @@ -35,6 +38,9 @@ public void test() { l(s); f(s); d(s); + i((int) s * s); + i((int) s + s); + i((int) -s - s); int i = 2147483647; b((byte) i); @@ -43,6 +49,13 @@ public void test() { l(i); f(i); d(i); + l(i * i); // not a good idea, but should test for it + l(i + b); // not a good idea, but should test for it + l((long) (i * i)); // not a good idea, but should test for it + l((long) i * i); + l((long) i + i); + l((long) -i - i); + l((long) i + b); long l = 9223372036854775807L; b((byte) l); From 13940135aa47cc815bdf3218d4987e90c871116b Mon Sep 17 00:00:00 2001 From: coehlrich Date: Wed, 22 May 2024 15:42:24 +1200 Subject: [PATCH 22/25] Fix variable used in switch head not being inlined (#399) * Fix variable used in switch head not being inlined * Update dec files * Comments and put streams on multiple lines --- .../SwitchPatternMatchProcessor.java | 60 ++ .../pkg/TestSwitchPatternMatching1.dec | 140 ++--- .../pkg/TestSwitchPatternMatching22.dec | 572 +++++++++--------- .../pkg/TestSwitchPatternMatching4.dec | 60 +- .../TestSwitchPatternMatchingConstructor2.dec | 134 ++-- .../pkg/TestSwitchPatternMatchingJ21.dec | 235 +++++-- .../pkg/TestSwitchPatternMatchingLoop.dec | 136 ++--- .../pkg/TestSwitchPatternMatchingReturn1.dec | 107 ++-- testData/results/pkg/TestUnknownCastJ17.dec | 243 ++++---- .../pkg/TestSwitchPatternMatchingJ21.java | 18 + 10 files changed, 917 insertions(+), 788 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchPatternMatchProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchPatternMatchProcessor.java index daa4a53204..d429f63e65 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchPatternMatchProcessor.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/SwitchPatternMatchProcessor.java @@ -5,6 +5,7 @@ import org.jetbrains.java.decompiler.main.collectors.CounterContainer; import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences; import org.jetbrains.java.decompiler.modules.decompiler.exps.*; +import org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent.FunctionType; import org.jetbrains.java.decompiler.modules.decompiler.stats.*; import org.jetbrains.java.decompiler.struct.consts.PooledConstant; import org.jetbrains.java.decompiler.struct.consts.PrimitiveConstant; @@ -15,6 +16,7 @@ import org.jetbrains.java.decompiler.util.Pair; import java.util.*; +import java.util.stream.Stream; public final class SwitchPatternMatchProcessor { public static boolean processPatternMatching(Statement root) { @@ -66,6 +68,7 @@ private static boolean processStatement(SwitchStatement stat, Statement root) { Exprent realSelector = origParams.get(0); boolean guarded = true; boolean isEnumSwitch = value.getName().equals("enumSwitch"); + boolean nullCase = false; List> references = new ArrayList<>(); if (origParams.get(1) instanceof VarExprent) { VarExprent var = (VarExprent) origParams.get(1); @@ -134,6 +137,7 @@ private static boolean processStatement(SwitchStatement stat, Statement root) { // -1 always means null if (caseValue == -1) { + nullCase = true; allCases.remove(caseExpr); ConstExprent nullConst = new ConstExprent(VarType.VARTYPE_NULL, null, null); // null can be shared with a pattern or default; put it at the end, but before default, to make sure it doesn't get @@ -262,6 +266,62 @@ private static boolean processStatement(SwitchStatement stat, Statement root) { } } + // Try to inline: + // var stackVar = ... + // Objects.requireNonNull(stackVar) + // var var1 = stackVar + // switch (var1) { + // + // to: + // switch (...) { + + Exprent oldSelector = realSelector; + // inline head + List basicHead = stat.getBasichead().getExprents(); + if (realSelector instanceof VarExprent var && basicHead != null && basicHead.size() >= 1) { + if (basicHead.get(basicHead.size() - 1) instanceof AssignmentExprent assignment && assignment.getLeft() instanceof VarExprent assigned) { + if (var.equals(assigned) && !var.isVarReferenced(root, + Stream.concat( + Stream.of(assigned), + stat.getCaseValues().stream() + .flatMap(List::stream) + .filter(exp -> exp instanceof FunctionExprent func && func.getFuncType() == FunctionType.INSTANCEOF && func.getLstOperands().get(0) instanceof VarExprent checked && checked.equals(var)) + .map(exp -> (VarExprent) ((FunctionExprent) exp).getLstOperands().get(0))) + .toArray(VarExprent[]::new))) { + realSelector = assignment.getRight(); + basicHead.remove(basicHead.size() - 1); + } + } + } + + // Check for non null + if (basicHead != null && basicHead.size() >= 1 && realSelector instanceof VarExprent var && !nullCase) { + Exprent last = basicHead.get(basicHead.size() - 1); + if (last instanceof InvocationExprent inv && inv.isStatic() && inv.getClassname().equals("java/util/Objects") && inv.getName().equals("requireNonNull") && inv.getStringDescriptor().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && var.equals(inv.getLstParameters().get(0))) { + basicHead.remove(basicHead.size() - 1); + // Check for other assignment + if (basicHead.size() >= 1 && var.isStack() && !nullCase) { + last = basicHead.get(basicHead.size() - 1); + if (last instanceof AssignmentExprent assignment && assignment.getLeft() instanceof VarExprent assigned && var.equals(assigned)) { + if (!var.isVarReferenced(root, assigned)) { + realSelector = assignment.getRight(); + basicHead.remove(basicHead.size() - 1); + } + } + } + } + } + + if (oldSelector != realSelector) { + Exprent finalSelector = realSelector; + // Replace the original selector with the new selector in instanceof check in case values + stat.getCaseValues().stream() + .flatMap(List::stream) + .filter(Objects::nonNull) + .filter(exp -> exp instanceof FunctionExprent func && func.getFuncType() == FunctionType.INSTANCEOF && func.getLstOperands().get(0).equals(oldSelector)) + .forEach(exp -> ((FunctionExprent) exp).getLstOperands().set(0, finalSelector)); + } + head.setValue(realSelector); // SwitchBootstraps.typeSwitch(o, var1) -> o if (guarded && stat.getParent() instanceof DoStatement) { diff --git a/testData/results/pkg/TestSwitchPatternMatching1.dec b/testData/results/pkg/TestSwitchPatternMatching1.dec index 0694c6e770..418cdc1c46 100644 --- a/testData/results/pkg/TestSwitchPatternMatching1.dec +++ b/testData/results/pkg/TestSwitchPatternMatching1.dec @@ -1,11 +1,8 @@ package pkg; -import java.util.Objects; - public class TestSwitchPatternMatching1 { public void test(Object o) { - Objects.requireNonNull(o);// 5 - switch (o) { + switch (o) {// 5 case Integer i:// 6 System.out.println(i); break; @@ -20,76 +17,73 @@ public class TestSwitchPatternMatching1 { class 'pkg/TestSwitchPatternMatching1' { method 'test (Ljava/lang/Object;)V' { - 0 6 - 2 6 - 3 6 - 4 6 - 9 7 - 10 7 - 11 7 - 12 7 - 13 7 - 14 7 - 15 7 - 16 7 - 17 7 - 18 7 - 19 7 - 1a 7 - 1b 7 - 1c 7 - 1d 7 - 1e 7 - 1f 7 - 20 7 - 21 7 - 22 7 - 23 7 - 24 7 - 25 7 - 26 7 - 27 7 - 28 7 - 29 7 - 2a 7 - 2b 7 - 30 8 - 31 8 - 32 9 - 33 9 - 34 9 - 35 9 - 36 9 - 37 9 - 38 9 - 39 9 - 3a 10 - 41 11 - 42 11 - 43 12 - 44 12 - 45 12 - 46 12 - 47 12 - 48 12 - 49 12 - 4a 12 - 4b 13 - 4e 15 - 4f 15 - 50 15 - 51 15 - 52 15 - 53 15 - 54 15 - 55 15 - 56 17 + 0 4 + 9 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 + 24 4 + 25 4 + 26 4 + 27 4 + 28 4 + 29 4 + 2a 4 + 2b 4 + 30 5 + 31 5 + 32 6 + 33 6 + 34 6 + 35 6 + 36 6 + 37 6 + 38 6 + 39 6 + 3a 7 + 41 8 + 42 8 + 43 9 + 44 9 + 45 9 + 46 9 + 47 9 + 48 9 + 49 9 + 4a 9 + 4b 10 + 4e 12 + 4f 12 + 50 12 + 51 12 + 52 12 + 53 12 + 54 12 + 55 12 + 56 14 } } Lines mapping: -5 <-> 7 -6 <-> 9 -7 <-> 12 -8 <-> 16 -10 <-> 18 +5 <-> 5 +6 <-> 6 +7 <-> 9 +8 <-> 13 +10 <-> 15 diff --git a/testData/results/pkg/TestSwitchPatternMatching22.dec b/testData/results/pkg/TestSwitchPatternMatching22.dec index 3f3d205577..53a786e664 100644 --- a/testData/results/pkg/TestSwitchPatternMatching22.dec +++ b/testData/results/pkg/TestSwitchPatternMatching22.dec @@ -1,16 +1,11 @@ package pkg; -import java.util.Objects; - public class TestSwitchPatternMatching22 { public void test1() { try { System.out.println("hello");// 13 } catch (Exception var8) {// 14 - Object var10000 = new Object(); - Objects.requireNonNull(var10000);// 15 - Object var2 = var10000; - switch (var2) { + switch (new Object()) {// 15 case Short var4:// 19 break; default: @@ -26,10 +21,7 @@ public class TestSwitchPatternMatching22 { try { System.out.println("hello");// 28 } catch (Exception var8) {// 29 - Object var10000 = new Object(); - Objects.requireNonNull(var10000);// 30 - Object var2 = var10000; - switch (var2) { + switch (new Object()) {// 30 case Short var4:// 34 default: System.out.println("Not a short");// 32 @@ -44,8 +36,7 @@ public class TestSwitchPatternMatching22 { try { System.out.println("hello");// 43 } catch (Exception var8) {// 44 - Object var2 = new Object();// 45 - switch (var2) { + switch (new Object()) {// 45 case Short var4:// 50 case null: break; @@ -62,8 +53,7 @@ public class TestSwitchPatternMatching22 { try { System.out.println("hello");// 59 } catch (Exception var8) {// 60 - Object var2 = new Object();// 61 - switch (var2) { + switch (new Object()) {// 61 case Short var4:// 66 case null: default: @@ -94,306 +84,292 @@ public class TestSwitchPatternMatching22 { class 'pkg/TestSwitchPatternMatching22' { method 'test1 ()V' { - 0 7 - 1 7 - 2 7 - 3 7 - 4 7 - 5 7 - 6 7 - 7 7 - 13 8 - 1c 10 - 1d 10 - 1e 10 - 20 11 - 23 12 - 2a 12 - 2b 12 - 2c 12 - 2d 12 - 2e 12 - 2f 12 - 30 12 - 31 12 - 32 12 - 33 12 - 34 12 - 35 12 - 36 12 - 37 12 - 38 12 - 39 12 - 3a 12 - 3b 12 - 3c 16 - 3d 16 - 3e 16 - 3f 16 - 40 16 - 41 16 - 42 16 - 43 16 - 4b 17 - 50 13 - 51 13 - 5f 20 - 60 20 - 61 20 - 62 20 - 63 20 - 64 20 - 65 20 - 66 20 - 6a 22 + 0 5 + 1 5 + 2 5 + 3 5 + 4 5 + 5 5 + 6 5 + 7 5 + 13 6 + 2a 7 + 2b 7 + 2c 7 + 2d 7 + 2e 7 + 2f 7 + 30 7 + 31 7 + 32 7 + 33 7 + 34 7 + 35 7 + 36 7 + 37 7 + 38 7 + 39 7 + 3a 7 + 3b 7 + 3c 11 + 3d 11 + 3e 11 + 3f 11 + 40 11 + 41 11 + 42 11 + 43 11 + 4b 12 + 50 8 + 51 8 + 5f 15 + 60 15 + 61 15 + 62 15 + 63 15 + 64 15 + 65 15 + 66 15 + 6a 17 } method 'test2 ()V' { - 0 26 - 1 26 - 2 26 - 3 26 - 4 26 - 5 26 - 6 26 - 7 26 - 10 27 - 19 29 - 1a 29 - 1b 29 - 1d 30 - 20 31 - 27 31 - 28 31 - 29 31 - 2a 31 - 2b 31 - 2c 31 - 2d 31 - 2e 31 - 2f 31 - 30 31 - 31 31 - 32 31 - 33 31 - 34 31 - 35 31 - 36 31 - 37 31 - 38 34 - 39 34 - 3a 34 - 3b 34 - 3c 34 - 3d 34 - 3e 34 - 3f 34 - 47 35 - 4c 32 - 4d 32 - 5f 38 + 0 21 + 1 21 + 2 21 + 3 21 + 4 21 + 5 21 + 6 21 + 7 21 + 10 22 + 27 23 + 28 23 + 29 23 + 2a 23 + 2b 23 + 2c 23 + 2d 23 + 2e 23 + 2f 23 + 30 23 + 31 23 + 32 23 + 33 23 + 34 23 + 35 23 + 36 23 + 37 23 + 38 26 + 39 26 + 3a 26 + 3b 26 + 3c 26 + 3d 26 + 3e 26 + 3f 26 + 47 27 + 4c 24 + 4d 24 + 5f 30 } method 'test1Null ()V' { - 0 44 - 1 44 - 2 44 - 3 44 - 4 44 - 5 44 - 6 44 - 7 44 - 13 45 - 1b 46 - 1e 47 - 25 47 - 26 47 - 27 47 - 28 47 - 29 47 - 2a 47 - 2b 47 - 2c 47 - 2d 47 - 2e 47 - 2f 47 - 30 47 - 31 47 - 32 47 - 33 47 - 34 47 - 35 47 - 36 47 - 37 47 - 38 47 - 39 47 - 3a 47 - 3b 47 - 3c 47 - 3d 47 - 3e 47 - 3f 47 - 40 52 - 41 52 - 42 52 - 43 52 - 44 52 - 45 52 - 46 52 - 47 52 - 4f 53 - 54 48 - 55 48 - 63 56 - 64 56 - 65 56 - 66 56 - 67 56 - 68 56 - 69 56 - 6a 56 - 6e 58 + 0 36 + 1 36 + 2 36 + 3 36 + 4 36 + 5 36 + 6 36 + 7 36 + 13 37 + 25 38 + 26 38 + 27 38 + 28 38 + 29 38 + 2a 38 + 2b 38 + 2c 38 + 2d 38 + 2e 38 + 2f 38 + 30 38 + 31 38 + 32 38 + 33 38 + 34 38 + 35 38 + 36 38 + 37 38 + 38 38 + 39 38 + 3a 38 + 3b 38 + 3c 38 + 3d 38 + 3e 38 + 3f 38 + 40 43 + 41 43 + 42 43 + 43 43 + 44 43 + 45 43 + 46 43 + 47 43 + 4f 44 + 54 39 + 55 39 + 63 47 + 64 47 + 65 47 + 66 47 + 67 47 + 68 47 + 69 47 + 6a 47 + 6e 49 } method 'test2Null ()V' { - 0 62 - 1 62 - 2 62 - 3 62 - 4 62 - 5 62 - 6 62 - 7 62 - 10 63 - 18 64 - 1b 65 - 22 65 - 23 65 - 24 65 - 25 65 - 26 65 - 27 65 - 28 65 - 29 65 - 2a 65 - 2b 65 - 2c 65 - 2d 65 - 2e 65 - 2f 65 - 30 65 - 31 65 - 32 65 - 33 65 - 34 65 - 35 65 - 36 65 - 37 65 - 38 65 - 39 65 - 3a 65 - 3b 65 - 3c 69 - 3d 69 - 3e 69 - 3f 69 - 40 69 - 41 69 - 42 69 - 43 69 - 4b 70 - 50 66 - 51 66 - 63 73 + 0 53 + 1 53 + 2 53 + 3 53 + 4 53 + 5 53 + 6 53 + 7 53 + 10 54 + 22 55 + 23 55 + 24 55 + 25 55 + 26 55 + 27 55 + 28 55 + 29 55 + 2a 55 + 2b 55 + 2c 55 + 2d 55 + 2e 55 + 2f 55 + 30 55 + 31 55 + 32 55 + 33 55 + 34 55 + 35 55 + 36 55 + 37 55 + 38 55 + 39 55 + 3a 55 + 3b 55 + 3c 59 + 3d 59 + 3e 59 + 3f 59 + 40 59 + 41 59 + 42 59 + 43 59 + 4b 60 + 50 56 + 51 56 + 63 63 } method 'testNonPattern ()V' { - 0 79 - 1 79 - 2 79 - 3 79 - 4 79 - 5 79 - 6 79 - 7 79 - 10 80 - 11 81 - 12 81 - 13 81 - 14 81 - 15 81 - 16 81 - 17 81 - 18 81 - 19 81 - 1a 81 - 1b 81 - 1c 81 - 1d 81 - 1e 81 - 1f 81 - 20 81 - 21 81 - 22 81 - 23 81 - 24 81 - 25 81 - 26 81 - 27 81 - 28 81 - 29 81 - 2a 81 - 2b 81 - 2c 85 - 2d 85 - 2e 85 - 2f 85 - 30 85 - 31 85 - 32 85 - 33 85 - 3b 86 - 4c 89 + 0 69 + 1 69 + 2 69 + 3 69 + 4 69 + 5 69 + 6 69 + 7 69 + 10 70 + 11 71 + 12 71 + 13 71 + 14 71 + 15 71 + 16 71 + 17 71 + 18 71 + 19 71 + 1a 71 + 1b 71 + 1c 71 + 1d 71 + 1e 71 + 1f 71 + 20 71 + 21 71 + 22 71 + 23 71 + 24 71 + 25 71 + 26 71 + 27 71 + 28 71 + 29 71 + 2a 71 + 2b 71 + 2c 75 + 2d 75 + 2e 75 + 2f 75 + 30 75 + 31 75 + 32 75 + 33 75 + 3b 76 + 4c 79 } } Lines mapping: -13 <-> 8 -14 <-> 9 -15 <-> 11 -17 <-> 17 -18 <-> 18 -19 <-> 14 -22 <-> 21 -24 <-> 23 -28 <-> 27 -29 <-> 28 -30 <-> 30 -32 <-> 35 -33 <-> 36 -34 <-> 33 -37 <-> 39 -43 <-> 45 -44 <-> 46 -45 <-> 47 -47 <-> 53 -48 <-> 54 -50 <-> 49 -53 <-> 57 -55 <-> 59 -59 <-> 63 -60 <-> 64 -61 <-> 65 -63 <-> 70 -64 <-> 71 -66 <-> 67 -69 <-> 74 -75 <-> 80 -76 <-> 81 -77 <-> 82 -79 <-> 86 -80 <-> 87 -85 <-> 90 +13 <-> 6 +14 <-> 7 +15 <-> 8 +17 <-> 12 +18 <-> 13 +19 <-> 9 +22 <-> 16 +24 <-> 18 +28 <-> 22 +29 <-> 23 +30 <-> 24 +32 <-> 27 +33 <-> 28 +34 <-> 25 +37 <-> 31 +43 <-> 37 +44 <-> 38 +45 <-> 39 +47 <-> 44 +48 <-> 45 +50 <-> 40 +53 <-> 48 +55 <-> 50 +59 <-> 54 +60 <-> 55 +61 <-> 56 +63 <-> 60 +64 <-> 61 +66 <-> 57 +69 <-> 64 +75 <-> 70 +76 <-> 71 +77 <-> 72 +79 <-> 76 +80 <-> 77 +85 <-> 80 Not mapped: 23 54 diff --git a/testData/results/pkg/TestSwitchPatternMatching4.dec b/testData/results/pkg/TestSwitchPatternMatching4.dec index a987afc09b..7b82360cfb 100644 --- a/testData/results/pkg/TestSwitchPatternMatching4.dec +++ b/testData/results/pkg/TestSwitchPatternMatching4.dec @@ -1,11 +1,8 @@ package pkg; -import java.util.Objects; - public class TestSwitchPatternMatching4 { static void test(Object s) { - Objects.requireNonNull(s);// 5 - switch (s) { + switch (s) {// 5 default: System.out.println("default");// 7 } @@ -14,36 +11,33 @@ public class TestSwitchPatternMatching4 { class 'pkg/TestSwitchPatternMatching4' { method 'test (Ljava/lang/Object;)V' { - 0 6 - 2 6 - 3 6 - 4 6 - 9 7 - 10 7 - 11 7 - 12 7 - 13 7 - 14 7 - 15 7 - 16 7 - 17 7 - 18 7 - 19 7 - 1a 7 - 1b 7 - 1c 9 - 1d 9 - 1e 9 - 1f 9 - 20 9 - 21 9 - 22 9 - 23 9 - 24 11 + 0 4 + 9 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 + 24 8 } } Lines mapping: -5 <-> 7 -7 <-> 10 -9 <-> 12 +5 <-> 5 +7 <-> 7 +9 <-> 9 diff --git a/testData/results/pkg/TestSwitchPatternMatchingConstructor2.dec b/testData/results/pkg/TestSwitchPatternMatchingConstructor2.dec index c45b4f91b1..a5721628e9 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingConstructor2.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingConstructor2.dec @@ -1,7 +1,5 @@ package pkg; -import java.util.Objects; - public class TestSwitchPatternMatchingConstructor2 { private TestSwitchPatternMatchingConstructor2(String s) { System.out.println(s);// 5 @@ -15,7 +13,6 @@ public class TestSwitchPatternMatchingConstructor2 { }// 13 private TestSwitchPatternMatchingConstructor2(Object s, boolean unused) { - Objects.requireNonNull(s); switch (s) { default: this("Non-triangle");// 16 17 @@ -25,82 +22,79 @@ public class TestSwitchPatternMatchingConstructor2 { class 'pkg/TestSwitchPatternMatchingConstructor2' { method ' (Ljava/lang/String;)V' { - 4 6 - 5 6 - 6 6 - 7 6 - 8 6 - 9 6 - a 6 - b 7 + 4 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 5 } method ' (Ljava/lang/Object;)V' { - 1 10 - 5 10 - c 10 - d 10 - e 10 - f 10 - 10 10 - 11 10 - 12 10 - 13 10 - 14 10 - 15 10 - 16 10 - 17 10 - 18 10 - 19 10 - 1a 10 - 1b 10 - 1c 10 - 1d 10 - 1e 10 - 1f 10 - 20 11 - 21 11 - 25 12 - 26 12 - 27 10 - 28 10 - 29 10 - 2a 14 + 1 8 + 5 8 + c 8 + d 8 + e 8 + f 8 + 10 8 + 11 8 + 12 8 + 13 8 + 14 8 + 15 8 + 16 8 + 17 8 + 18 8 + 19 8 + 1a 8 + 1b 8 + 1c 8 + 1d 8 + 1e 8 + 1f 8 + 20 9 + 21 9 + 25 10 + 26 10 + 27 8 + 28 8 + 29 8 + 2a 12 } method ' (Ljava/lang/Object;Z)V' { - 1 17 - 3 17 - 4 17 - 5 17 - b 18 - 13 18 - 14 18 - 15 18 - 16 18 - 17 18 - 18 18 - 19 18 - 1a 18 - 1b 18 - 1c 20 - 1d 20 - 1e 20 - 1f 20 - 20 20 - 21 22 + 1 15 + b 15 + 13 15 + 14 15 + 15 15 + 16 15 + 17 15 + 18 15 + 19 15 + 1a 15 + 1b 15 + 1c 17 + 1d 17 + 1e 17 + 1f 17 + 20 17 + 21 19 } } Lines mapping: -5 <-> 7 -6 <-> 8 -9 <-> 11 -10 <-> 12 -11 <-> 13 -13 <-> 15 -16 <-> 21 -17 <-> 21 -19 <-> 23 +5 <-> 5 +6 <-> 6 +9 <-> 9 +10 <-> 10 +11 <-> 11 +13 <-> 13 +16 <-> 18 +17 <-> 18 +19 <-> 20 Not mapped: 4 diff --git a/testData/results/pkg/TestSwitchPatternMatchingJ21.dec b/testData/results/pkg/TestSwitchPatternMatchingJ21.dec index f578579d43..b72e28ef3b 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingJ21.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingJ21.dec @@ -1,68 +1,197 @@ package pkg; +import java.util.function.Supplier; + public class TestSwitchPatternMatchingJ21 { public void test1(Object o) { - System.out.println(switch (o) {// 5 - case Integer i -> Integer.toString(i);// 6 - case null, default -> "null";// 7 + System.out.println(switch (o) {// 7 + case Integer i -> Integer.toString(i);// 8 + case null, default -> "null";// 9 }); - }// 9 + }// 11 + + public String test2(Object o) { + return switch (o) {// 14 + case Integer i -> Integer.toString(i);// 15 + case String s -> s;// 16 + default -> "null";// 17 + }; + } + + public String test3(Supplier o) { + return switch (o.get()) {// 22 + case Integer i -> Integer.toString(i);// 23 + case String s -> s;// 24 + default -> "null";// 25 + }; + } } class 'pkg/TestSwitchPatternMatchingJ21' { method 'test1 (Ljava/lang/Object;)V' { - 0 4 - 1 4 - 2 4 - 3 4 - 7 4 - e 4 - f 4 - 10 4 - 11 4 - 12 4 - 13 4 - 14 4 - 15 4 - 16 4 - 17 4 - 18 4 - 19 4 - 1a 4 - 1b 4 - 1c 4 - 1d 4 - 1e 4 - 1f 4 - 20 4 - 21 4 - 22 4 - 23 4 - 24 4 - 25 4 - 26 4 - 27 4 - 2c 5 - 2d 5 - 2e 5 - 2f 5 - 30 5 - 31 5 - 32 5 - 33 5 - 34 5 - 35 5 - 39 6 - 3a 6 - 3b 4 - 3c 4 - 3d 4 - 3e 8 + 0 6 + 1 6 + 2 6 + 3 6 + 7 6 + e 6 + f 6 + 10 6 + 11 6 + 12 6 + 13 6 + 14 6 + 15 6 + 16 6 + 17 6 + 18 6 + 19 6 + 1a 6 + 1b 6 + 1c 6 + 1d 6 + 1e 6 + 1f 6 + 20 6 + 21 6 + 22 6 + 23 6 + 24 6 + 25 6 + 26 6 + 27 6 + 2c 7 + 2d 7 + 2e 7 + 2f 7 + 30 7 + 31 7 + 32 7 + 33 7 + 34 7 + 35 7 + 39 8 + 3a 8 + 3b 6 + 3c 6 + 3d 6 + 3e 10 + } + + method 'test2 (Ljava/lang/Object;)Ljava/lang/String;' { + 0 13 + 9 13 + 10 13 + 11 13 + 12 13 + 13 13 + 14 13 + 15 13 + 16 13 + 17 13 + 18 13 + 19 13 + 1a 13 + 1b 13 + 1c 13 + 1d 13 + 1e 13 + 1f 13 + 20 13 + 21 13 + 22 13 + 23 13 + 24 13 + 25 13 + 26 13 + 27 13 + 28 13 + 29 13 + 2a 13 + 2b 13 + 30 14 + 31 14 + 32 14 + 33 14 + 34 14 + 35 14 + 36 14 + 37 14 + 38 14 + 39 14 + 41 15 + 42 15 + 43 15 + 44 15 + 48 16 + 49 16 + 4a 13 + } + + method 'test3 (Ljava/util/function/Supplier;)Ljava/lang/String;' { + 0 21 + 1 21 + 2 21 + 3 21 + 4 21 + 5 21 + 15 21 + 16 21 + 17 21 + 18 21 + 19 21 + 1a 21 + 1b 21 + 1c 21 + 1d 21 + 1e 21 + 1f 21 + 20 21 + 21 21 + 22 21 + 23 21 + 24 21 + 25 21 + 26 21 + 27 21 + 28 21 + 29 21 + 2a 21 + 2b 21 + 2c 21 + 2d 21 + 2e 21 + 2f 21 + 34 22 + 35 22 + 36 22 + 37 22 + 38 22 + 39 22 + 3a 22 + 3b 22 + 3c 22 + 3d 22 + 45 23 + 46 23 + 47 23 + 48 23 + 4c 24 + 4d 24 + 4e 21 } } Lines mapping: -5 <-> 5 -6 <-> 6 7 <-> 7 +8 <-> 8 9 <-> 9 +11 <-> 11 +14 <-> 14 +15 <-> 15 +16 <-> 16 +17 <-> 17 +22 <-> 22 +23 <-> 23 +24 <-> 24 +25 <-> 25 diff --git a/testData/results/pkg/TestSwitchPatternMatchingLoop.dec b/testData/results/pkg/TestSwitchPatternMatchingLoop.dec index 9d691e77fd..eb324d4021 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingLoop.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingLoop.dec @@ -1,12 +1,9 @@ package pkg; -import java.util.Objects; - public class TestSwitchPatternMatchingLoop { public void test(Object o) { while (true) { - Objects.requireNonNull(o);// 6 - switch (o) { + switch (o) {// 6 case Integer i:// 7 System.out.println(i); break; @@ -22,74 +19,71 @@ public class TestSwitchPatternMatchingLoop { class 'pkg/TestSwitchPatternMatchingLoop' { method 'test (Ljava/lang/Object;)V' { - 0 7 - 2 7 - 3 7 - 4 7 - 9 8 - 10 8 - 11 8 - 12 8 - 13 8 - 14 8 - 15 8 - 16 8 - 17 8 - 18 8 - 19 8 - 1a 8 - 1b 8 - 1c 8 - 1d 8 - 1e 8 - 1f 8 - 20 8 - 21 8 - 22 8 - 23 8 - 24 8 - 25 8 - 26 8 - 27 8 - 28 8 - 29 8 - 2a 8 - 2b 8 - 30 9 - 31 9 - 32 10 - 33 10 - 34 10 - 35 10 - 36 10 - 37 10 - 38 10 - 39 10 - 3a 11 - 41 12 - 42 12 - 43 13 - 44 13 - 45 13 - 46 13 - 47 13 - 48 13 - 49 13 - 4a 13 - 4b 14 - 4e 16 - 4f 16 - 50 16 - 51 16 - 52 16 - 53 16 - 54 16 - 55 16 + 0 5 + 9 5 + 10 5 + 11 5 + 12 5 + 13 5 + 14 5 + 15 5 + 16 5 + 17 5 + 18 5 + 19 5 + 1a 5 + 1b 5 + 1c 5 + 1d 5 + 1e 5 + 1f 5 + 20 5 + 21 5 + 22 5 + 23 5 + 24 5 + 25 5 + 26 5 + 27 5 + 28 5 + 29 5 + 2a 5 + 2b 5 + 30 6 + 31 6 + 32 7 + 33 7 + 34 7 + 35 7 + 36 7 + 37 7 + 38 7 + 39 7 + 3a 8 + 41 9 + 42 9 + 43 10 + 44 10 + 45 10 + 46 10 + 47 10 + 48 10 + 49 10 + 4a 10 + 4b 11 + 4e 13 + 4f 13 + 50 13 + 51 13 + 52 13 + 53 13 + 54 13 + 55 13 } } Lines mapping: -6 <-> 8 -7 <-> 10 -8 <-> 13 -9 <-> 17 +6 <-> 6 +7 <-> 7 +8 <-> 10 +9 <-> 14 diff --git a/testData/results/pkg/TestSwitchPatternMatchingReturn1.dec b/testData/results/pkg/TestSwitchPatternMatchingReturn1.dec index b648eea7b3..7187717195 100644 --- a/testData/results/pkg/TestSwitchPatternMatchingReturn1.dec +++ b/testData/results/pkg/TestSwitchPatternMatchingReturn1.dec @@ -1,11 +1,7 @@ package pkg; -import java.util.Objects; - public class TestSwitchPatternMatchingReturn1 { public int test(Object o) { - Objects.requireNonNull(o); - return switch (o) {// 5 case Integer i -> i;// 6 case String s -> s.length();// 7 @@ -16,60 +12,57 @@ public class TestSwitchPatternMatchingReturn1 { class 'pkg/TestSwitchPatternMatchingReturn1' { method 'test (Ljava/lang/Object;)I' { - 0 6 - 2 6 - 3 6 - 4 6 - 9 8 - 10 8 - 11 8 - 12 8 - 13 8 - 14 8 - 15 8 - 16 8 - 17 8 - 18 8 - 19 8 - 1a 8 - 1b 8 - 1c 8 - 1d 8 - 1e 8 - 1f 8 - 20 8 - 21 8 - 22 8 - 23 8 - 24 8 - 25 8 - 26 8 - 27 8 - 28 8 - 29 8 - 2a 8 - 2b 8 - 30 9 - 31 9 - 32 9 - 33 9 - 34 9 - 35 9 - 36 9 - 3e 10 - 3f 10 - 40 10 - 41 10 - 42 10 - 43 10 - 44 10 - 48 11 - 49 8 + 0 4 + 9 4 + 10 4 + 11 4 + 12 4 + 13 4 + 14 4 + 15 4 + 16 4 + 17 4 + 18 4 + 19 4 + 1a 4 + 1b 4 + 1c 4 + 1d 4 + 1e 4 + 1f 4 + 20 4 + 21 4 + 22 4 + 23 4 + 24 4 + 25 4 + 26 4 + 27 4 + 28 4 + 29 4 + 2a 4 + 2b 4 + 30 5 + 31 5 + 32 5 + 33 5 + 34 5 + 35 5 + 36 5 + 3e 6 + 3f 6 + 40 6 + 41 6 + 42 6 + 43 6 + 44 6 + 48 7 + 49 4 } } Lines mapping: -5 <-> 9 -6 <-> 10 -7 <-> 11 -8 <-> 12 +5 <-> 5 +6 <-> 6 +7 <-> 7 +8 <-> 8 diff --git a/testData/results/pkg/TestUnknownCastJ17.dec b/testData/results/pkg/TestUnknownCastJ17.dec index d0626a4a52..6397698336 100644 --- a/testData/results/pkg/TestUnknownCastJ17.dec +++ b/testData/results/pkg/TestUnknownCastJ17.dec @@ -1,21 +1,12 @@ package pkg; import java.lang.annotation.ElementType; -import java.util.Objects; public class TestUnknownCastJ17 { - // $VF: Could not properly define all variable types! public void test() { ElementType vvv1 = ElementType.METHOD;// 8 synchronized (this) {// 9 - label91: { - System.out.println(vvv1);// 10 - Object var23; - Objects.requireNonNull(var23);// 11 - Object vvv5 = var23; - - var10000_1 = ()(new Object()); - } + System.out.println(vvv1);// 10 } try { @@ -29,13 +20,8 @@ public class TestUnknownCastJ17 { synchronized (this) {// 35 System.out.println(vvv1);// 36 System.out.println(vvv1);// 37 - Object var10000; - Objects.requireNonNull(var10000);// 38 - Object vvv5 = var10000; - - new Object(); - for (int var9 = switch (vvv5) { + for (int var9 = switch (new Object()) {// 38 default -> { ElementType var5 = ElementType.METHOD;// 40 System.out.println(vvv1);// 42 @@ -56,131 +42,122 @@ public class TestUnknownCastJ17 { class 'pkg/TestUnknownCastJ17' { method 'test ()V' { - 0 8 - 1 8 - 2 8 - 3 8 - 4 9 - 7 9 - 8 11 - 9 11 - a 11 - b 11 - c 11 - d 11 - e 11 - 17 13 - 18 13 - 19 13 - 1b 14 - a8 21 - a9 22 - aa 24 + 0 6 + 1 6 + 2 6 + 3 6 + 4 7 + 7 7 + 8 8 + 9 8 + a 8 + b 8 + c 8 + d 8 + e 8 + a8 12 + a9 13 + aa 15 } method 'test2 ()V' { - 0 27 - 1 27 - 2 27 - 3 27 - 4 28 - 7 28 - 8 29 - 9 29 - a 29 - b 29 - c 29 - d 29 - e 29 - f 30 - 10 30 - 11 30 - 12 30 - 13 30 - 14 30 - 15 30 - 1e 32 - 1f 32 - 20 32 - 22 33 - 26 37 - 2e 37 - 2f 37 - 30 37 - 31 37 - 32 37 - 33 37 - 34 37 - 35 37 - 36 37 - 37 37 - 38 39 - 39 39 - 3a 39 - 3b 39 - 3c 39 - 3d 40 - 3e 40 - 3f 40 - 40 40 - 41 40 - 42 40 - 43 40 - 44 41 - 45 41 - 46 41 - 48 43 - 49 43 - 4a 43 - 4b 43 - 4c 43 - 4d 43 - 4e 43 - 4f 43 - 50 43 - 51 43 - 52 44 - 53 44 - 54 44 - 55 44 - 56 45 - 57 45 - 58 45 - 59 45 - 5a 45 - 5b 45 - 5c 45 - 5d 43 - 5e 43 - 5f 43 - 76 50 - 77 51 - 78 53 + 0 18 + 1 18 + 2 18 + 3 18 + 4 19 + 7 19 + 8 20 + 9 20 + a 20 + b 20 + c 20 + d 20 + e 20 + f 21 + 10 21 + 11 21 + 12 21 + 13 21 + 14 21 + 15 21 + 2e 23 + 2f 23 + 30 23 + 31 23 + 32 23 + 33 23 + 34 23 + 35 23 + 36 23 + 37 23 + 38 25 + 39 25 + 3a 25 + 3b 25 + 3c 25 + 3d 26 + 3e 26 + 3f 26 + 40 26 + 41 26 + 42 26 + 43 26 + 44 27 + 45 27 + 46 27 + 48 29 + 49 29 + 4a 29 + 4b 29 + 4c 29 + 4d 29 + 4e 29 + 4f 29 + 50 29 + 51 29 + 52 30 + 53 30 + 54 30 + 55 30 + 56 31 + 57 31 + 58 31 + 59 31 + 5a 31 + 5b 31 + 5c 31 + 5d 29 + 5e 29 + 5f 29 + 76 36 + 77 37 + 78 39 } } Lines mapping: -8 <-> 9 -9 <-> 10 -10 <-> 12 -11 <-> 14 -28 <-> 22 -29 <-> 23 -31 <-> 25 -34 <-> 28 -35 <-> 29 -36 <-> 30 -37 <-> 31 -38 <-> 33 -40 <-> 40 -42 <-> 41 -43 <-> 44 -44 <-> 45 -45 <-> 46 -51 <-> 51 -52 <-> 52 -54 <-> 54 +8 <-> 7 +9 <-> 8 +10 <-> 9 +28 <-> 13 +29 <-> 14 +31 <-> 16 +34 <-> 19 +35 <-> 20 +36 <-> 21 +37 <-> 22 +38 <-> 24 +40 <-> 26 +42 <-> 27 +43 <-> 30 +44 <-> 31 +45 <-> 32 +51 <-> 37 +52 <-> 38 +54 <-> 40 Not mapped: +11 13 15 16 diff --git a/testData/src/java21/pkg/TestSwitchPatternMatchingJ21.java b/testData/src/java21/pkg/TestSwitchPatternMatchingJ21.java index db6546abc3..64e62ec2b8 100644 --- a/testData/src/java21/pkg/TestSwitchPatternMatchingJ21.java +++ b/testData/src/java21/pkg/TestSwitchPatternMatchingJ21.java @@ -1,5 +1,7 @@ package pkg; +import java.util.function.Supplier; + public class TestSwitchPatternMatchingJ21 { public void test1(Object o) { System.out.println(switch (o) { @@ -7,4 +9,20 @@ public void test1(Object o) { case null, default -> "null"; }); } + + public String test2(Object o) { + return switch (o) { + case Integer i -> Integer.toString(i); + case String s -> s; + default -> "null"; + }; + } + + public String test3(Supplier o) { + return switch (o.get()) { + case Integer i -> Integer.toString(i); + case String s -> s; + default -> "null"; + }; + } } From 883a7aa0f94cbc028b88154a18980038cca6c5c2 Mon Sep 17 00:00:00 2001 From: coehlrich Date: Fri, 24 May 2024 03:56:16 +1200 Subject: [PATCH 23/25] Fix method parameters reading the parameter type from the signature for (#401) synthetic parameters --- .../java/decompiler/main/ClassWriter.java | 5 +++-- .../java/decompiler/SingleClassesTest.java | 1 + testData/results/pkg/TestInnerClasses4J21.dec | 21 +++++++++++++++++++ .../src/java21/pkg/TestInnerClasses4J21.java | 12 +++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 testData/results/pkg/TestInnerClasses4J21.dec create mode 100644 testData/src/java21/pkg/TestInnerClasses4J21.java diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index 869a20f653..20a5a1aef4 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -1191,8 +1191,9 @@ public boolean writeMethod(ClassNode node, StructMethod mt, int methodIndex, Tex buffer.pushNewlineGroup(indent, 0); for (int i = start; i < md.params.length; i++) { - VarType parameterType = hasDescriptor && paramCount < descriptor.parameterTypes.size() ? descriptor.parameterTypes.get(paramCount) : md.params[i]; - if (mask == null || mask.get(i) == null) { + boolean real = mask == null || mask.get(i) == null; + VarType parameterType = real && hasDescriptor && paramCount < descriptor.parameterTypes.size() ? descriptor.parameterTypes.get(paramCount) : md.params[i]; + if (real) { if (paramCount > 0) { buffer.append(","); buffer.appendPossibleNewline(" "); diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index c80934709a..2d462889c2 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -702,6 +702,7 @@ private void registerDefault() { register(JAVA_21, "TestInnerClassesJ21"); register(JAVA_21, "TestInnerClasses2J21"); register(JAVA_21, "TestInnerClasses3J21"); + register(JAVA_21, "TestInnerClasses4J21"); register(JAVA_8, "TestInnerClassesJ8"); register(JAVA_8, "TestSwitchInTry"); register(JAVA_21, "TestSwitchPatternMatchingJ21"); diff --git a/testData/results/pkg/TestInnerClasses4J21.dec b/testData/results/pkg/TestInnerClasses4J21.dec new file mode 100644 index 0000000000..d73cbddfc4 --- /dev/null +++ b/testData/results/pkg/TestInnerClasses4J21.dec @@ -0,0 +1,21 @@ +package pkg; + +import java.util.List; + +public class TestInnerClasses4J21 { + private class Inner { + Inner(double d, List l) { + }// 9 + } +} + +class 'pkg/TestInnerClasses4J21$Inner' { + method ' (Lpkg/TestInnerClasses4J21;DLjava/util/List;)V' { + 4 7 + } +} + +Lines mapping: +9 <-> 8 +Not mapped: +7 diff --git a/testData/src/java21/pkg/TestInnerClasses4J21.java b/testData/src/java21/pkg/TestInnerClasses4J21.java new file mode 100644 index 0000000000..351e19be9e --- /dev/null +++ b/testData/src/java21/pkg/TestInnerClasses4J21.java @@ -0,0 +1,12 @@ +package pkg; + +import java.util.List; + +public class TestInnerClasses4J21 { + private class Inner { + Inner(double d, List l) { + + } + } + +} From 4ecf1dd9acde50295788dbe2f4cab4ece9f7cdd1 Mon Sep 17 00:00:00 2001 From: coehlrich Date: Mon, 24 Jun 2024 04:15:59 +1200 Subject: [PATCH 24/25] Add support for intersection types in casts (#405) * Fix intersection casts for direct methods * Add support for variable assignments * Use var for variables that represent intersection types and update tests * Add comments and remove println * Add support for when an intersection type is casted back to it's original type --- .../decompiler/main/rels/MethodProcessor.java | 5 + .../decompiler/IntersectionCastProcessor.java | 258 ++++++++++++++++++ .../decompiler/exps/FunctionExprent.java | 21 +- .../decompiler/exps/InvocationExprent.java | 4 + .../modules/decompiler/exps/VarExprent.java | 11 +- .../java/decompiler/SingleClassesTest.java | 1 + .../results/pkg/TestCastIntersectionJ21.dec | 128 +++++++++ .../results/pkg/TestKotlinConstructorKt.dec | 5 +- .../java21/pkg/TestCastIntersectionJ21.java | 36 +++ 9 files changed, 455 insertions(+), 14 deletions(-) create mode 100644 src/org/jetbrains/java/decompiler/modules/decompiler/IntersectionCastProcessor.java create mode 100644 testData/results/pkg/TestCastIntersectionJ21.dec create mode 100644 testData/src/java21/pkg/TestCastIntersectionJ21.java diff --git a/src/org/jetbrains/java/decompiler/main/rels/MethodProcessor.java b/src/org/jetbrains/java/decompiler/main/rels/MethodProcessor.java index c7ef4f4033..4affc00bab 100644 --- a/src/org/jetbrains/java/decompiler/main/rels/MethodProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/rels/MethodProcessor.java @@ -304,6 +304,11 @@ public static RootStatement codeToJava(StructClass cl, StructMethod mt, MethodDe continue; } + if (IntersectionCastProcessor.makeIntersectionCasts(root)) { + decompileRecord.add("intersectionCasts", root); + continue; + } + if (DecompilerContext.getOption(IFernflowerPreferences.PATTERN_MATCHING)) { if (cl.getVersion().hasIfPatternMatching()) { if (IfPatternMatchProcessor.matchInstanceof(root)) { diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/IntersectionCastProcessor.java b/src/org/jetbrains/java/decompiler/modules/decompiler/IntersectionCastProcessor.java new file mode 100644 index 0000000000..7ca02a01a3 --- /dev/null +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/IntersectionCastProcessor.java @@ -0,0 +1,258 @@ +package org.jetbrains.java.decompiler.modules.decompiler; + +import org.jetbrains.java.decompiler.code.CodeConstants; +import org.jetbrains.java.decompiler.main.DecompilerContext; +import org.jetbrains.java.decompiler.modules.decompiler.exps.*; +import org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent.FunctionType; +import org.jetbrains.java.decompiler.modules.decompiler.stats.RootStatement; +import org.jetbrains.java.decompiler.modules.decompiler.stats.Statement; +import org.jetbrains.java.decompiler.struct.StructClass; +import org.jetbrains.java.decompiler.struct.StructMethod; +import org.jetbrains.java.decompiler.struct.gen.CodeType; +import org.jetbrains.java.decompiler.struct.gen.TypeFamily; +import org.jetbrains.java.decompiler.struct.gen.VarType; +import org.jetbrains.java.decompiler.struct.gen.generics.GenericMethodDescriptor; +import org.jetbrains.java.decompiler.util.Pair; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +public class IntersectionCastProcessor { + + public static boolean makeIntersectionCasts(RootStatement root) { + return makeIntersectionCastsRec(root, root); + } + + private static boolean makeIntersectionCastsRec(Statement stat, RootStatement root) { + boolean result = false; + if (stat.getExprents() != null) { + for (Exprent e : stat.getExprents()) { + result |= makeIntersectionCasts(e, root); + } + } else { + for (Object o : stat.getSequentialObjects()) { + if (o instanceof Statement s) { + result |= makeIntersectionCastsRec(s, root); + } else if (o instanceof Exprent e) { + result |= makeIntersectionCasts(e, root); + } + } + } + return result; + } + + private static boolean makeIntersectionCasts(Exprent exp, RootStatement root) { + if (exp instanceof InvocationExprent inv) { + if (handleInvocation(inv, root)) { + return true; + } + } else if (exp instanceof AssignmentExprent assignment) { + if (handleAssignment(assignment, root)) { + return true; + } + } + boolean result = false; + for (Exprent sub : exp.getAllExprents()) { + result |= makeIntersectionCasts(sub, root); + } + return result; + } + + private static boolean handleInvocation(InvocationExprent exp, RootStatement root) { + List lstParameters = exp.getLstParameters(); + boolean result = false; + for (int i = 0; i < lstParameters.size(); i++) { + Exprent parameter = lstParameters.get(i); + if (parameter instanceof FunctionExprent cast && isValidCast(cast)) { + Pair, Exprent> casts = getCasts(cast); + List types = casts.a; + Exprent inner = casts.b; + // Checks for any bounds not supported by the current list of casts + List bounds = getBounds(exp, i).stream() + .filter(bound -> !types + .stream() + .anyMatch(constant -> DecompilerContext.getStructContext().instanceOf(constant.getExprType().value, bound.value))) + .toList(); + + // Checks if the original type supports the remaining bounds + if (!bounds.isEmpty() && bounds.stream().allMatch(bound -> DecompilerContext.getStructContext().instanceOf(inner.getExprType().value, bound.value))) { + types.add(new ConstExprent(inner.getExprType(), null, null)); + } + result |= replaceCasts(cast, types, inner); + } + } + return result; + } + + private static boolean handleAssignment(AssignmentExprent exp, RootStatement root) { + if (exp.getLeft() instanceof VarExprent varExp) { + Exprent assigned = exp.getRight(); + if (assigned instanceof FunctionExprent cast && isValidCast(cast)) { + Pair, Exprent> casts = getCasts(cast); + List types = casts.a; + Exprent inner = casts.b; + List references = findReferences(varExp, root); + + // Convert the variable references into a set of bounds + Set bounds = new HashSet<>(); + for (VariablePosition position : references) { + bounds.addAll(switch (position.position) { + case METHOD_PARAMETER -> getBounds((InvocationExprent) position.exp, position.index); + case CASTED -> { + FunctionExprent func = (FunctionExprent) position.exp; + if (func.getLstOperands().size() == 2) { + yield List.of(func.getLstOperands().get(1).getExprType()); + } else { + yield List.of(); + } + } + }); + } + + // Checks for any bounds not supported by the current list of casts + bounds = bounds.stream() + .filter(bound -> !types + .stream() + .anyMatch(constant -> DecompilerContext.getStructContext().instanceOf(constant.getExprType().value, bound.value))) + .collect(Collectors.toSet()); + + // Checks if the original type supports the remaining bounds + if (!bounds.isEmpty() && bounds.stream().anyMatch(bound -> DecompilerContext.getStructContext().instanceOf(inner.getExprType().value, bound.value))) { + types.add(new ConstExprent(inner.getExprType(), null, null)); + } + if (replaceCasts(cast, types, inner)) { + // If the casts were replaced make sure that the variable uses "var" instead of + // a type + varExp.setIntersectionType(true); + return true; + } + } + } + return false; + } + + private static List getBounds(InvocationExprent exp, int parameter) { + // Gets the bounds of a type parameter of a parameter of a method + StructMethod method = exp.getDesc(); + GenericMethodDescriptor gmd = method != null ? method.getSignature() : null; + int start = gmd != null && DecompilerContext.getStructContext().getClass(method.getClassQualifiedName()).hasModifier(CodeConstants.ACC_ENUM) && method.getName().equals(CodeConstants.INIT_NAME) ? 2 : 0; + if (gmd != null) { + int index = parameter - start; + VarType type = gmd.parameterTypes.get(index); + if (type.type == CodeType.GENVAR) { + int typeParameterIndex = gmd.typeParameters.indexOf(type.value); + if (typeParameterIndex != -1) { + return gmd.typeParameterBounds.get(typeParameterIndex); + } + } + } + return List.of(); + } + + /** + * Searches for where a variable is referenced and returns the context + */ + private static List findReferences(VarExprent varExp, RootStatement root) { + List list = new ArrayList<>(); + findReferencesRec(varExp, root, root, list); + return list; + } + + private static void findReferencesRec(VarExprent varExp, Statement stat, RootStatement root, List list) { + if (stat.getExprents() != null) { + for (Exprent e : stat.getExprents()) { + findReferences(varExp, e, root, list); + } + } else { + for (Object o : stat.getSequentialObjects()) { + if (o instanceof Statement s) { + findReferencesRec(varExp, s, root, list); + } else if (o instanceof Exprent e) { + findReferences(varExp, e, root, list); + } + } + } + } + + private static void findReferences(VarExprent varExp, Exprent exp, RootStatement root, List list) { + if (exp instanceof InvocationExprent inv) { + findReferences(varExp, inv, list); + } else if (exp instanceof FunctionExprent func && func.getFuncType() == FunctionType.CAST) { + if (func.getLstOperands().get(0) instanceof VarExprent otherVar && varExp.getVarVersionPair().equals(otherVar.getVarVersionPair())) { + list.add(new VariablePosition(VariablePositionEnum.CASTED, exp, -1)); + } + } + for (Exprent sub : exp.getAllExprents()) { + findReferences(varExp, sub, root, list); + } + } + + private static void findReferences(VarExprent varExp, InvocationExprent inv, List list) { + List lstParameters = inv.getLstParameters(); + for (int i = 0; i < lstParameters.size(); i++) { + Exprent parameter = lstParameters.get(i); + if (parameter instanceof VarExprent otherVar && varExp.getVarVersionPair().equals(otherVar.getVarVersionPair())) { + list.add(new VariablePosition(VariablePositionEnum.METHOD_PARAMETER, inv, i)); + } + } + } + + private static Pair, Exprent> getCasts(Exprent exp) { + // Gets the list of casts done and gets the original exprent + List types = new ArrayList<>(); + Exprent inner = exp; + while (inner instanceof FunctionExprent cast && isValidCast(cast)) { + types.add(cast.getLstOperands().get(1)); + inner = cast.getLstOperands().get(0); + } + return Pair.of(types, inner); + } + + private static boolean isValidCast(FunctionExprent cast) { + if (cast.getFuncType() == FunctionType.CAST && cast.getLstOperands().size() == 2) { + VarType type = cast.getLstOperands().get(1).getExprType(); + // Intersection casts cannot include arrays + return type.typeFamily == TypeFamily.OBJECT && type.arrayDim == 0; + } + return false; + } + + private static boolean replaceCasts(FunctionExprent cast, List types, Exprent inner) { + if (types.size() > 1) { + // Reorders the list of types to make sure that the class is always first + Exprent nonInterface = null; + for (Exprent type : types) { + StructClass clazz = DecompilerContext.getStructContext().getClass(type.getExprType().value); + if (clazz != null && !clazz.hasModifier(CodeConstants.ACC_INTERFACE)) { + if (nonInterface == null) { + nonInterface = type; + } else { + return false; + } + } + } + if (nonInterface != null) { + types.remove(types.indexOf(nonInterface)); + types.add(0, nonInterface); + } + // Replaces the operands of the cast with the casted exprent and the list of needed casts + cast.getLstOperands().clear(); + cast.getLstOperands().add(inner); + cast.getLstOperands().addAll(types); + return true; + } + return false; + } + + private static record VariablePosition(VariablePositionEnum position, Exprent exp, int index) { + + } + + private static enum VariablePositionEnum { + METHOD_PARAMETER, + CASTED; + } +} diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java index 788a98da35..82eba81d78 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java @@ -240,7 +240,7 @@ public VarType getInferredExprType(VarType upperBound) { if (funcType == FunctionType.CAST) { this.needsCast = true; VarType right = lstOperands.get(0).getInferredExprType(upperBound); - VarType cast = lstOperands.get(1).getExprType(); + List cast = lstOperands.subList(1, lstOperands.size()).stream().map(Exprent::getExprType).toList(); if (upperBound != null && (upperBound.isGeneric() || right.isGeneric())) { Map> names = this.getNamedGenerics(); @@ -258,12 +258,8 @@ public VarType getInferredExprType(VarType upperBound) { } if (types != null) { - boolean anyMatch = false; //TODO: allMatch instead of anyMatch? - for (VarType type : types) { - anyMatch |= DecompilerContext.getStructContext().instanceOf(type.value, cast.value); - } - - if (anyMatch) { + List finalTypes = types; + if (cast.stream().allMatch(castType -> finalTypes.stream().anyMatch(type -> DecompilerContext.getStructContext().instanceOf(type.value, castType.value)))) { this.needsCast = false; } } else { @@ -278,7 +274,8 @@ public VarType getInferredExprType(VarType upperBound) { return right; } } else { //TODO: Capture generics to make cast better? - this.needsCast = right.type == CodeType.NULL || !DecompilerContext.getStructContext().instanceOf(right.value, cast.value) || right.arrayDim != cast.arrayDim; + final VarType finalRight = right; + this.needsCast = right.type == CodeType.NULL || cast.stream().anyMatch(castType -> !DecompilerContext.getStructContext().instanceOf(finalRight.value, castType.value)) || cast.stream().anyMatch(castType -> finalRight.arrayDim != castType.arrayDim); } return getExprType(); @@ -606,7 +603,13 @@ else if (left instanceof ConstExprent) { if (!needsCast) { return buf.append(lstOperands.get(0).toJava(indent)); } - return buf.append(lstOperands.get(1).toJava(indent)).encloseWithParens().append(wrapOperandString(lstOperands.get(0), true, indent)); + for (int i = 1; i < lstOperands.size(); i++) { + if (i > 1) { + buf.append(" & "); + } + buf.append(lstOperands.get(i).toJava(indent)); + } + return buf.encloseWithParens().append(wrapOperandString(lstOperands.get(0), true, indent)); case ARRAY_LENGTH: Exprent arr = lstOperands.get(0); diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java index 541d6a4744..87fd2fe2d9 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java @@ -1809,6 +1809,10 @@ public Map getGenericsMap() { } public StructMethod getDesc() { + if (desc == null) { + StructClass cl = DecompilerContext.getStructContext().getClass(classname); + desc = cl != null ? cl.getMethodRecursive(name, stringDescriptor) : null; + } return desc; } diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/VarExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/VarExprent.java index 8d71deaa04..1e7086516c 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/VarExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/VarExprent.java @@ -57,6 +57,7 @@ public class VarExprent extends Exprent { private Instruction backing = null; private boolean isEffectivelyFinal = false; private VarType boundType; + private boolean isIntersectionType = false; public VarExprent(int index, VarType varType, VarProcessor processor) { this(index, varType, processor, null); @@ -131,7 +132,7 @@ public TextBuffer toJava(int indent) { } VarType definitionType = getDefinitionVarType(); String name = ExprProcessor.getCastTypeName(definitionType); - if (name.equals(ExprProcessor.UNREPRESENTABLE_TYPE_STRING)) { + if (name.equals(ExprProcessor.UNREPRESENTABLE_TYPE_STRING) || isIntersectionType) { buffer.append("var"); } else { buffer.appendCastTypeName(definitionType); @@ -514,6 +515,14 @@ public String toString() { return "VarExprent[" + index + ',' + version + (definition ? " Def" : "") + "]: {" + super.toString() + "}"; } + public void setIntersectionType(boolean intersection) { + this.isIntersectionType = intersection; + } + + public boolean isIntersectionType() { + return this.isIntersectionType; + } + // ***************************************************************************** // IMatchable implementation // ***************************************************************************** diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index 2d462889c2..9b9ca4703c 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -706,6 +706,7 @@ private void registerDefault() { register(JAVA_8, "TestInnerClassesJ8"); register(JAVA_8, "TestSwitchInTry"); register(JAVA_21, "TestSwitchPatternMatchingJ21"); + register(JAVA_21, "TestCastIntersectionJ21"); } private void registerEntireClassPath() { diff --git a/testData/results/pkg/TestCastIntersectionJ21.dec b/testData/results/pkg/TestCastIntersectionJ21.dec new file mode 100644 index 0000000000..a19ed62c35 --- /dev/null +++ b/testData/results/pkg/TestCastIntersectionJ21.dec @@ -0,0 +1,128 @@ +package pkg; + +public class TestCastIntersectionJ21 { + public void test1(TestCastIntersectionJ21.I1 i1) { + this.method((TestCastIntersectionJ21.I1 & TestCastIntersectionJ21.I2)i1);// 5 + }// 6 + + public void test2(TestCastIntersectionJ21.I2 i2) { + this.method((TestCastIntersectionJ21.I1 & TestCastIntersectionJ21.I2)i2);// 9 + }// 10 + + public void test3(TestCastIntersectionJ21.I1 i1) { + var i = (TestCastIntersectionJ21.I1 & TestCastIntersectionJ21.I2)i1;// 13 + this.method(i);// 14 + }// 15 + + public void test4(TestCastIntersectionJ21.I2 i2) { + var i = (TestCastIntersectionJ21.I1 & TestCastIntersectionJ21.I2)i2;// 18 + this.method(i);// 19 + }// 20 + + public void test5(TestCastIntersectionJ21.I2 i2) { + var i = (TestCastIntersectionJ21.I1 & TestCastIntersectionJ21.I2)i2;// 23 + ((TestCastIntersectionJ21.I2)i).method();// 24 + }// 25 + + public void method(I i) { + }// 28 + + private static class I1 { + } + + private interface I2 { + void method(); + } +} + +class 'pkg/TestCastIntersectionJ21' { + method 'test1 (Lpkg/TestCastIntersectionJ21$I1;)V' { + 0 4 + 1 4 + 5 4 + 6 4 + 7 4 + 8 4 + 9 4 + a 4 + b 5 + } + + method 'test2 (Lpkg/TestCastIntersectionJ21$I2;)V' { + 0 8 + 1 8 + 2 8 + 3 8 + 4 8 + 5 8 + 6 8 + 7 8 + 8 9 + } + + method 'test3 (Lpkg/TestCastIntersectionJ21$I1;)V' { + 0 12 + 4 12 + 5 12 + 6 12 + 7 12 + 8 13 + 9 13 + a 13 + b 13 + c 13 + d 14 + } + + method 'test4 (Lpkg/TestCastIntersectionJ21$I2;)V' { + 0 17 + 1 17 + 2 17 + 3 17 + 4 17 + 5 18 + 6 18 + 7 18 + 8 18 + 9 18 + a 19 + } + + method 'test5 (Lpkg/TestCastIntersectionJ21$I2;)V' { + 0 22 + 1 22 + 2 22 + 3 22 + 4 22 + 5 23 + 6 23 + 7 23 + 8 23 + 9 23 + a 23 + b 23 + c 23 + d 23 + e 24 + } + + method 'method (Lpkg/TestCastIntersectionJ21$I1;)V' { + 0 27 + } +} + +Lines mapping: +5 <-> 5 +6 <-> 6 +9 <-> 9 +10 <-> 10 +13 <-> 13 +14 <-> 14 +15 <-> 15 +18 <-> 18 +19 <-> 19 +20 <-> 20 +23 <-> 23 +24 <-> 24 +25 <-> 25 +28 <-> 28 diff --git a/testData/results/pkg/TestKotlinConstructorKt.dec b/testData/results/pkg/TestKotlinConstructorKt.dec index dca2b8ebf4..682b7ef365 100644 --- a/testData/results/pkg/TestKotlinConstructorKt.dec +++ b/testData/results/pkg/TestKotlinConstructorKt.dec @@ -17,7 +17,7 @@ public final class TestKotlinConstructorKt { private static final List foo(Collection list) { Iterable $this$map$iv = list; int $i$f$map = 0; - Collection destination$iv$iv = new ArrayList(CollectionsKt.collectionSizeOrDefault($this$map$iv, 10)); + var destination$iv$iv = new ArrayList(CollectionsKt.collectionSizeOrDefault($this$map$iv, 10)); int $i$f$mapTo = 0; for (Object item$iv$iv : $this$map$iv) {// 12 13 @@ -109,9 +109,6 @@ class 'pkg/TestKotlinConstructorKt' { 66 31 6b 34 6c 34 - 6d 34 - 6e 34 - 6f 34 71 34 72 34 73 34 diff --git a/testData/src/java21/pkg/TestCastIntersectionJ21.java b/testData/src/java21/pkg/TestCastIntersectionJ21.java new file mode 100644 index 0000000000..81f5eae5b1 --- /dev/null +++ b/testData/src/java21/pkg/TestCastIntersectionJ21.java @@ -0,0 +1,36 @@ +package pkg; + +public class TestCastIntersectionJ21 { + public void test1(I1 i1) { + method((I1 & I2) i1); + } + + public void test2(I2 i2) { + method((I1 & I2) i2); + } + + public void test3(I1 i1) { + var i = (I1 & I2) i1; + method(i); + } + + public void test4(I2 i2) { + var i = (I1 & I2) i2; + method(i); + } + + public void test5(I2 i2) { + var i = (I1 & I2) i2; + i.method(); + } + + public void method(I i) { + } + + private static class I1 { + } + + private static interface I2 { + public void method(); + } +} From 7d12f994bf87644e048a2990e926be0366ab648f Mon Sep 17 00:00:00 2001 From: Jasmine Karthikeyan <25208576+jaskarth@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:33:33 -0400 Subject: [PATCH 25/25] Guard var name with null check, fixes #400 --- .../jetbrains/java/decompiler/main/InitializerProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/jetbrains/java/decompiler/main/InitializerProcessor.java b/src/org/jetbrains/java/decompiler/main/InitializerProcessor.java index c6f1410a89..d7697009f7 100644 --- a/src/org/jetbrains/java/decompiler/main/InitializerProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/InitializerProcessor.java @@ -420,7 +420,7 @@ private static boolean isExprentIndependent(FieldExprent field, Exprent exprent, VarVersionPair varPair = new VarVersionPair((VarExprent)expr); if (!method.varproc.getExternalVars().contains(varPair)) { String varName = method.varproc.getVarName(varPair); - if (!varName.equals("this") && !varName.endsWith(".this")) { // FIXME: remove direct comparison with strings + if (varName == null || !varName.equals("this") && !varName.endsWith(".this")) { // FIXME: remove direct comparison with strings return false; } }