From af2d8b4d1c4fd32e7d4cec2d63d6ab445a8f7296 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 7 Dec 2017 15:13:06 +0100 Subject: [PATCH] [java decompiler] fixes constructor parameters naming --- .../java/decompiler/main/ClassWriter.java | 14 +- .../java/decompiler/SingleClassesTest.java | 1 + testData/classes/pkg/PrivateClasses$1$1.class | Bin 0 -> 832 bytes .../PrivateClasses$1$1CapturingLocalR1.class | Bin 0 -> 959 bytes ...rivateClasses$1$1NonCapturingLocalR1.class | Bin 0 -> 721 bytes testData/classes/pkg/PrivateClasses$1$2.class | Bin 0 -> 905 bytes testData/classes/pkg/PrivateClasses$1.class | Bin 0 -> 1441 bytes .../PrivateClasses$1CapturingLocalM1.class | Bin 0 -> 879 bytes .../PrivateClasses$1CapturingLocalM2.class | Bin 0 -> 964 bytes .../PrivateClasses$1NonCapturingLocalM1.class | Bin 0 -> 617 bytes .../PrivateClasses$1NonCapturingLocalM2.class | Bin 0 -> 726 bytes testData/classes/pkg/PrivateClasses$2$1.class | Bin 0 -> 832 bytes .../PrivateClasses$2$1CapturingLocalR1.class | Bin 0 -> 959 bytes ...rivateClasses$2$1NonCapturingLocalR2.class | Bin 0 -> 721 bytes testData/classes/pkg/PrivateClasses$2$2.class | Bin 0 -> 905 bytes testData/classes/pkg/PrivateClasses$2.class | Bin 0 -> 1532 bytes testData/classes/pkg/PrivateClasses$3.class | Bin 0 -> 722 bytes testData/classes/pkg/PrivateClasses$4.class | Bin 0 -> 777 bytes testData/classes/pkg/PrivateClasses$5.class | Bin 0 -> 813 bytes testData/classes/pkg/PrivateClasses$6.class | Bin 0 -> 886 bytes .../classes/pkg/PrivateClasses$Callable.class | Bin 0 -> 305 bytes testData/classes/pkg/PrivateClasses.class | Bin 0 -> 2058 bytes testData/classes/pkg/PrivateClasses.java | 205 ++++++++ testData/results/PrivateClasses.dec | 473 ++++++++++++++++++ testData/results/TestInnerSignature.dec | 2 +- 25 files changed, 685 insertions(+), 10 deletions(-) create mode 100644 testData/classes/pkg/PrivateClasses$1$1.class create mode 100644 testData/classes/pkg/PrivateClasses$1$1CapturingLocalR1.class create mode 100644 testData/classes/pkg/PrivateClasses$1$1NonCapturingLocalR1.class create mode 100644 testData/classes/pkg/PrivateClasses$1$2.class create mode 100644 testData/classes/pkg/PrivateClasses$1.class create mode 100644 testData/classes/pkg/PrivateClasses$1CapturingLocalM1.class create mode 100644 testData/classes/pkg/PrivateClasses$1CapturingLocalM2.class create mode 100644 testData/classes/pkg/PrivateClasses$1NonCapturingLocalM1.class create mode 100644 testData/classes/pkg/PrivateClasses$1NonCapturingLocalM2.class create mode 100644 testData/classes/pkg/PrivateClasses$2$1.class create mode 100644 testData/classes/pkg/PrivateClasses$2$1CapturingLocalR1.class create mode 100644 testData/classes/pkg/PrivateClasses$2$1NonCapturingLocalR2.class create mode 100644 testData/classes/pkg/PrivateClasses$2$2.class create mode 100644 testData/classes/pkg/PrivateClasses$2.class create mode 100644 testData/classes/pkg/PrivateClasses$3.class create mode 100644 testData/classes/pkg/PrivateClasses$4.class create mode 100644 testData/classes/pkg/PrivateClasses$5.class create mode 100644 testData/classes/pkg/PrivateClasses$6.class create mode 100644 testData/classes/pkg/PrivateClasses$Callable.class create mode 100644 testData/classes/pkg/PrivateClasses.class create mode 100644 testData/classes/pkg/PrivateClasses.java create mode 100644 testData/results/PrivateClasses.dec diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index 50bd994..105506a 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -696,14 +696,11 @@ public class ClassWriter { } } - boolean firstParameter = true; int index = isEnum && init ? 3 : thisVar ? 1 : 0; - boolean hasDescriptor = descriptor != null; - int start = isEnum && init && !hasDescriptor ? 2 : 0; - int params = hasDescriptor ? descriptor.parameterTypes.size() : md.params.length; - for (int i = start; i < params; i++) { - if (hasDescriptor || mask == null || mask.get(i) == null) { - if (!firstParameter) { + int start = isEnum && init ? 2 : 0; + for (int i = start; i < md.params.length; i++) { + if (mask == null || mask.get(i) == null) { + if (paramCount > 0) { buffer.append(", "); } @@ -717,7 +714,7 @@ public class ClassWriter { boolean isVarArg = i == lastVisibleParameterIndex && mt.hasModifier(CodeConstants.ACC_VARARGS); if (descriptor != null) { - GenericType parameterType = descriptor.parameterTypes.get(i); + GenericType parameterType = descriptor.parameterTypes.get(paramCount); isVarArg &= parameterType.arrayDim > 0; if (isVarArg) { parameterType = parameterType.decreaseArrayDim(); @@ -746,7 +743,6 @@ public class ClassWriter { String parameterName = methodWrapper.varproc.getVarName(new VarVersionPair(index, 0)); buffer.append(parameterName == null ? "param" + index : parameterName); // null iff decompiled with errors - firstParameter = false; paramCount++; } diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java index 8ab660f..9c971c3 100644 --- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java +++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java @@ -113,6 +113,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"); } private void doTest(String testFile, String... companionFiles) { ConsoleDecompiler decompiler = fixture.getDecompiler(); diff --git a/testData/classes/pkg/PrivateClasses$1$1.class b/testData/classes/pkg/PrivateClasses$1$1.class new file mode 100644 index 0000000000000000000000000000000000000000..d411e5b0cc6fc871710f25a32fc52d8193401c4e GIT binary patch literal 832 zcmZuvU2oGs5S&Y#I&lp(X&d?hv_OC~KtmO=knKY0I%_^0SEUy)NtQp^uWcIi)|N=1Qya$owQ%M zcr4(*H%7&SP$r2=1X{zdpQpXUSf9&O71{RQJ~0Q{=(I1e-YGBHITmmR(TNgR8fv3H z&c2LQd?d#qGtFT%k>Rn7wLKR}$I1{`E9J|YIs}CRE1jL;nLL-hP?~9Pl*ZajDd}eV z)A&qHQl=XtJvB0&#q3)jkRX>Zn4>6a%Nkz+4(7^>j(w7Qqi7aS)H`jbTE4lbU8|AP zzcrIEN~rOJN>8H`A8kDG;llH=Xrm^Ux#+SzxAz2s>q&E&E}jZ(mXu#ffaqSJ@|~v&ZqpJ)+r<)X zE3ZO;J3O&IV-u|4um#r(dW)!tZ`RInyv#UkPn*v;f;U926v$qItaX2)`Y$*akb`T5 k00*lX)m^M*ejOY14(ixMgV6@ZtkZ+m$-EusAzBOGU%&aQu>b%7 literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$1$1CapturingLocalR1.class b/testData/classes/pkg/PrivateClasses$1$1CapturingLocalR1.class new file mode 100644 index 0000000000000000000000000000000000000000..1a6052135c1d8418178c111f43caa5ebb21035b5 GIT binary patch literal 959 zcmZuvYi|-!5Iq-`XV(@fwmuNiV!LchDO&xY#t#xrN$?RdP4wFZZs@J+F49dZk(0`u_&(vxl_9OLyRS0jYYe!V_<3qJ;-0uA*dO4Fwa|xV(Z@fz8XV zznExesC*L-aY+Br6FxjLaR*g_?PZq7HzQmA-TJnFssyd(G6@l-OVRvP7t2iD%2xG zDKg&?br@4QN9yAl()M>G=ExMY6zFWsk((p`HJW7RbcEiD7|n~x1!EF-Bh)=?Q8sAb R8fgRN1U>xAk{7@&;18ez&cFZw literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$1$1NonCapturingLocalR1.class b/testData/classes/pkg/PrivateClasses$1$1NonCapturingLocalR1.class new file mode 100644 index 0000000000000000000000000000000000000000..fda112fc06e9db73abb4a488fa1bdfc263516240 GIT binary patch literal 721 zcmZuu+fKqj5IsYy2v(^D@vdli05l?rZyH~SCMI}^7v2}xK(%g7Tl_9fG$uay0e+Nm zwvZTOUv_5Bo|$uY=j;396Tm*UGBB~6#ROJ#wwlIT8tViK2~O)yJc+s|RKI>51+MBJ z5GJF68)i%Lw z`aMa=wOl37hYuYY+=!0Hh|}`B!fT7b)%6%OwJ}2e+*eKU7!9@Gn0M7+;Y8hXBZ16* zry_s!UP7T#{cnztz4nJeSDv`qPX6zcclEEa?PJyT{E%Io$!OsBER?WmVG7e0ES*gv zO{gY)S)wn3{kx8f&YkQ=Y%i&uU<5<{9 literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$1$2.class b/testData/classes/pkg/PrivateClasses$1$2.class new file mode 100644 index 0000000000000000000000000000000000000000..fce570397bad637f30874ca16810a05753fd5686 GIT binary patch literal 905 zcmZuv+iuf96r6ROxN%Km(h_>%QoumsAVR9XQB|rekdVSf3hMhNwNe*jBiqS$QKFI+LN3 z3N#02awdDBj3&KdmITq{wLmR94N~Wof#(9&yD0J#FO+HO6W`Zv)yj8mHb-p@|s6ANv0ESR`uVFh&yYifB1E&5+(zq2P` z|G&q1uLfL!of7y}zqF%dw=YmhrV+=sx}WAU1iO4oH3%5cY+E%5FtS^|ybAv{G`MSX z=0VFd4Yzv<;l8+p=Ke(GoLd@hb5t@wA5D%e=0NH?HW<}RNeX^Ec_G-#*Fe?1fcBlB zMVb9v#v+7(xr}{8^4%r!59l|^^B%5|p<^>Iv5lQP-ot%H9jkZ%i?eMWZj})TT|0O6#lj;NlAm$f*>Mz_vmar+|iG-&NO3}6rw_xebrqN_b74(MJ za!tEla;mzur!fqb9Xo6lH%!~~HW`FW_JAQ?aB2p_V9B(Na_i%f;l9(4EV88iJO{dK za=mMed&eeiHd1PQsOR3g=Be%(T?$j$I^}d*HUp!Obm>Gt)pM3^*K_+G=SA*VRg>_H zAyLpRE7)ctD%H8$hvfNw{7e^IJ~htyX#YcRgeh!NMtR?9xm9Dw}1 zdl}|3QPtDd!)4=*n(&;UkBDj}8;)U^za(EV9Ly7rT@vp971VB4??%D-se?ql(J<^9 z!$Kw^b;#5$0tZ@#UH6Xtf3Juo4Ac8S<)p_VMuQrRw41cb(M-LDKJ^Ujv+tfDDf-3) zCTXn%0l0pMx z-Z!S|pyuF~fY3Zmfw{2^Dno%%>rjqmJ&<9)-cDj2_8$mjAL>vij|9qob2eYy7qA;q zPYD!SI#e%4M;#TvmYsl+QY-4pU|+`C+^0c1Ind-PHsl}~8IH7QZ&$!;hM|fZfgBDM zD>hq$xBdF7SdV3*rqRmo*)~p?Z|i<2`4}l}ziCFwCDG{u0!w~%c5DH+9gX6ydaBK! zi+{507#XWdKf9ul!SapG%E3T|J%R1NmCbZcho`V> z6!V{HT;(U5=g-TaWMlw}MI%fa;ruwCW`O7P7NdpQ)-gow1ex0EF|5yN;Ueuqntq2o z-V=Yo5@TgHu?5SxKyQ$t5V%O3!6hP!Nn7Im86$#z{Tu8zCzz{!ftVm$a%hOH333zU mKc$_9FPm0>OnJQ1&MA+D%W2g*uF%_D@fuc$TvoaCW#AVQSiqwI literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$1CapturingLocalM2.class b/testData/classes/pkg/PrivateClasses$1CapturingLocalM2.class new file mode 100644 index 0000000000000000000000000000000000000000..cdd4c714ff84459e512d48b74e3b22dfa3b49446 GIT binary patch literal 964 zcmZ`%+iuf95IyTS*P1q@DdiGMfzUcGY1(p=0P#RXMWhsvf-1q=CRwFhTsyLzd{>J| zDuKiY@KJ~vHxi-_51unSJC`$O{pu03VLc^GtuRLmDpzKXrVV=&-Fv1c%Y&qzn{g9gj ztoQ4YcKa%@=uMx{+dOCIsf9J%5vV5RPp(EH{q6a_d#rj9X_~AQFiuFm6+5{nYmu_q zX5?_FyuLtvURt7ZMxNBIkfQ&+#yb6-7X7y=lvoC!SY%;hB$epK0O^Y|;R>BT6Pko& zXKMoC)F&{UbEKTg1m;en3Ae zI-^2_E!w>M@y@yT+Y-NQeal$q7xM6$qAr8=urz;1@a zsH4ukL|f^1)q`Yk&TtlV{4l1ZOQn0^orMhto5(t_u;n0)jKJPMH3<}dwt3y|tB&SM zX2}A^fTO1>)fRSm5tA1pFlk25pl>0|H^=Clu|aFs-XLoGuP~m+7@KdNTtJgQBzA;3 zM#~d4926LlH?GQKqlkrRO_x^iFI{_q@kGZU3~ZhxAID{!31C_#MR5tLge6)NWwy!F Kvx!P1%md$u(1RBM literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$1NonCapturingLocalM2.class b/testData/classes/pkg/PrivateClasses$1NonCapturingLocalM2.class new file mode 100644 index 0000000000000000000000000000000000000000..9d4041f6bafdd8606748e556675e57c6ab8c27e4 GIT binary patch literal 726 zcmZvZ+e*Vg5QhIv(xcJF*7NxUwpFZ(cZxSfL1+CN&7y;Drz1 zLy5C%K_m@qW_EVw-*0BWzCS(z9AG^K19NG_FfYA@1QrumVqgJ7w$kB!UUInGDqV%X z?Y0gX;$hnkHg*{%D&5;w>C(6RJQQVz2Z0FW`H}6~;W0xYKP(|CS*S4>Wv?k1G8Nku z=e@hS@UMB@p-8skHMmpbzAg8Ipdk?$a_62~=H0L-$y8o-pTRtHUEvRSh++uD#@>)h zLQjU?Z=2Lyz7Qp4NMCt9zadU-$(H-y`;HtI^>E@g94{cGstDU&Gl69jD_Av=M9M@O zYbN4IFlekRfsTWt22ip1e#W z@f;=wSCq)gvsm#J`ZGBiq;OmXpOm2an=la6F{!eqFiqCL3}!J-UYfEDvKH_Ihx?xu literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$2$1.class b/testData/classes/pkg/PrivateClasses$2$1.class new file mode 100644 index 0000000000000000000000000000000000000000..8caf4acd08a076f2f71ccfb8b2b60cab9ca853f3 GIT binary patch literal 832 zcmZuv+iuf95IvhXb>bT8rX}>krGSAnAfi;fQAI)#NJ!x#1@#eWldjTj%^KNGzY87! zi3dJ_k3yWaU6F!qd1iM!=ggVe{q_6DPXJHxumuM>mj@qxe_}tc|r% zZx$b?DtRxb5hLw!Jd@FpOtjsXLC4Av*sA0U2Q2Ck6bWp0_s6I5T=pYr=KV>QXfx;E z%i*`vQ#H#NZcX&u$ZV0YZgWI}Lc(Z?qRg!-d;vIIN-rx8N$ySJMKV(_we4!-@|>Pn zjqLt~nMH9*jjvU95+C~rao>jv&&R4=wXwlLSIs#b2n2sSEo8cQAh27Jej$~UsQ7yz zP)`amdf!p|!d(qlX^Eo! zfHm4qk%a*3+%Z3A6U<<Qgu)-G|#oWs_%@th-gPUL2Z?3c(!?;Gm>f(ro! nxKRpla4o00j;-8pV~5^B6T4_}wZk@>^!9NI$9C?Zv*P^$Bs;82 literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$2$1CapturingLocalR1.class b/testData/classes/pkg/PrivateClasses$2$1CapturingLocalR1.class new file mode 100644 index 0000000000000000000000000000000000000000..c347c665da31bc7e588f883232001b2cfbde376c GIT binary patch literal 959 zcmZuvYi|-!5IuKUo?Tm{*!sYVitVy3MQZhf8b3%hlHjYD8vS;G8+z-yOO}P-rHRl) z6Muj|$~d!Nj9oU_IWu!-?wmQhzkYxJ3E&V9vRJ_#HrqK^*kR93qnbk!J8YZ`b{Y5B z)Y8~bqb?vcy)A*{M7oucK%spqC$jEJZ&2@qf%XQE1XAIN9#tA?+!e4|o~MGQD@P+m z^&9Qsr$PNqpeHg^i)`h9dmd{~hff6d?Byk`_@wHwfZ6o>N?@(6J@sn*xvPSAvg=Z& z(Dr-MJ(hvyc#$-jnLxfNhvAsnMny*rf#p*xjq{a6HQUhxPf|ZkG3^$!$b|lUdx4@| zjWZR zN|xunpbXb+{Xp`=8B)$S7&D{`88YOXGh}DTeTh1Gaw@8RA5FC8or{SH+>EMj;WnX3 R`&Nh>2n~AY&kDgc;14P(&yD~9 literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$2$1NonCapturingLocalR2.class b/testData/classes/pkg/PrivateClasses$2$1NonCapturingLocalR2.class new file mode 100644 index 0000000000000000000000000000000000000000..f14b68136e42a3cc0386a61649f919f6e5a89015 GIT binary patch literal 721 zcmZuu+fKqj5IsYy2v)(Oc)x}RE=D5pP2&qo!s9m@90-!+YQxmy?|Yu$?)F0v#^0p3lo^MVCife zNkS>^$zpvGvcKcFXg|nK$oAsO35MTOycSC>7BzXeKmxW_1hQG}Awqb9m;zy%cel(i zIA+R~0jT_rM0tAv<252?c%6=pkB~xx^J8Qg+ZdK$207kwanzckOp7JB`7Gu}5><}+ uY^?kS@4GE)$2J#VW9t#{zmR>}fGn*?@9Q9}NZv#K|x0u=h literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$2$2.class b/testData/classes/pkg/PrivateClasses$2$2.class new file mode 100644 index 0000000000000000000000000000000000000000..2c594e0579ef154c06cc00e1452c25cdacd994a2 GIT binary patch literal 905 zcmZuv+iuf95IyTSapRiCO-m>(mjVV72N6;6MpX$}AR&c|l&bGex=P#{8`)023nU5> z4}1V0g*a=wB5iETJF~NA&YYR`pTEC;19*vk6Ls8I%f5*Q9+>nV8hB*DG4Mp7zVJgQ z6=)C7{DnUV{b)KEWl0cCUkNm_S&%v}3_KOE-bIm2ywFcmNqlGc<$OB$lmrVulV#L7 zP&tP|6l6yN{cbg6wNURwK=*0^%Gdanqy*Ub|k)O>I)?M>RP)P8WC`xQq;md@>C3rc?Ba)k= zc%Dq;+dy@-b#-#j)$rN_*L({^B+TKKm^RF7eb0A>< zzsEwW0aswJ0)DBNwfysH{5H_ysZGy= zmPcA{{{q5&b^*=(iP|?FY1rhdXaI>e*A8P~>K3+Xm8U2LUv^#+4)Q%vcfUjXO3*UR zET^#uA)uhKUo-jEO7air*OLnkSCXM)Coi#!z1-fxU0NOMxCe{gE}L7YRZqPz9Li(d HZkYc7;E=xK literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$2.class b/testData/classes/pkg/PrivateClasses$2.class new file mode 100644 index 0000000000000000000000000000000000000000..b4dd294217c6c8812adae6288bba9a94b8581ec1 GIT binary patch literal 1532 zcmaJ>ZBNrs6n^eD)=?^q0YgN59k>@@tfHXIp-j-}7zhSjG$v(hMzOR@*OBx%bDfuipSHVz(b-xGN%x#SrcZxGy4rB~F$FJP;w^ zAt%JFh!Bw#@JNJ&B>_1RgIF9u0;>WZbLI&r%OZxcCLk~1sep9`sbCnYmDiOl~9?3hrt(esEt*3VF7{%4)-g^(kU z;;z}WD(Z&Da~(Nfxp@wnYO-!rbhAOAH&y%4tO|H0VG>s*OktV<42j;V$K+VXqgUMK zxr721M_4bZWR>(HpVIrvUM6V9R>;?V` zy~^C-#0Bck1)&?LcL#Fwr!fjD^}1?Q8Rp_1u6vF;P2h&QYSipQ=du)VgI<^@4b(VT zILv2^9v&a9DO{t|>$J-e&rif;>N8mK6uwW6&JChL(gCu#Ni^ze;TCQaNBWL8x{Zio zy5s97`sncj$`OCDjX*h>Iz?X#!TmObax%=>Pz(LUie-v4u-S&>C|xSGF<3su(Cin4 z8NOqU?mc(r>-*yqz!A1g=vXq5z_NiA1FHts7*bW~%J76CQ7ShX^qSWZ z40CnqimQIFCH!07atO)Ry*786+?OhkK|Q>a0fTkny27tHJO~7(#rng&UAgh)BM(K4 zZXX^~ajM`jA~!r##YAoVjhs3&`W82=Ba(fprTT*tC#>VPO_? zWPQ@W44KiCkwu1;3Cy8KdgTAN3|jAip-}oiK)H#1`b`}SN&4XgEwV(}6rCy*8O7wz zJJ>57G^7Uv1wO%~-HHg9#tdaljY7K;?^0AejlHOSO!+*f)FNf(l$4oRIcoa`?XP%J hTOIR*7CGbxv4A2)9Sc|_gFu$rtI0sdl7wbc<`1IcmA3!@ literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$4.class b/testData/classes/pkg/PrivateClasses$4.class new file mode 100644 index 0000000000000000000000000000000000000000..f70861c9ddfdc655accad2a61b596cef12be94d5 GIT binary patch literal 777 zcmZuv+fLg+6r6SJIB^Y_aBIu8B}hpskyhdjgj7YXR4FY;L3!VVRakIrJ-93N<>=j{R!-0iOhu)TrZ5ul_-UwJD>6Zrr zrRJp^$+|CtUcD7ZI_Mn={-8f-Ap)5x?)YiH3u0gf`|={Anp+-ZfwsH;BfWW=TaCGRKu<0?J{ zT|XRfe_vI65uV$4>tYv<3mXL&MU-7EqD1|(rWWx2UBg7D!1|2JC!yT*^j`s^|3M&E zskZT+_ice!3E_E(20n-!zakuFUyPrJ0fW}5z54}G`vc=ABLgl^qIlk5j;A~J9n8aH zB$6r84t3h3&Z^x){GgKsf6sue3E2Bc@X{3cH*(LxS>_bXd6vf%t5_S`mv}{M;x*Q> RK(9o4lNOvc&+JOxc?4Vyp>6;G literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$5.class b/testData/classes/pkg/PrivateClasses$5.class new file mode 100644 index 0000000000000000000000000000000000000000..70e8e636c93f2b3d9d1849a3e4c849016e49d35f GIT binary patch literal 813 zcmZuvT~FIU5S(+Im>9R10HH1Ype3LrRHUlPQ&FTUYNbl)hm*H5oic1Zc2UF=m#e1^o;lcb@LZsj9_gg^ zN?^5nb~0*xjrF-qRVR>1qLR1FALvl0ZGrXryn;qw!0tqcN?@t0L-l!lI#BU9IS3f3 zbfcjR`ZCsLp9gKzP{8{bhAPhc2vp~g*Y?@pCPP4V^+xwtp37Ds!%?f3#yT7^dpG=L zaIA(Y!{weHg)$w-6tU1DL8hlOMUmIeYkLDYm@3aZwn^^xqH#P_AGA5*%H4tO8I2sp z`*0XU2{nFF=}~m(;Dv`R)I2y?@KDCKhhh+N5$tsGfw{zTz_a3&xF k7jpqNRwpg0SfBU@ct~&K5jL>IRfX+sdh?VRT`Rf&0DK&(%K!iX literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses$6.class b/testData/classes/pkg/PrivateClasses$6.class new file mode 100644 index 0000000000000000000000000000000000000000..cfe976478dd97b73a0cc05960e486dd9920b480a GIT binary patch literal 886 zcmZuvZEMp|6n<`+HfxMFc3XX!FH@r?QLKpUi(?=`L8v;Y^!sfWy38z*B<=4~a0-6# zlOXt`#OJ0Nc1v@~J?Ea6=RD`!`{(bEp8%f2Z=;FZYTGu^!X1;^T?6+FI0o(uH0LsQ za)IvPNX}(HmdUg~EV3w>z7S{?hf(f471$Vj`Z(?HXVF|1VGzqa4|C<;jgqL?6Y$(s z0d+`kB%lZBK`77}L`nE=c03NV4{{vS(jBA|8INQZsdHu26$Jt7O_GFJRav07qMWls zMmiB<@^!s>@$=^Qd-FhqP<{GXy!ZsgJ3jzi-+g98FN)qLBYw)*lk={$x z0%)bB<3Boq@E@N*^S`6y%1Ukb;X%SAhNU3^e_(&^|M0 z8RmBhV=;sQ3mE$)lY6z~Z_v*tFF2e@hK?&`iEFrC$}QZW)NvEH(52R8`6i|M3|gDMHU3uJ)o3o)Ssqt#^AF=2Jp#8%K%AFB?l1^gb7#S% zJUcH-1bcftr=eWLiv8V98W$p$z7km`v(fXMg*KsoIz--YbKr9-v3uI8U)WeCiA+C! qg7Y7k&?&Dn0fNR)bJYnI=*$gf8cb$yWTE;}YG`t`d4j{EVcHMMK}!(; literal 0 HcmV?d00001 diff --git a/testData/classes/pkg/PrivateClasses.class b/testData/classes/pkg/PrivateClasses.class new file mode 100644 index 0000000000000000000000000000000000000000..e1e93a09c29e13af551874d8a4731b3fb4c1de1d GIT binary patch literal 2058 zcma)7ZBrXn6n<_3*|1rJ2AT?`6@l82lw#gZ8XppD46=Xgf(5^EwSco*FHnz%cw6bG9GUpxBt%zoM=bdAt6MPLK|Lt2T_f(7L^~W7XOUr^9v!1;#XGBTC4t z+hn`pCyp?(v*B7|S!T;&wRg98rJdt$J{}fe!fZAzcUxgD>c)g32InS@j^)K!Jg43PTgt`{Sqh9g|^v4vO1ijG|+`k zDOKHrQR!h&EM8jfVTg+1{I58n@C@lLMlKwhcQM+<$xT5M_t19!y=A%ahl?U@Hj&rXFa1=Rsu$cSaSaW4O-nz { + T call(); + } + + private static final Runnable R1 = new Runnable() { + @Override + public void run() { + String s = ""; + + class NonCapturingLocalR1 { + private final String s; + + public NonCapturingLocalR1(String s) { + this.s = s; + } + + @Override + public String toString() { + return this.s; + } + } + + class CapturingLocalR1 { + private final int i; + + public CapturingLocalR1(int i) { + this.i = i; + } + + @Override + public String toString() { + return s + ":" + i; + } + } + + new NonCapturingLocalR1(s).toString(); + new CapturingLocalR1(42).toString(); + + Callable c1 = new Callable() { + @Override + public String call() { + return null; + } + }; + + Callable c2 = new Callable() { + @Override + public String call() { + return s; + } + }; + + (c1.call() + c2.call()).length(); + } + }; + + private final Runnable R2 = new Runnable() { + @Override + public void run() { + String s = ""; + + class NonCapturingLocalR2 { + private final String s; + + public NonCapturingLocalR2(String s) { + this.s = s; + } + + @Override + public String toString() { + return this.s; + } + } + + class CapturingLocalR1 { + private final int i; + + public CapturingLocalR1(int i) { + this.i = i; + } + + @Override + public String toString() { + return s + ":" + i; + } + } + + new NonCapturingLocalR2(s).toString(); + new CapturingLocalR1(42).toString(); + + Callable c1 = new Callable() { + @Override + public String call() { + return null; + } + }; + + Callable c2 = new Callable() { + @Override + public String call() { + return s; + } + }; + + (c1.call() + c2.call()).length(); + } + }; + + public static void m1(String s) { + class NonCapturingLocalM1 { + private final String s; + + public NonCapturingLocalM1(String s) { + this.s = s; + } + + @Override + public String toString() { + return this.s; + } + } + + class CapturingLocalM1 { + private final int i; + + public CapturingLocalM1(int i) { + this.i = i; + } + + @Override + public String toString() { + return s + ":" + i; + } + } + + new NonCapturingLocalM1(s).toString(); + new CapturingLocalM1(42).toString(); + + Callable c1 = new Callable() { + @Override + public String call() { + return null; + } + }; + + Callable c2 = new Callable() { + @Override + public String call() { + return s; + } + }; + + (c1.call() + c2.call()).length(); + } + + public void m2(String s) { + class NonCapturingLocalM2 { + private final String s; + + public NonCapturingLocalM2(String s) { + this.s = s; + } + + @Override + public String toString() { + return this.s; + } + } + + class CapturingLocalM2 { + private final int i; + + public CapturingLocalM2(int i) { + this.i = i; + } + + @Override + public String toString() { + return s + ":" + i; + } + } + + new NonCapturingLocalM2(s).toString(); + new CapturingLocalM2(42).toString(); + + Callable c1 = new Callable() { + @Override + public String call() { + return null; + } + }; + + Callable c2 = new Callable() { + @Override + public String call() { + return s; + } + }; + + (c1.call() + c2.call()).length(); + } +} \ No newline at end of file diff --git a/testData/results/PrivateClasses.dec b/testData/results/PrivateClasses.dec new file mode 100644 index 0000000..aa812da --- /dev/null +++ b/testData/results/PrivateClasses.dec @@ -0,0 +1,473 @@ +package pkg; + +class PrivateClasses { + private static final Runnable R1 = new Runnable() { + public void run() { + final String s = "";// 11 + + class NonCapturingLocalR1 { + private final String s; + + public NonCapturingLocalR1(String s) { + this.s = s;// 17 + }// 18 + + public String toString() { + return this.s;// 22 + } + } + + (new NonCapturingLocalR1(s)).toString();// 39 + + class CapturingLocalR1 { + private final int i; + + public CapturingLocalR1(int i) { + this.i = i;// 30 + }// 31 + + public String toString() { + return s + ":" + this.i;// 35 + } + } + + (new CapturingLocalR1(42)).toString();// 40 + PrivateClasses.Callable c1 = new PrivateClasses.Callable() { + public String call() { + return null;// 45 + } + };// 42 + PrivateClasses.Callable c2 = new PrivateClasses.Callable() { + public String call() { + return s;// 52 + } + };// 49 + ((String)c1.call() + (String)c2.call()).length();// 56 + }// 57 + }; + private final Runnable R2 = new Runnable() { + public void run() { + final String s = "";// 63 + + class NonCapturingLocalR2 { + private final String s; + + public NonCapturingLocalR2(String s) { + this.s = s;// 69 + }// 70 + + public String toString() { + return this.s;// 74 + } + } + + (new NonCapturingLocalR2(s)).toString();// 91 + + class CapturingLocalR1 { + private final int i; + + public CapturingLocalR1(int i) { + this.i = i;// 82 + }// 83 + + public String toString() { + return s + ":" + this.i;// 87 + } + } + + (new CapturingLocalR1(42)).toString();// 92 + PrivateClasses.Callable c1 = new PrivateClasses.Callable() { + public String call() { + return null;// 97 + } + };// 94 + PrivateClasses.Callable c2 = new PrivateClasses.Callable() { + public String call() { + return s;// 104 + } + };// 101 + ((String)c1.call() + (String)c2.call()).length();// 108 + }// 109 + }; + + public static void m1(final String s) { + class NonCapturingLocalM1 { + private final String s; + + public NonCapturingLocalM1(String s) { + this.s = s;// 117 + }// 118 + + public String toString() { + return this.s;// 122 + } + } + + (new NonCapturingLocalM1(s)).toString();// 139 + + class CapturingLocalM1 { + private final int i; + + public CapturingLocalM1(int i) { + this.i = i;// 130 + }// 131 + + public String toString() { + return s + ":" + this.i;// 135 + } + } + + (new CapturingLocalM1(42)).toString();// 140 + PrivateClasses.Callable c1 = new PrivateClasses.Callable() { + public String call() { + return null;// 145 + } + };// 142 + PrivateClasses.Callable c2 = new PrivateClasses.Callable() { + public String call() { + return s;// 152 + } + };// 149 + ((String)c1.call() + (String)c2.call()).length();// 156 + }// 157 + + public void m2(final String s) { + class NonCapturingLocalM2 { + private final String s; + + public NonCapturingLocalM2(String s) { + this.s = s;// 164 + }// 165 + + public String toString() { + return this.s;// 169 + } + } + + (new NonCapturingLocalM2(s)).toString();// 186 + + class CapturingLocalM2 { + private final int i; + + public CapturingLocalM2(int i) { + this.i = i;// 177 + }// 178 + + public String toString() { + return s + ":" + this.i;// 182 + } + } + + (new CapturingLocalM2(42)).toString();// 187 + PrivateClasses.Callable c1 = new PrivateClasses.Callable() { + public String call() { + return null;// 192 + } + };// 189 + PrivateClasses.Callable c2 = new PrivateClasses.Callable() { + public String call() { + return s;// 199 + } + };// 196 + ((String)c1.call() + (String)c2.call()).length();// 203 + }// 204 + + private interface Callable { + T call(); + } +} + +class 'pkg/PrivateClasses$1$1NonCapturingLocalR1' { + method ' (Lpkg/PrivateClasses$1;Ljava/lang/String;)V' { + b 11 + e 12 + } + + method 'toString ()Ljava/lang/String;' { + 1 15 + 4 15 + } +} + +class 'pkg/PrivateClasses$1$1CapturingLocalR1' { + method ' (Lpkg/PrivateClasses$1;ILjava/lang/String;)V' { + 10 25 + 13 26 + } + + method 'toString ()Ljava/lang/String;' { + e 29 + 14 29 + 1a 29 + 1d 29 + } +} + +class 'pkg/PrivateClasses$1$1' { + method 'call ()Ljava/lang/String;' { + 0 36 + 1 36 + } +} + +class 'pkg/PrivateClasses$1$2' { + method 'call ()Ljava/lang/String;' { + 4 41 + } +} + +class 'pkg/PrivateClasses$1' { + method 'run ()V' { + 0 5 + 2 5 + c 19 + 15 33 + 1b 33 + 27 38 + 31 43 + 3a 44 + 3f 44 + 46 44 + 4b 44 + 51 44 + 54 44 + 58 45 + } +} + +class 'pkg/PrivateClasses$2$1NonCapturingLocalR2' { + method ' (Lpkg/PrivateClasses$2;Ljava/lang/String;)V' { + b 55 + e 56 + } + + method 'toString ()Ljava/lang/String;' { + 1 59 + 4 59 + } +} + +class 'pkg/PrivateClasses$2$1CapturingLocalR1' { + method ' (Lpkg/PrivateClasses$2;ILjava/lang/String;)V' { + 10 69 + 13 70 + } + + method 'toString ()Ljava/lang/String;' { + e 73 + 14 73 + 1a 73 + 1d 73 + } +} + +class 'pkg/PrivateClasses$2$1' { + method 'call ()Ljava/lang/String;' { + 0 80 + 1 80 + } +} + +class 'pkg/PrivateClasses$2$2' { + method 'call ()Ljava/lang/String;' { + 4 85 + } +} + +class 'pkg/PrivateClasses$2' { + method 'run ()V' { + 0 49 + 2 49 + c 63 + 15 77 + 1b 77 + 27 82 + 31 87 + 3a 88 + 3f 88 + 46 88 + 4b 88 + 51 88 + 54 88 + 58 89 + } +} + +class 'pkg/PrivateClasses$1NonCapturingLocalM1' { + method ' (Ljava/lang/String;)V' { + 6 97 + 9 98 + } + + method 'toString ()Ljava/lang/String;' { + 1 101 + 4 101 + } +} + +class 'pkg/PrivateClasses$1CapturingLocalM1' { + method ' (ILjava/lang/String;)V' { + b 111 + e 112 + } + + method 'toString ()Ljava/lang/String;' { + e 115 + 14 115 + 1a 115 + 1d 115 + } +} + +class 'pkg/PrivateClasses$3' { + method 'call ()Ljava/lang/String;' { + 0 122 + 1 122 + } +} + +class 'pkg/PrivateClasses$4' { + method 'call ()Ljava/lang/String;' { + 4 127 + } +} + +class 'pkg/PrivateClasses' { + method 'm1 (Ljava/lang/String;)V' { + 8 105 + 10 119 + 16 119 + 21 124 + 2a 129 + 33 130 + 38 130 + 3f 130 + 44 130 + 4a 130 + 4d 130 + 51 131 + } + + method 'm2 (Ljava/lang/String;)V' { + 9 146 + 12 160 + 18 160 + 24 165 + 2e 170 + 37 171 + 3c 171 + 43 171 + 48 171 + 4e 171 + 51 171 + 55 172 + } +} + +class 'pkg/PrivateClasses$1NonCapturingLocalM2' { + method ' (Lpkg/PrivateClasses;Ljava/lang/String;)V' { + b 138 + e 139 + } + + method 'toString ()Ljava/lang/String;' { + 1 142 + 4 142 + } +} + +class 'pkg/PrivateClasses$1CapturingLocalM2' { + method ' (Lpkg/PrivateClasses;ILjava/lang/String;)V' { + 10 152 + 13 153 + } + + method 'toString ()Ljava/lang/String;' { + e 156 + 14 156 + 1a 156 + 1d 156 + } +} + +class 'pkg/PrivateClasses$5' { + method 'call ()Ljava/lang/String;' { + 0 163 + 1 163 + } +} + +class 'pkg/PrivateClasses$6' { + method 'call ()Ljava/lang/String;' { + 4 168 + } +} + +Lines mapping: +11 <-> 6 +17 <-> 12 +18 <-> 13 +22 <-> 16 +30 <-> 26 +31 <-> 27 +35 <-> 30 +39 <-> 20 +40 <-> 34 +42 <-> 39 +45 <-> 37 +49 <-> 44 +52 <-> 42 +56 <-> 45 +57 <-> 46 +63 <-> 50 +69 <-> 56 +70 <-> 57 +74 <-> 60 +82 <-> 70 +83 <-> 71 +87 <-> 74 +91 <-> 64 +92 <-> 78 +94 <-> 83 +97 <-> 81 +101 <-> 88 +104 <-> 86 +108 <-> 89 +109 <-> 90 +117 <-> 98 +118 <-> 99 +122 <-> 102 +130 <-> 112 +131 <-> 113 +135 <-> 116 +139 <-> 106 +140 <-> 120 +142 <-> 125 +145 <-> 123 +149 <-> 130 +152 <-> 128 +156 <-> 131 +157 <-> 132 +164 <-> 139 +165 <-> 140 +169 <-> 143 +177 <-> 153 +178 <-> 154 +182 <-> 157 +186 <-> 147 +187 <-> 161 +189 <-> 166 +192 <-> 164 +196 <-> 171 +199 <-> 169 +203 <-> 172 +204 <-> 173 +Not mapped: +16 +29 +68 +81 +116 +129 +163 +176 diff --git a/testData/results/TestInnerSignature.dec b/testData/results/TestInnerSignature.dec index 3087a40..bb18d0d 100644 --- a/testData/results/TestInnerSignature.dec +++ b/testData/results/TestInnerSignature.dec @@ -26,7 +26,7 @@ public class TestInnerSignature { B b; C c; - public Inner(A var1, B var2, C var3) { + public Inner(A var2, B var3, C var4) { this.a = var2;// 34 this.b = var3;// 35 this.c = var4;// 36