Skip to content

Commit

Permalink
[Java Spring] Fix copyOf inheritance using empty object instead of pa…
Browse files Browse the repository at this point in the history
…ssed value (#19426)

* Fix copyOf inheritance using empty object instead of passed value

* Generate new samples
  • Loading branch information
marvinsommer authored Oct 10, 2024
1 parent d9cdecf commit a84946b
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

protected Builder copyOf({{classname}} value) { {{#parentModel}}
super.copyOf(instance);{{/parentModel}}{{#vars}}
super.copyOf(value);{{/parentModel}}{{#vars}}
this.instance.{{setter}}(value.{{name}});{{/vars}}
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ protected Builder(Bar instance) {
}

protected Builder copyOf(Bar value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setId(value.id);
this.instance.setBarPropA(value.barPropA);
this.instance.setFooPropB(value.fooPropB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ protected Builder(BarCreate instance) {
}

protected Builder copyOf(BarCreate value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setBarPropA(value.barPropA);
this.instance.setFooPropB(value.fooPropB);
this.instance.setFoo(value.foo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected Builder(BarRef instance) {
}

protected Builder copyOf(BarRef value) {
super.copyOf(instance);
super.copyOf(value);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected Builder(Foo instance) {
}

protected Builder copyOf(Foo value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setFooPropA(value.fooPropA);
this.instance.setFooPropB(value.fooPropB);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected Builder(FooRef instance) {
}

protected Builder copyOf(FooRef value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setFoorefPropA(value.foorefPropA);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected Builder(Pasta instance) {
}

protected Builder copyOf(Pasta value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setVendor(value.vendor);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected Builder(Pizza instance) {
}

protected Builder copyOf(Pizza value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setPizzaSize(value.pizzaSize);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected Builder(PizzaSpeziale instance) {
}

protected Builder copyOf(PizzaSpeziale value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setToppings(value.toppings);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected Builder(BigCat instance) {
}

protected Builder copyOf(BigCat value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setKind(value.kind);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected Builder(Cat instance) {
}

protected Builder copyOf(Cat value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setDeclawed(value.declawed);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected Builder(ChildWithNullable instance) {
}

protected Builder copyOf(ChildWithNullable value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setOtherProperty(value.otherProperty);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected Builder(Dog instance) {
}

protected Builder copyOf(Dog value) {
super.copyOf(instance);
super.copyOf(value);
this.instance.setBreed(value.breed);
return this;
}
Expand Down

0 comments on commit a84946b

Please sign in to comment.