fixed synthetic params
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||||
|
*/
|
||||||
package org.jetbrains.java.decompiler.modules.decompiler.exps;
|
package org.jetbrains.java.decompiler.modules.decompiler.exps;
|
||||||
|
|
||||||
import org.jetbrains.java.decompiler.code.CodeConstants;
|
import org.jetbrains.java.decompiler.code.CodeConstants;
|
||||||
@@ -24,7 +27,7 @@ public class ExprUtil {
|
|||||||
// own class
|
// own class
|
||||||
mask = wrapper.getMethodWrapper(CodeConstants.INIT_NAME, descriptor).synthParameters;
|
mask = wrapper.getMethodWrapper(CodeConstants.INIT_NAME, descriptor).synthParameters;
|
||||||
}
|
}
|
||||||
else if (parameters > 0 && node.type == ClassNode.CLASS_MEMBER && node.classStruct.hasModifier(CodeConstants.ACC_STATIC)) {
|
else if (parameters > 0 && node.type == ClassNode.CLASS_MEMBER && (node.access & CodeConstants.ACC_STATIC) == 0) {
|
||||||
// non-static member class
|
// non-static member class
|
||||||
mask = new ArrayList<>(Collections.nCopies(parameters, null));
|
mask = new ArrayList<>(Collections.nCopies(parameters, null));
|
||||||
mask.set(0, new VarVersionPair(-1, 0));
|
mask.set(0, new VarVersionPair(-1, 0));
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ public class SingleClassesTest {
|
|||||||
@Test public void testPop2OneLongPop2() { doTest("pkg/TestPop2OneLongPop2"); }
|
@Test public void testPop2OneLongPop2() { doTest("pkg/TestPop2OneLongPop2"); }
|
||||||
@Test public void testPop2TwoIntPop2() { doTest("pkg/TestPop2TwoIntPop2"); }
|
@Test public void testPop2TwoIntPop2() { doTest("pkg/TestPop2TwoIntPop2"); }
|
||||||
@Test public void testPop2TwoIntTwoPop() { doTest("pkg/TestPop2TwoIntTwoPop"); }
|
@Test public void testPop2TwoIntTwoPop() { doTest("pkg/TestPop2TwoIntTwoPop"); }
|
||||||
|
@Test public void testSuperInner2() { doTest("pkg/TestSuperInner2", "pkg/TestSuperInner"); }
|
||||||
|
|
||||||
// TODO: fix all below
|
// TODO: fix all below
|
||||||
//@Test public void testPackageInfo() { doTest("pkg/package-info"); }
|
//@Test public void testPackageInfo() { doTest("pkg/package-info"); }
|
||||||
|
|||||||
BIN
testData/classes/pkg/TestSuperInner$Inner.class
Normal file
BIN
testData/classes/pkg/TestSuperInner$Inner.class
Normal file
Binary file not shown.
BIN
testData/classes/pkg/TestSuperInner.class
Normal file
BIN
testData/classes/pkg/TestSuperInner.class
Normal file
Binary file not shown.
BIN
testData/classes/pkg/TestSuperInner2$Inner2.class
Normal file
BIN
testData/classes/pkg/TestSuperInner2$Inner2.class
Normal file
Binary file not shown.
BIN
testData/classes/pkg/TestSuperInner2.class
Normal file
BIN
testData/classes/pkg/TestSuperInner2.class
Normal file
Binary file not shown.
17
testData/results/TestSuperInner2.dec
Normal file
17
testData/results/TestSuperInner2.dec
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
class TestSuperInner2 extends TestSuperInner {
|
||||||
|
protected class Inner2 extends TestSuperInner.Inner {
|
||||||
|
protected Inner2() {
|
||||||
|
super();// 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class 'TestSuperInner2$Inner2' {
|
||||||
|
method '<init> (LTestSuperInner2;)V' {
|
||||||
|
7 3
|
||||||
|
a 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Lines mapping:
|
||||||
|
2 <-> 4
|
||||||
6
testData/src/pkg/TestSuperInner.java
Normal file
6
testData/src/pkg/TestSuperInner.java
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
public class TestSuperInner {
|
||||||
|
protected abstract class Inner {
|
||||||
|
protected Inner() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
4
testData/src/pkg/TestSuperInner2.java
Normal file
4
testData/src/pkg/TestSuperInner2.java
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
class TestSuperInner2 extends TestSuperInner {
|
||||||
|
protected class Inner2 extends Inner {
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user