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 70ce79b26a..43bdb90ce6 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java @@ -1636,7 +1636,7 @@ private void iterateClashingExprent(Statement stat, StructMethod mt, Map System.out.println(o);// 7 + } + }; + } +} + +class 'pkg/TestAnonymousClassToLambda' { + method 'test1 (Ljava/lang/Object;)Ljava/lang/Object;' { + 9 4 + } +} + +class 'pkg/TestAnonymousClassToLambda$1' { + method 'getRunnable ()Ljava/lang/Runnable;' { + 9 6 + } + + method 'lambda$getRunnable$0 (Ljava/lang/Object;)V' { + 0 6 + 1 6 + 2 6 + 3 6 + 4 6 + 5 6 + 6 6 + 7 6 + } +} + +Lines mapping: +5 <-> 5 +7 <-> 7 diff --git a/testData/src/java8/pkg/TestAnonymousClassToLambda.java b/testData/src/java8/pkg/TestAnonymousClassToLambda.java new file mode 100644 index 0000000000..1297464cde --- /dev/null +++ b/testData/src/java8/pkg/TestAnonymousClassToLambda.java @@ -0,0 +1,11 @@ +package pkg; + +public class TestAnonymousClassToLambda { + public Object test1(Object o) { + return new Object() { + public Runnable getRunnable() { + return () -> System.out.println(o); + } + }; + } +}