Temporary workaround for constructor params

This commit is contained in:
Mikhael Bogdanov
2014-01-14 14:18:55 +04:00
parent 5a8a0ac486
commit 4bb63535ea
@@ -158,7 +158,15 @@ public class MethodInliner {
List<CapturedParamInfo> recaptured = invocation.getRecaptured();
for (CapturedParamInfo capturedParamInfo : recaptured) {
Type type = capturedParamInfo.getType();
super.visitVarInsn(type.getOpcode(Opcodes.ILOAD), capturedParamInfo.getIndex());
List<CapturedParamInfo> contextCaptured = MethodInliner.this.parameters.getCaptured();
CapturedParamInfo result = null;
for (CapturedParamInfo info : contextCaptured) {
//TODO more sofisticated check
if (info.getFieldName().equals(capturedParamInfo.getFieldName())) {
result = info;
}
}
super.visitVarInsn(type.getOpcode(Opcodes.ILOAD), result.getIndex());
}
super.visitMethodInsn(opcode, invocation.getNewLambdaType().getInternalName(), name, invocation.getNewConstructorDescriptor());
} else {