Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.12.0
-
None
Description
The DiffBuilder<T> has a method append which allows to append an existing DiffResult for a property. The example illustrates this the following way:
public class Person implements Diffable<Person> { String name; Address address; // implements Diffable<Address> ... public DiffResult diff(Person obj) { return new DiffBuilder(this, obj, ToStringStyle.SHORT_PREFIX_STYLE) .append("name", this.name, obj.name) .append("address", this.address.diff(obj.address)) .build(); } }
However, the signature of the method was recently changed to:
public DiffBuilder<T> append(final String fieldName, final DiffResult<T> diffResult)
As a consequence, the example code won't compile anymore when using generics because the a DiffBuilder<Person> will only accept DiffResult<Person> but not DiffResult<Address> for its append method.
The signature should be:
public <O> DiffBuilder<T> append(final String fieldName, final DiffResult<O> diffResult)
or:
public DiffBuilder<T> append(final String fieldName, final DiffResult<?> diffResult)
instead.
Attachments
Issue Links
- links to