fix constructor arguments for extended inner classes

This commit is contained in:
Alexandru-Constantin Bledea
2016-03-19 20:44:29 +02:00
parent 93a39b7b50
commit 0e514a6253
7 changed files with 56 additions and 2 deletions

View File

@@ -334,7 +334,7 @@ public class InvocationExprent extends Exprent {
boolean firstParameter = true;
int start = isEnum ? 2 : 0;
for (int i = start; i < lstParameters.size(); i++) {
if (sigFields == null) {
if (sigFields == null || null == sigFields.get(i)) {
if (!firstParameter) {
buf.append(", ");
}

View File

@@ -84,6 +84,7 @@ public class SingleClassesTest {
@Test public void testMethodReferenceLetterClass() { doTest("pkg/TestMethodReferenceLetterClass"); }
@Test public void testMemberAnnotations() { doTest("pkg/TestMemberAnnotations"); }
@Test public void testStaticNameClash() { doTest("pkg/TestStaticNameClash"); }
@Test public void testExtendingSubclass() { doTest("pkg/TestExtendingSubclass"); }
protected void doTest(String testFile, String... companionFiles) {
ConsoleDecompiler decompiler = fixture.getDecompiler();

Binary file not shown.

View File

@@ -0,0 +1,35 @@
package pkg;
public class TestExtendingSubclass {
class Subclass2 extends TestExtendingSubclass.Subclass1 {
Subclass2(String name) {
super(name);// 14
}// 15
}
class Subclass1 {
Subclass1(String name) {
}// 9
}
}
class 'pkg/TestExtendingSubclass$Subclass2' {
method '<init> (Lpkg/TestExtendingSubclass;Ljava/lang/String;)V' {
8 5
b 6
}
}
class 'pkg/TestExtendingSubclass$Subclass1' {
method '<init> (Lpkg/TestExtendingSubclass;Ljava/lang/String;)V' {
9 11
}
}
Lines mapping:
9 <-> 12
14 <-> 6
15 <-> 7
Not mapped:
8
13

View File

@@ -0,0 +1,18 @@
package pkg;
import java.math.BigDecimal;
public class TestExtendingSubclass {
class Subclass1 {
Subclass1(String name) {
}
}
class Subclass2 extends Subclass1 {
Subclass2(String name) {
super(name);
}
}
}