Remove unnecessary invocations of toString()

Closes gh-36709

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>

(cherry picked from commit bfb88cfc1c)
This commit is contained in:
Yanming Zhou
2026-04-27 14:06:20 +03:00
committed by Sam Brannen
parent 626907bbfd
commit dc032c1e33
19 changed files with 23 additions and 23 deletions
@@ -145,7 +145,7 @@ implements CallbackGenerator
private static void superHelper(CodeEmitter e, MethodInfo method, Context context)
{
if (TypeUtils.isAbstract(method.getModifiers())) {
e.throw_exception(ABSTRACT_METHOD_ERROR, method.toString() + " is abstract" );
e.throw_exception(ABSTRACT_METHOD_ERROR, method + " is abstract" );
} else {
e.load_this();
context.emitLoadArgsAndInvoke(e, method);
@@ -59,7 +59,7 @@ class GeneratedMethodsTests {
@Test
void createWithExistingGeneratorUsesGenerator() {
Function<MethodName, String> generator = name -> "__" + name.toString();
Function<MethodName, String> generator = name -> "__" + name;
GeneratedMethods methods = new GeneratedMethods(TEST_CLASS_NAME, generator);
assertThat(methods.add("test", methodSpecCustomizer).getName()).hasToString("__test");
}