[debugger] removed obsolete workaround for jdk bug

GitOrigin-RevId: 0408e6c02b88b1f7238c6f1a32c7cf30b69e32a1
This commit is contained in:
Egor Ushakov
2025-09-10 17:56:56 +00:00
committed by intellij-monorepo-bot
parent 08fb5718c3
commit f99404d420
@@ -1420,28 +1420,6 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
context.getManagerThread().startLongProcessAndFork(() -> {
try {
try {
if (myMethod.isVarArgs()) {
// See IDEA-63581
// if vararg parameter array is of interface type and Object[] is expected, JDI wrap it into another array,
// in this case we have to unroll the array manually and pass its elements to the method instead of array object
int lastIndex = myMethod.argumentTypeNames().size() - 1;
if (lastIndex >= 0 && myArgs.size() > lastIndex) { // at least one varargs param
Object firstVararg = myArgs.get(lastIndex);
if (myArgs.size() == lastIndex + 1) { // only one vararg param
if (firstVararg instanceof ArrayReference arrayRef) {
if (((ArrayType)arrayRef.referenceType()).componentType() instanceof InterfaceType) {
List<String> argTypes = myMethod.argumentTypeNames();
if (argTypes.size() > lastIndex && argTypes.get(lastIndex).startsWith(CommonClassNames.JAVA_LANG_OBJECT)) {
// unwrap array of interfaces for vararg param
myArgs.remove(lastIndex);
myArgs.addAll(arrayRef.getValues());
}
}
}
}
}
}
if (!Patches.IBM_JDK_DISABLE_COLLECTION_BUG) {
// ensure args are not collected
StreamEx.of(myArgs).select(ObjectReference.class).forEach(DebuggerUtilsEx::disableCollection);