Source:
public ConstructorDeclaration createDefaultConstructor(boolean needExplicitConstructorCall, boolean needToInsert) { ConstructorDeclaration constructor = new ConstructorDeclaration(this.compilationResult); constructor.bits |= ASTNode.IsDefaultConstructor | ASTNode.IsCanonicalConstructor | ASTNode.IsImplicit; constructor.selector = this.name; constructor.modifiers = this.modifiers & ClassFileConstants.AccPublic; constructor.modifiers |= ClassFileConstants.AccPublic; constructor.arguments = this.args; constructor.declarationSourceStart = constructor.sourceStart = constructor.bodyStart = this.sourceStart; constructor.declarationSourceEnd = constructor.sourceEnd = constructor.bodyEnd = this.sourceStart - 1; if (needExplicitConstructorCall) { constructor.constructorCall = SuperReference.implicitSuperConstructorCall(); constructor.constructorCall.sourceStart = this.sourceStart; constructor.constructorCall.sourceEnd = this.sourceEnd; } List<Statement> statements = new ArrayList<>(); int l = this.args != null ? this.args.length : 0; if (l > 0 && this.fields != null) { List<String> fNames = Arrays.stream(this.fields) .filter(f -> f.isARecordComponent) .map(f ->new String(f.name)) .collect(Collectors.toList()); for (int i = 0; i < l; ++i) { Argument arg = this.args[i]; if (!fNames.contains(new String(arg.name))) continue; FieldReference lhs = new FieldReference(arg.name, 0); lhs.receiver = ThisReference.implicitThis(); statements.add(new Assignment(lhs, new SingleNameReference(arg.name, 0), 0)); } } constructor.statements = statements.toArray(new Statement[0]); if (needToInsert) { if (this.methods == null) { this.methods = new AbstractMethodDeclaration[] { constructor }; } else { AbstractMethodDeclaration[] newMethods; System.arraycopy( this.methods, 0, newMethods = new AbstractMethodDeclaration[this.methods.length + 1], 1, this.methods.length); newMethods[0] = constructor; this.methods = newMethods; } } return constructor; }

Target:
public ConstructorDeclaration createDefaultConstructor(boolean needExplicitConstructorCall, boolean needToInsert) { ConstructorDeclaration constructor = new ConstructorDeclaration(this.compilationResult); constructor.bits |= ASTNode.IsCanonicalConstructor | ASTNode.IsImplicit; constructor.selector = this.name; constructor.modifiers = this.modifiers & ClassFileConstants.AccPublic; constructor.modifiers |= ClassFileConstants.AccPublic; constructor.arguments = this.args; constructor.declarationSourceStart = constructor.sourceStart = constructor.bodyStart = this.sourceStart; constructor.declarationSourceEnd = constructor.sourceEnd = constructor.bodyEnd = this.sourceStart - 1; if (needExplicitConstructorCall) { constructor.constructorCall = SuperReference.implicitSuperConstructorCall(); constructor.constructorCall.sourceStart = this.sourceStart; constructor.constructorCall.sourceEnd = this.sourceEnd; } List<Statement> statements = new ArrayList<>(); int l = this.args != null ? this.args.length : 0; if (l > 0 && this.fields != null) { List<String> fNames = Arrays.stream(this.fields) .filter(f -> f.isARecordComponent) .map(f ->new String(f.name)) .collect(Collectors.toList()); for (int i = 0; i < l; ++i) { Argument arg = this.args[i]; if (!fNames.contains(new String(arg.name))) continue; FieldReference lhs = new FieldReference(arg.name, 0); lhs.receiver = ThisReference.implicitThis(); statements.add(new Assignment(lhs, new SingleNameReference(arg.name, 0), 0)); } } constructor.statements = statements.toArray(new Statement[0]); if (needToInsert) { if (this.methods == null) { this.methods = new AbstractMethodDeclaration[] { constructor }; } else { AbstractMethodDeclaration[] newMethods; System.arraycopy( this.methods, 0, newMethods = new AbstractMethodDeclaration[this.methods.length + 1], 1, this.methods.length); newMethods[0] = constructor; this.methods = newMethods; } } return constructor; }