diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index a65ab26..d8f6bee 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -58,5 +58,6 @@ public class SingleClassesTest extends SingleClassesTestBase { @Test public void testAnonymousClass() { doTest("pkg/TestAnonymousClass"); } @Test public void testThrowException() { doTest("pkg/TestThrowException"); } @Test public void testInnerLocal() { doTest("pkg/TestInnerLocal"); } + @Test public void testInnerLocalPkg() { doTest("pkg/TestInnerLocalPkg"); } @Test public void testInnerSignature() { doTest("pkg/TestInnerSignature"); } } diff --git a/testData/classes/pkg/TestInnerLocal.class b/testData/classes/pkg/TestInnerLocal.class index c939b5e..cc89241 100644 Binary files a/testData/classes/pkg/TestInnerLocal.class and b/testData/classes/pkg/TestInnerLocal.class differ diff --git a/testData/classes/pkg/TestInnerLocalPkg$1Inner.class b/testData/classes/pkg/TestInnerLocalPkg$1Inner.class new file mode 100644 index 0000000..eedffa2 Binary files /dev/null and b/testData/classes/pkg/TestInnerLocalPkg$1Inner.class differ diff --git a/testData/classes/pkg/TestInnerLocalPkg$2Inner.class b/testData/classes/pkg/TestInnerLocalPkg$2Inner.class new file mode 100644 index 0000000..5a1dcc4 Binary files /dev/null and b/testData/classes/pkg/TestInnerLocalPkg$2Inner.class differ diff --git a/testData/classes/pkg/TestInnerLocalPkg$Inner1.class b/testData/classes/pkg/TestInnerLocalPkg$Inner1.class new file mode 100644 index 0000000..9d548f1 Binary files /dev/null and b/testData/classes/pkg/TestInnerLocalPkg$Inner1.class differ diff --git a/testData/classes/pkg/TestInnerLocalPkg$Inner1Static$Inner2Static.class b/testData/classes/pkg/TestInnerLocalPkg$Inner1Static$Inner2Static.class new file mode 100644 index 0000000..54d59e3 Binary files /dev/null and b/testData/classes/pkg/TestInnerLocalPkg$Inner1Static$Inner2Static.class differ diff --git a/testData/classes/pkg/TestInnerLocalPkg$Inner1Static.class b/testData/classes/pkg/TestInnerLocalPkg$Inner1Static.class new file mode 100644 index 0000000..262b686 Binary files /dev/null and b/testData/classes/pkg/TestInnerLocalPkg$Inner1Static.class differ diff --git a/testData/classes/pkg/TestInnerLocalPkg.class b/testData/classes/pkg/TestInnerLocalPkg.class new file mode 100644 index 0000000..7535849 Binary files /dev/null and b/testData/classes/pkg/TestInnerLocalPkg.class differ diff --git a/testData/results/TestInnerLocal.dec b/testData/results/TestInnerLocal.dec index 3ba0724..f9129fe 100644 --- a/testData/results/TestInnerLocal.dec +++ b/testData/results/TestInnerLocal.dec @@ -9,6 +9,8 @@ public class TestInnerLocal { } new Inner("test");// 25 + new TestInnerLocal.Inner1Static("test");// 26 + new TestInnerLocal.Inner1Static.Inner2Static("test");// 27 } public void testMethod() { @@ -21,6 +23,9 @@ public class TestInnerLocal { } new Inner("test");// 37 + new TestInnerLocal.Inner1Static("test");// 38 + new TestInnerLocal.Inner1("test");// 39 + new TestInnerLocal.Inner1Static.Inner2Static("test");// 40 } static class Inner1Static { @@ -57,42 +62,52 @@ class 'TestInnerLocal$1Inner' { class 'TestInnerLocal' { method 'testStaticMethod ()V' { 4 10 + e 11 + 18 12 } method 'testMethod ()V' { - 5 22 + 5 24 + f 25 + 1a 26 + 24 27 } } class 'TestInnerLocal$2Inner' { method ' (LTestInnerLocal;Ljava/lang/String;)V' { - b 18 + b 20 } } class 'TestInnerLocal$Inner1Static' { method ' (Ljava/lang/String;)V' { - 6 29 + 6 34 } } class 'TestInnerLocal$Inner1Static$Inner2Static' { method ' (Ljava/lang/String;)V' { - 6 36 + 6 41 } } class 'TestInnerLocal$Inner1' { method ' (LTestInnerLocal;Ljava/lang/String;)V' { - b 45 + b 50 } } Lines mapping: 22 <-> 7 25 <-> 11 -34 <-> 19 -37 <-> 23 -46 <-> 46 -53 <-> 30 -59 <-> 37 +26 <-> 12 +27 <-> 13 +34 <-> 21 +37 <-> 25 +38 <-> 26 +39 <-> 27 +40 <-> 28 +46 <-> 51 +53 <-> 35 +59 <-> 42 diff --git a/testData/results/TestInnerLocalPkg.dec b/testData/results/TestInnerLocalPkg.dec new file mode 100644 index 0000000..5590d8a --- /dev/null +++ b/testData/results/TestInnerLocalPkg.dec @@ -0,0 +1,115 @@ +package pkg; + +public class TestInnerLocalPkg { + public static void testStaticMethod() { + class Inner { + final String x; + + public Inner(String var1) { + this.x = var1;// 24 + } + } + + new Inner("test");// 27 + new TestInnerLocalPkg.Inner1Static("test");// 28 + new TestInnerLocalPkg.Inner1Static.Inner2Static("test");// 29 + } + + public void testMethod() { + class Inner { + final String x; + + public Inner(String var2) { + this.x = var2;// 36 + } + } + + new Inner("test");// 39 + new TestInnerLocalPkg.Inner1Static("test");// 40 + new TestInnerLocalPkg.Inner1("test");// 41 + new TestInnerLocalPkg.Inner1Static.Inner2Static("test");// 42 + } + + static class Inner1Static { + final String x; + + public Inner1Static(String var1) { + this.x = var1;// 55 + } + + public static class Inner2Static { + final String x; + + public Inner2Static(String var1) { + this.x = var1;// 61 + } + } + } + + class Inner1 { + final String x; + + public Inner1(String var2) { + this.x = var2;// 48 + } + } +} + +class 'pkg/TestInnerLocalPkg$1Inner' { + method ' (Ljava/lang/String;)V' { + 6 8 + } +} + +class 'pkg/TestInnerLocalPkg' { + method 'testStaticMethod ()V' { + 4 12 + e 13 + 18 14 + } + + method 'testMethod ()V' { + 5 26 + f 27 + 1a 28 + 24 29 + } +} + +class 'pkg/TestInnerLocalPkg$2Inner' { + method ' (Lpkg/TestInnerLocalPkg;Ljava/lang/String;)V' { + b 22 + } +} + +class 'pkg/TestInnerLocalPkg$Inner1Static' { + method ' (Ljava/lang/String;)V' { + 6 36 + } +} + +class 'pkg/TestInnerLocalPkg$Inner1Static$Inner2Static' { + method ' (Ljava/lang/String;)V' { + 6 43 + } +} + +class 'pkg/TestInnerLocalPkg$Inner1' { + method ' (Lpkg/TestInnerLocalPkg;Ljava/lang/String;)V' { + b 52 + } +} + +Lines mapping: +24 <-> 9 +27 <-> 13 +28 <-> 14 +29 <-> 15 +36 <-> 23 +39 <-> 27 +40 <-> 28 +41 <-> 29 +42 <-> 30 +48 <-> 53 +55 <-> 37 +61 <-> 44 diff --git a/testData/src/pkg/TestInnerLocal.java b/testData/src/pkg/TestInnerLocal.java index 8eb8952..f0e9565 100644 --- a/testData/src/pkg/TestInnerLocal.java +++ b/testData/src/pkg/TestInnerLocal.java @@ -23,8 +23,8 @@ public class TestInnerLocal { } } new Inner("test"); - //new Inner1Static("test"); - //new Inner1Static.Inner2Static("test"); + new Inner1Static("test"); + new Inner1Static.Inner2Static("test"); } public void testMethod() { @@ -35,9 +35,9 @@ public class TestInnerLocal { } } new Inner("test"); - //new Inner1Static("test"); - //new Inner1("test"); - //new Inner1Static.Inner2Static("test"); + new Inner1Static("test"); + new Inner1("test"); + new Inner1Static.Inner2Static("test"); } class Inner1 { diff --git a/testData/src/pkg/TestInnerLocalPkg.java b/testData/src/pkg/TestInnerLocalPkg.java new file mode 100644 index 0000000..cc3b2b4 --- /dev/null +++ b/testData/src/pkg/TestInnerLocalPkg.java @@ -0,0 +1,65 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package pkg; + +public class TestInnerLocalPkg { + public static void testStaticMethod() { + class Inner { + final String x; + public Inner(String x) { + this.x = x; + } + } + new Inner("test"); + new Inner1Static("test"); + new Inner1Static.Inner2Static("test"); + } + + public void testMethod() { + class Inner { + final String x; + public Inner(String x) { + this.x = x; + } + } + new Inner("test"); + new Inner1Static("test"); + new Inner1("test"); + new Inner1Static.Inner2Static("test"); + } + + class Inner1 { + final String x; + public Inner1(String x) { + this.x = x; + } + } + + static class Inner1Static { + final String x; + public Inner1Static(String x) { + this.x = x; + } + + public static class Inner2Static { + final String x; + public Inner2Static(String x) { + this.x = x; + } + } + } +} \ No newline at end of file