Skip to content

Commit

Permalink
Fix changes made by previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mpfaff committed Apr 19, 2024
1 parent 972d023 commit 29718dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public Optional<ClassModel> original() {

@Override
public ClassBuilder withField(Utf8Entry name, Utf8Entry descriptor, Consumer<? super FieldBuilder> handler) {
return consumer.accept(new BufferedFieldBuilder(terminal.constantPool, terminal.context,
return with(new BufferedFieldBuilder(terminal.constantPool, terminal.context,
name, descriptor, null)
.run(handler)
.toModel());
Expand All @@ -70,13 +70,13 @@ public ClassBuilder transformField(FieldModel field, FieldTransform transform) {
field.fieldName(), field.fieldType(),
field);
builder.transform(field, transform);
return consumer.accept(builder.toModel());
return with(builder.toModel());
}

@Override
public ClassBuilder withMethod(Utf8Entry name, Utf8Entry descriptor, int flags,
Consumer<? super MethodBuilder> handler) {
return consumer.accept(new BufferedMethodBuilder(terminal.constantPool, terminal.context,
return with(new BufferedMethodBuilder(terminal.constantPool, terminal.context,
name, descriptor, null)
.run(handler)
.toModel());
Expand All @@ -87,7 +87,7 @@ public ClassBuilder transformMethod(MethodModel method, MethodTransform transfor
BufferedMethodBuilder builder = new BufferedMethodBuilder(terminal.constantPool, terminal.context,
method.methodName(), method.methodType(), method);
builder.transform(method, transform);
return consumer.accept(builder.toModel());
return with(builder.toModel());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public MethodBuilder with(MethodElement element) {

@Override
public MethodBuilder withCode(Consumer<? super CodeBuilder> handler) {
return consumer.accept(terminal.bufferedCodeBuilder(null)
return with(terminal.bufferedCodeBuilder(null)
.run(handler)
.toModel());
}
Expand All @@ -65,7 +65,7 @@ public MethodBuilder withCode(Consumer<? super CodeBuilder> handler) {
public MethodBuilder transformCode(CodeModel code, CodeTransform transform) {
BufferedCodeBuilder builder = terminal.bufferedCodeBuilder(code);
builder.transform(code, transform);
return consumer.accept(builder.toModel());
return with(builder.toModel());
}

@Override
Expand Down

0 comments on commit 29718dd

Please sign in to comment.