8304148: Remapping a class with Invokedynamic constant loses static bootstrap arguments
Reviewed-by: asotona
This commit is contained in:
parent
82bcee76ea
commit
dde557e312
@ -317,7 +317,8 @@ public sealed interface ClassRemapper extends ClassTransform {
|
||||
case InvokeDynamicInstruction idi ->
|
||||
cob.invokeDynamicInstruction(DynamicCallSiteDesc.of(
|
||||
idi.bootstrapMethod(), idi.name().stringValue(),
|
||||
mapMethodDesc(idi.typeSymbol())));
|
||||
mapMethodDesc(idi.typeSymbol()),
|
||||
idi.bootstrapArgs().stream().map(this::mapConstantValue).toArray(ConstantDesc[]::new)));
|
||||
case NewObjectInstruction c ->
|
||||
cob.newObjectInstruction(map(c.className().asSymbol()));
|
||||
case NewReferenceArrayInstruction c ->
|
||||
|
@ -211,6 +211,7 @@ class AdvancedTransformationsTest {
|
||||
"INVOKESTATIC, owner: AdvancedTransformationsTest$Bar, method name: fooMethod, method type: (LAdvancedTransformationsTest$Bar;)LAdvancedTransformationsTest$Bar",
|
||||
"method type: ()LAdvancedTransformationsTest$Bar;",
|
||||
"GETFIELD, owner: AdvancedTransformationsTest$Rec, field name: foo, field type: LAdvancedTransformationsTest$Bar;");
|
||||
assertFalse(out.contains("bootstrap method arguments indexes: []"), "bootstrap arguments lost");
|
||||
}
|
||||
|
||||
private static void assertContains(String actual, String... expected) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user