Fix for "NoSuchFieldError: this$0$inlined"
This commit is contained in:
@@ -272,6 +272,10 @@ public class LambdaTransformer {
|
||||
}
|
||||
|
||||
public static String getNewFieldName(String oldName) {
|
||||
if (oldName.equals("this$0")) {
|
||||
//"this$0" couldn't clash and we should keep this name invariant for further transformations
|
||||
return oldName;
|
||||
}
|
||||
return oldName + "$inlined";
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ public class RegeneratedLambdaFieldRemapper extends LambdaFieldRemapper {
|
||||
FieldInsnNode next = (FieldInsnNode) nextInstruction;
|
||||
node.instructions.remove(next.getPrevious());
|
||||
next.owner = Type.getType(((FieldInsnNode) previous).desc).getInternalName();
|
||||
next.name = node.name.equals("this$0") ? node.name : LambdaTransformer.getNewFieldName(next.name);
|
||||
next.name = LambdaTransformer.getNewFieldName(next.name);
|
||||
|
||||
return next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user