commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Baker (JIRA)" <>
Subject [jira] [Commented] (LANG-1082) Add option to disable the "objectsTriviallyEqual" test in DiffBuilder.
Date Wed, 21 Jan 2015 23:51:35 GMT


Jonathan Baker commented on LANG-1082:

I'd be happy to throw some code out there, but I want to make sure I'm preserving the original

My gut tells me DiffBuilder should remain immutable.
Would adding a second constructor be the best fit?

public DiffBuilder( boolean testTriviallyEqual ) { ... }
public DiffBuilder() { this( true ); }


> Add option to disable the "objectsTriviallyEqual" test in DiffBuilder.
> ----------------------------------------------------------------------
>                 Key: LANG-1082
>                 URL:
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.builder.*
>    Affects Versions: 3.3.2
>            Reporter: Jonathan Baker
>            Priority: Trivial
>             Fix For: Patch Needed
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
> For example, a bean (e.g. a JPA record) has equals() overridden with a implementation
that tests its "id" property.   If two beans have the same ID, they correspond to the same
record in the database.  However, without tricking the objectsTriviallyEqual check in the
DiffBuilder constructor, there is no way to build a DiffResult using "before" and "after"
instances with changes to other properties (name, modification time, etc).

This message was sent by Atlassian JIRA

View raw message