From 866661df298b34e5ea08cda4f5922964e275bfaa Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 28 Sep 2018 17:09:10 +0200 Subject: [PATCH] Cleanup (test data format) --- .../java/decompiler/SingleClassesTest.java | 2 +- .../pkg/TestSuspendLambdaKt$sl1$1.class | Bin 2808 -> 2740 bytes .../classes/pkg/TestSuspendLambdaKt.class | Bin 1171 -> 1174 bytes testData/results/TestSuspendLambdaKt.dec | 132 ++++++++++-------- testData/src/pkg/TestSuspendLambda.kt | 1 + 5 files changed, 73 insertions(+), 62 deletions(-) diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index b2df702..7482741 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -123,7 +123,7 @@ public class SingleClassesTest { @Test public void testGroovyClass() { doTest("pkg/TestGroovyClass"); } @Test public void testGroovyTrait() { doTest("pkg/TestGroovyTrait"); } @Test public void testPrivateClasses() { doTest("pkg/PrivateClasses"); } - @Test public void testSuspendLambdaKt() { doTest("pkg/TestSuspendLambdaKt"); } + @Test public void testSuspendLambda() { doTest("pkg/TestSuspendLambdaKt"); } private void doTest(String testFile, String... companionFiles) { ConsoleDecompiler decompiler = fixture.getDecompiler(); diff --git a/testData/classes/pkg/TestSuspendLambdaKt$sl1$1.class b/testData/classes/pkg/TestSuspendLambdaKt$sl1$1.class index dd1fe0e7d04ef998b189081ff1e702befaa7acf8..47b0abe9c35e4fb37e3a2dce42a23b377e20180c 100644 GIT binary patch delta 1119 zcmY*YYf~F#6n@^l5#cz|k4#Ftj5x7QXt;8GnMm!O;&oJ};o7n?2_}=RNo5Y<^E{Ct^SS^}~+< zhVZ#S&q{46w-pVGwrJH|ZPuKbmbc=#i?T;#w2P&U{l56PQ)w+tIljGU`*uM<+>>7f zy1GSOXA+%ymE@6JQiHT0cg31$mzTA{kxq13=)h?Kvu;5E z+}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GB72TF#`n|Km-#b17kK&s3LQ6Ipcgr w$%%r(oAsDBF)}hue#q", "", "invoke", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;"} + d2 = {"", "", "invoke", "(Ljava/lang/Object;)Ljava/lang/Object;"} ) final class NamelessClass_1 extends SuspendLambda implements Function1, Object> { int label; @Nullable - public final Object invokeSuspend(@NotNull Object var1) { + public final Object invokeSuspend(@NotNull Object result) { Object var3 = IntrinsicsKt.getCOROUTINE_SUSPENDED(); switch(this.label) { case 0: - if (var1 instanceof Failure) { - throw ((Failure)var1).exception; + if (result instanceof Failure) { + throw ((Failure)result).exception; } - String var2 = "SL1";// 3 + String var2 = "SL1";// 4 System.out.println(var2); - return Unit.INSTANCE;// 4 + return Unit.INSTANCE;// 5 default: throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } @@ -60,80 +70,80 @@ public final class TestSuspendLambdaKt { } @NotNull - public final Continuation create(@NotNull Continuation continuation) { - Intrinsics.checkParameterIsNotNull(continuation, "continuation"); - NamelessClass_1 var2 = new NamelessClass_1(continuation); + public final Continuation create(@NotNull Continuation completion) { + Intrinsics.checkParameterIsNotNull(completion, "completion"); + NamelessClass_1 var2 = new NamelessClass_1(completion); return var2; } - @Nullable - public final Object invoke(@NotNull Continuation continuation) { - return ((NamelessClass_1)this.create(continuation)).invokeSuspend(Unit.INSTANCE); + public final Object invoke(Object var1) { + return ((NamelessClass_1)this.create((Continuation)var1)).invokeSuspend(Unit.INSTANCE); } } - sl1 = (Function1)(new NamelessClass_1((Continuation)null));// 2 + sl1 = (Function1)(new NamelessClass_1((Continuation)null));// 3 } } -class 'TestSuspendLambdaKt' { +class 'pkg/TestSuspendLambdaKt' { method 'getSl1 ()Lkotlin/jvm/functions/Function1;' { - 0 25 - 3 25 + 0 27 + 3 27 } method ' ()V' { - 4 74 - 8 74 - b 74 - e 75 + 4 83 + 8 83 + b 83 + e 84 } } -class 'TestSuspendLambdaKt$sl1$1' { +class 'pkg/TestSuspendLambdaKt$sl1$1' { method 'invokeSuspend (Ljava/lang/Object;)Ljava/lang/Object;' { - 0 42 - 3 42 - 5 43 - 8 43 - 1e 45 - 21 45 - 24 46 - 27 46 - 2a 46 - 2c 49 - 2e 49 - 2f 50 - 33 50 - 36 51 - 39 51 - 3e 53 - 43 53 + 0 52 + 3 52 + 5 53 + 8 53 + 1e 55 + 21 55 + 24 56 + 27 56 + 2a 56 + 2c 59 + 2e 59 + 2f 60 + 33 60 + 36 61 + 39 61 + 3e 63 + 43 63 } method ' (Lkotlin/coroutines/Continuation;)V' { - 1 58 - 3 58 - 6 59 + 1 68 + 3 68 + 6 69 } method 'create (Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;' { - 1 63 - 3 63 - e 64 - 10 65 + 1 73 + 3 73 + e 74 + 10 75 } - method 'invoke (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;' { - 2 70 - 5 70 - 8 70 - b 70 - e 70 + method 'invoke (Ljava/lang/Object;)Ljava/lang/Object;' { + 2 79 + 5 79 + 8 79 + b 79 + e 79 + 11 79 } } Lines mapping: -2 <-> 75 -3 <-> 50 -4 <-> 52 +3 <-> 84 +4 <-> 60 +5 <-> 62 diff --git a/testData/src/pkg/TestSuspendLambda.kt b/testData/src/pkg/TestSuspendLambda.kt index 6feef9d..8b80110 100644 --- a/testData/src/pkg/TestSuspendLambda.kt +++ b/testData/src/pkg/TestSuspendLambda.kt @@ -1,3 +1,4 @@ +package pkg val sl1: suspend () -> Unit = { println("SL1")