From 3deeef5b2eaf36afb87613d6e4ae6fc91299881d Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Wed, 2 Jul 2025 10:53:20 -0400 Subject: [PATCH 1/3] Recursively get methods through getMethodRecursive --- .../decompiler/exps/InvocationExprent.java | 3 +++ testData/src/java8/pkg/TestVarArgCalls.java | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java index cafe9032b2..3cfe99954f 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java @@ -1177,6 +1177,9 @@ private boolean isVarArgCall() { StructClass cl = DecompilerContext.getStructContext().getClass(classname); if (cl != null) { StructMethod mt = cl.getMethod(InterpreterUtil.makeUniqueKey(name, stringDescriptor)); + if (mt == null) { + mt = cl.getMethodRecursive(name, stringDescriptor); + } if (mt != null) { return mt.hasModifier(CodeConstants.ACC_VARARGS); } diff --git a/testData/src/java8/pkg/TestVarArgCalls.java b/testData/src/java8/pkg/TestVarArgCalls.java index 61c199ce42..5bc13766d9 100644 --- a/testData/src/java8/pkg/TestVarArgCalls.java +++ b/testData/src/java8/pkg/TestVarArgCalls.java @@ -26,4 +26,23 @@ public void printAll(String fmt, String... params) { public void printComplex(String fmt, String[]... params) { System.out.println(String.format(fmt, (Object[]) params)); } + + public class Parent { + protected void test(Test... test) { + + } + + class Child extends Parent { + + public void vararg() { + test(Test.A, Test.B); + } + + } + } + + public enum Test { + A, + B + } } From b4c222a611ba19a01e5804dd0ed2a546b18fe965 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Wed, 2 Jul 2025 19:29:56 -0400 Subject: [PATCH 2/3] fix test --- testData/results/pkg/TestVarArgCalls.dec | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/testData/results/pkg/TestVarArgCalls.dec b/testData/results/pkg/TestVarArgCalls.dec index 4451e40fdc..a883545e11 100644 --- a/testData/results/pkg/TestVarArgCalls.dec +++ b/testData/results/pkg/TestVarArgCalls.dec @@ -23,6 +23,22 @@ public class TestVarArgCalls { public void printComplex(String fmt, String[]... params) { System.out.println(String.format(fmt, (Object[])params));// 27 }// 28 + + public class Parent { + protected void test(TestVarArgCalls.Test... test) { + }// 33 + + class Child extends TestVarArgCalls.Parent { + public void vararg() { + this.test(TestVarArgCalls.Test.A, TestVarArgCalls.Test.B);// 38 + }// 39 + } + } + + public static enum Test { + A, + B; + } } class 'pkg/TestVarArgCalls' { @@ -160,6 +176,28 @@ class 'pkg/TestVarArgCalls' { } } +class 'pkg/TestVarArgCalls$Parent' { + method 'test ([Lpkg/TestVarArgCalls$Test;)V' { + 0 28 + } +} + +class 'pkg/TestVarArgCalls$Parent$Child' { + method 'vararg ()V' { + 0 32 + 7 32 + 8 32 + 9 32 + d 32 + e 32 + f 32 + 11 32 + 12 32 + 13 32 + 14 33 + } +} + Lines mapping: 5 <-> 5 6 <-> 6 @@ -178,3 +216,6 @@ Lines mapping: 24 <-> 21 27 <-> 24 28 <-> 25 +33 <-> 29 +38 <-> 33 +39 <-> 34 From 6c1677f15a95808632797a0abdfc7af29b09d98e Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Wed, 2 Jul 2025 19:52:11 -0400 Subject: [PATCH 3/3] bump ci