From b199e0d6e6dbe9ecf839a1bee920f1a75c4cfe1d Mon Sep 17 00:00:00 2001 From: Anastasia Katsman Date: Wed, 27 Nov 2024 13:27:07 +0100 Subject: [PATCH] [driver] add note about necessary of adding @JvmStatic to the kotlin companion object methods GitOrigin-RevId: 67e9a7e429c897b5fff91d57dc5a8fd3dd658bd9 --- .../core/src/com/intellij/driver/impl/Invoker.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/platform/remote-driver/core/src/com/intellij/driver/impl/Invoker.java b/platform/remote-driver/core/src/com/intellij/driver/impl/Invoker.java index 648f5e2d9ecb..3949f36fab42 100644 --- a/platform/remote-driver/core/src/com/intellij/driver/impl/Invoker.java +++ b/platform/remote-driver/core/src/com/intellij/driver/impl/Invoker.java @@ -333,10 +333,13 @@ public class Invoker implements InvokerMBean { if (targetMethods.isEmpty()) { throw new IllegalStateException( - String.format("No method '%s' with parameter count %s in class %s. Available methods: %n%s", - call.getMethodName(), argCount, call.getClassName(), - availableMethods.stream().map(it -> it.toString()) - .collect(Collectors.joining(" - " + System.lineSeparator())) + String.format( + "No method '%s' with parameter count %s in class %s. If your method is companion method in Kotlin, don't forget to add @JvmStatic." + + // https://youtrack.jetbrains.com/issue/AT-1744/Driver-make-it-not-neccessary-to-add-JvmStatic-to-kotlin-companion-methods + "\nAvailable methods: %n%s", + call.getMethodName(), argCount, call.getClassName(), + availableMethods.stream().map(it -> it.toString()) + .collect(Collectors.joining(" - " + System.lineSeparator())) )); }