8338543: ClassBuilder withMethod builders should cache the method type symbol

Reviewed-by: asotona
This commit is contained in:
Chen Liang 2024-08-20 05:43:04 +00:00
parent 55851a312b
commit 68d1f5c33b
3 changed files with 19 additions and 4 deletions

View file

@ -276,10 +276,7 @@ public sealed interface ClassBuilder
MethodTypeDesc descriptor,
int methodFlags,
Consumer<? super CodeBuilder> handler) {
return withMethodBody(constantPool().utf8Entry(name),
constantPool().utf8Entry(descriptor),
methodFlags,
handler);
return withMethod(name, descriptor, methodFlags, mb -> mb.withCode(handler));
}
/**