Skip to content

Commit 3deeef5

Browse files
committed
Recursively get methods through getMethodRecursive
1 parent a1b7f6d commit 3deeef5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,9 @@ private boolean isVarArgCall() {
11771177
StructClass cl = DecompilerContext.getStructContext().getClass(classname);
11781178
if (cl != null) {
11791179
StructMethod mt = cl.getMethod(InterpreterUtil.makeUniqueKey(name, stringDescriptor));
1180+
if (mt == null) {
1181+
mt = cl.getMethodRecursive(name, stringDescriptor);
1182+
}
11801183
if (mt != null) {
11811184
return mt.hasModifier(CodeConstants.ACC_VARARGS);
11821185
}

testData/src/java8/pkg/TestVarArgCalls.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,23 @@ public void printAll(String fmt, String... params) {
2626
public void printComplex(String fmt, String[]... params) {
2727
System.out.println(String.format(fmt, (Object[]) params));
2828
}
29+
30+
public class Parent {
31+
protected void test(Test... test) {
32+
33+
}
34+
35+
class Child extends Parent {
36+
37+
public void vararg() {
38+
test(Test.A, Test.B);
39+
}
40+
41+
}
42+
}
43+
44+
public enum Test {
45+
A,
46+
B
47+
}
2948
}

0 commit comments

Comments
 (0)