[driver] add note about necessary of adding @JvmStatic to the kotlin companion object methods

GitOrigin-RevId: b99e49a8f6d333225e94e11564bafa7879f4b704
This commit is contained in:
Anastasia Katsman
2024-11-27 13:27:07 +01:00
committed by intellij-monorepo-bot
parent e45523b9ad
commit acd175c58b

View File

@@ -327,10 +327,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()))
));
}