From d40f67368984b107a8e57d90e75e1f36d4ead6e9 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Wed, 26 Apr 2017 15:54:26 +0300 Subject: [PATCH] test for class extending a class with a private constructor --- .../java/decompiler/SingleClassesTest.java | 1 + testData/classes/pkg/TestInner2$1.class | Bin 0 -> 186 bytes testData/classes/pkg/TestInner2$Another.class | Bin 0 -> 454 bytes .../classes/pkg/TestInner2$Another2.class | Bin 0 -> 463 bytes .../pkg/TestInner2$AnotherStatic.class | Bin 0 -> 395 bytes .../pkg/TestInner2$AnotherStatic2.class | Bin 0 -> 400 bytes testData/classes/pkg/TestInner2.class | Bin 0 -> 862 bytes testData/results/TestInner2.dec | 89 ++++++++++++++++++ testData/src/pkg/TestInner2.java | 28 ++++++ 9 files changed, 118 insertions(+) create mode 100644 testData/classes/pkg/TestInner2$1.class create mode 100644 testData/classes/pkg/TestInner2$Another.class create mode 100644 testData/classes/pkg/TestInner2$Another2.class create mode 100644 testData/classes/pkg/TestInner2$AnotherStatic.class create mode 100644 testData/classes/pkg/TestInner2$AnotherStatic2.class create mode 100644 testData/classes/pkg/TestInner2.class create mode 100644 testData/results/TestInner2.dec create mode 100644 testData/src/pkg/TestInner2.java diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index fdaa6d0..0423ec6 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -66,6 +66,7 @@ public class SingleClassesTest { @Test public void testAnonymousClassConstructor() { doTest("pkg/TestAnonymousClassConstructor"); } @Test public void testInnerClassConstructor() { doTest("pkg/TestInnerClassConstructor"); } @Test public void testInnerClassConstructor11() { doTest("v11/TestInnerClassConstructor"); } + //@Test public void testInnerClassConstructor2() { doTest("pkg/TestInner2"); } //TODO: fix @Test public void testTryCatchFinally() { doTest("pkg/TestTryCatchFinally"); } @Test public void testAmbiguousCall() { doTest("pkg/TestAmbiguousCall"); } @Test public void testAmbiguousCallWithDebugInfo() { doTest("pkg/TestAmbiguousCallWithDebugInfo"); } diff --git a/testData/classes/pkg/TestInner2$1.class b/testData/classes/pkg/TestInner2$1.class new file mode 100644 index 0000000000000000000000000000000000000000..1f346fae15a7c3748f1454d8506261477cdfb621 GIT binary patch literal 186 zcmX^0Z`VEs1_l!bZgvKCb_PyH2Cm@z(xT*4x6GVWMh5LAAtM71SeJ87VsUY5F;E3aw|-7yUb?=2 yQdVkm2_pj^swM#i21W)Zpj$wI83-AGJQfC4AkD(S1|&Ivm>^C`Lj literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/TestInner2$Another.class b/testData/classes/pkg/TestInner2$Another.class new file mode 100644 index 0000000000000000000000000000000000000000..bd046056a6a6a6b2176b8b873930b37e72d256fe GIT binary patch literal 454 zcmZ8d!AiqG5PcJ4H%(&`Qyc5eLk?O&t$3>l5)g#o#nO9P7aNU9NmBpIg9sk{06$8c zjTK2)W@p~K*?BYj_5JY);2e8xY``_4qbIN<&?mIYMO^r&1SecRJ)BHrQQoAf%+JQm zUBqczUJ`l-P4aL`(1Yw=66`Qep<5>e284cd zDStFpYdQ5=e}sMhHJv|@97l<%h)uv?-{vTQ#s}yOkKRB-dWZJPP=m?0Sy2Z2Had*G f-%?nx8S$g4C2`haq+uIf_AW81BAadBt0%#O58y+I zvsI9IaA9Y@`R2zAyC0u#?*NAA`e-Beka*Z9xMNi+b46(PPv-<@Qr$~JoT*aYt)3TB z&%~l&C(Wu{6my}Kt$$3%ELBYiugl6TrJfpLR89zP%Tnq|A?jLk`#5`fdbpU$+HC#H zUIQNy{Asn)xx7(!QTz*@KZ>;o;NXC8^xq6Z)NFe=By{_K7Y|1EjY*U34RC@M|A{@s z*TD{Fm(`Gc>$qq13fi!0!Q<$2214c{bXW!76n0rzCfvpddz@3Q?R1~XlxrlNFaJAL Ao&W#< literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/TestInner2$AnotherStatic2.class b/testData/classes/pkg/TestInner2$AnotherStatic2.class new file mode 100644 index 0000000000000000000000000000000000000000..3e4547a712fa72ea02fb7ee8afa6ce75f3115d44 GIT binary patch literal 400 zcmaKo&q~8U5XQf0({7EiiSZ98h#q>V9+Vb6RRk#rh2W*7_ibG4YD~&z>w9?;Joo@U zlsH=ji3b;U=bLYS%Q0?CQxon;3FdDgQA5h2b7&%dVJA!$4 ztfaAfVDi@ej*(8cGbgCIoqy@LWmix-9o`0gec~Bwm5-CRuhpF@qlyKyeByM{()4O7 zS_9=@wtn}nbw47Nu4zzzX^cuuuq{}~&NH)^or!OUpOu})3NO3B%Lmai*1@?jY7vE4 zXg(tMz>S4juJ(w`V~+cBT!4AhMtOcb8PmK^w1}C_g;8@YE=ZbLiqH50se&H9X2@9M z9&-PYsbevbSxRJ%c~p*W>}LHDlC856SG?P?Q8#u>7rs%^; ()V' { + 4 4 + } + + method ' (I)V' { + 4 7 + } +} + +class 'pkg/TestInner2$AnotherStatic2' { + method ' ()V' { + 1 11 + 2 11 + 3 11 + 6 12 + } +} + +class 'pkg/TestInner2$Another2' { + method ' (Lpkg/TestInner2;)V' { + 6 17 + 7 17 + 8 17 + b 18 + } +} + +class 'pkg/TestInner2$AnotherStatic' { + method ' ()V' { + 1 23 + 2 23 + 5 24 + } +} + +class 'pkg/TestInner2$Another' { + method ' (Lpkg/TestInner2;)V' { + 6 29 + 7 29 + a 30 + } +} + +Lines mapping: +4 <-> 5 +5 <-> 8 +8 <-> 30 +9 <-> 31 +13 <-> 24 +14 <-> 25 +19 <-> 18 +20 <-> 19 +25 <-> 12 +26 <-> 13 +Not mapped: +18 diff --git a/testData/src/pkg/TestInner2.java b/testData/src/pkg/TestInner2.java new file mode 100644 index 0000000..da402b9 --- /dev/null +++ b/testData/src/pkg/TestInner2.java @@ -0,0 +1,28 @@ +package pkg; + +class TestInner2 { + private TestInner2() {} + private TestInner2(int a) {} + + class Another extends TestInner2 { + Another() { + } + } + + static class AnotherStatic extends TestInner2 { + AnotherStatic() { + } + } + + class Another2 extends TestInner2 { + Another2() { + super(2); + } + } + + static class AnotherStatic2 extends TestInner2 { + AnotherStatic2() { + super(2); + } + } +}