Add LocalVariablesSorter to MethodRemaper in RemappingClassBuilder to keep old behavior
#KT-27774 In Progress
This commit is contained in:
@@ -151,6 +151,7 @@ class MethodInliner(
|
|||||||
|
|
||||||
// MethodRemapper doesn't extends LocalVariablesSorter, but RemappingMethodAdapter does.
|
// MethodRemapper doesn't extends LocalVariablesSorter, but RemappingMethodAdapter does.
|
||||||
// So wrapping with LocalVariablesSorter to keep old behavior
|
// So wrapping with LocalVariablesSorter to keep old behavior
|
||||||
|
// TODO: investigate LocalVariablesSorter removing (see also same code in RemappingClassBuilder.java)
|
||||||
val remappingMethodAdapter = MethodRemapper(
|
val remappingMethodAdapter = MethodRemapper(
|
||||||
LocalVariablesSorter(
|
LocalVariablesSorter(
|
||||||
resultNode.access,
|
resultNode.access,
|
||||||
|
|||||||
@@ -82,8 +82,15 @@ public class RemappingClassBuilder extends DelegatingClassBuilder {
|
|||||||
@Nullable String signature,
|
@Nullable String signature,
|
||||||
@Nullable String[] exceptions
|
@Nullable String[] exceptions
|
||||||
) {
|
) {
|
||||||
|
String newDescriptor = remapper.mapMethodDesc(desc);
|
||||||
|
// MethodRemapper doesn't extends LocalVariablesSorter, but RemappingMethodAdapter does.
|
||||||
|
// So wrapping with LocalVariablesSorter to keep old behavior.
|
||||||
|
// TODO: investigate LocalVariablesSorter removing (see also same code in MethodInliner)
|
||||||
return new MethodRemapper(
|
return new MethodRemapper(
|
||||||
builder.newMethod(origin, access, name, remapper.mapMethodDesc(desc), remapper.mapSignature(signature, false), exceptions),
|
new LocalVariablesSorter(
|
||||||
|
access, newDescriptor,
|
||||||
|
builder.newMethod(origin, access, name, newDescriptor, remapper.mapSignature(signature, false),
|
||||||
|
exceptions)),
|
||||||
remapper
|
remapper
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user