From 1cabca9ffeca95d7079605446980366f0e185a8c Mon Sep 17 00:00:00 2001 From: Egor Ushakov Date: Tue, 14 Jan 2025 18:17:32 +0100 Subject: [PATCH] [debugger] throw NoSuchMethodException if method not found in helper GitOrigin-RevId: 5c2f800f6a51b5e53bb35412d2439969029583e3 --- .../src/com/intellij/rt/debugger/MethodInvoker.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/java-runtime/src/com/intellij/rt/debugger/MethodInvoker.java b/java/java-runtime/src/com/intellij/rt/debugger/MethodInvoker.java index 2cbd2ed4985c..7194c7ce4ac5 100644 --- a/java/java-runtime/src/com/intellij/rt/debugger/MethodInvoker.java +++ b/java/java-runtime/src/com/intellij/rt/debugger/MethodInvoker.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.rt.debugger; import java.lang.invoke.MethodHandle; @@ -188,6 +188,10 @@ public final class MethodInvoker { method = lookup.findStatic(cls, name, mt); } + if (method == null) { + throw new NoSuchMethodException(nameAndDescriptor + " not found in " + cls); + } + int parameterCount = mt.parameterCount(); Class lastParameterType = parameterCount > 0 ? mt.parameterType(parameterCount - 1) : null; boolean vararg = method.isVarargsCollector();