mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[debugger] simplify arrays creation
GitOrigin-RevId: 39b19397a74450b93b9502e725b03a1f479b1665
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0eab94e968
commit
bace4cfa96
@@ -1555,14 +1555,8 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
evaluationContext.getClassLoader());
|
||||
|
||||
// reserve one extra element for the return value
|
||||
ArrayReference arrayArgs = DebuggerUtilsEx.mirrorOfArray(objectArrayClass, boxedArgs.size() + 1, evaluationContext);
|
||||
try {
|
||||
DebuggerUtilsEx.setArrayValues(arrayArgs, boxedArgs, false);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new EvaluateException(e.getMessage(), e);
|
||||
}
|
||||
invokerArgs.add(arrayArgs);
|
||||
boxedArgs.add(null);
|
||||
invokerArgs.add(DebuggerUtilsEx.mirrorOfArray(objectArrayClass, boxedArgs, evaluationContext)); // args
|
||||
invokerArgs.add(method.declaringType().classLoader()); // method's declaring type class loader to be able to resolve parameter types
|
||||
return DebuggerUtilsImpl.invokeHelperMethod(evaluationContext, MethodInvoker.class, "invoke", invokerArgs, false);
|
||||
}
|
||||
|
||||
@@ -130,8 +130,8 @@ public final class BatchEvaluator {
|
||||
}
|
||||
|
||||
// reserve one extra element for the return value to avoid gc collection of the result
|
||||
ArrayReference argArray = DebuggerUtilsEx.mirrorOfArray(objectArrayClass, values.size() + 1, evaluationContext);
|
||||
DebuggerUtilsEx.setArrayValues(argArray, values, false);
|
||||
ArrayReference argArray =
|
||||
DebuggerUtilsEx.mirrorOfArray(objectArrayClass, ContainerUtil.append(values, (Value)null), evaluationContext);
|
||||
|
||||
Value result = ((DebugProcessImpl)debugProcess).invokeMethod(
|
||||
evaluationContext, myBatchEvaluatorClass, myBatchEvaluatorMethod, Collections.singletonList(argArray),
|
||||
@@ -165,7 +165,7 @@ public final class BatchEvaluator {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (EvaluateException | ClassNotLoadedException | InvalidTypeException e) {
|
||||
catch (EvaluateException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user