You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by NickManley <gi...@git.apache.org> on 2016/05/21 16:50:49 UTC

[GitHub] commons-lang pull request: LANG-1233: DiffBuilder add method to al...

GitHub user NickManley opened a pull request:

    https://github.com/apache/commons-lang/pull/151

    LANG-1233: DiffBuilder add method to allow appending from a DiffResult

    Suppose one has a Diffable object where one of the properties is also diffable. For example, given a Person object with an address property, it might be useful to be able to perform a diff on the Person and identify specific differences within the address. You might want the diff result of a Person to show that "address.city" is different rather than just the entire address. This feature allows for that.
    
    Creating a new pull request after the original was closed by mistake.
    
    JIRA: https://issues.apache.org/jira/browse/LANG-1233
    Previous Pull Request: https://github.com/apache/commons-lang/pull/122

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/NickManley/commons-lang appendDiffs

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/151.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #151
    
----
commit 9d67c28999caa4a654f607c29fb5cc363e3487c4
Author: Nick Manley <ni...@outlook.com>
Date:   2016-01-24T07:27:30Z

    Add method to DiffBuilder to allow appending from a DiffResult.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1233: DiffBuilder add method to al...

Posted by NickManley <gi...@git.apache.org>.
Github user NickManley commented on the pull request:

    https://github.com/apache/commons-lang/pull/151#issuecomment-220844745
  
    I didn't realize the original pull request had already been merged, so things got out of sync with the pull request. I think everything is back to normal now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1233: DiffBuilder add method to al...

Posted by NickManley <gi...@git.apache.org>.
GitHub user NickManley reopened a pull request:

    https://github.com/apache/commons-lang/pull/151

    LANG-1233: DiffBuilder add method to allow appending from a DiffResult

    Suppose one has a Diffable object where one of the properties is also diffable. For example, given a Person object with an address property, it might be useful to be able to perform a diff on the Person and identify specific differences within the address. You might want the diff result of a Person to show that "address.city" is different rather than just the entire address. This feature allows for that.
    
    Creating a new pull request after the original was closed by mistake.
    
    JIRA: https://issues.apache.org/jira/browse/LANG-1233
    Previous Pull Request: https://github.com/apache/commons-lang/pull/122

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/NickManley/commons-lang appendDiffs

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/151.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #151
    
----
commit c15963f7266a30a49bb18d8a9a64980c92f6f8b7
Author: Nick Manley <ni...@outlook.com>
Date:   2016-05-22T17:21:58Z

    Update javadoc for DiffBuilder#append(String, DiffResult)

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1233: DiffBuilder add method to al...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/151#discussion_r64146221
  
    --- Diff: src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java ---
    @@ -942,6 +942,59 @@ public DiffBuilder append(final String fieldName, final Object[] lhs,
     
         /**
          * <p>
    +     * Append diffs from another {@code DiffResult}.
    +     * </p>
    +     * 
    +     * <p>
    +     * This method is useful if you want to compare properties which are
    +     * themselves Diffable and would like to know which specific part of
    +     * it is different.
    +     * </p>
    +     * 
    +     * <pre>
    +     * public class Person implements Diffable&lt;Person&gt; {
    +     *   String name;
    +     *   Address address; // implements Diffable&lt;Address&gt;
    +     *   
    +     *   ...
    +     *   
    +     *   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();
    +     *   }
    +     * }
    +     * </pre>
    +     * 
    +     * @param fieldName
    +     *            the field name
    +     * @param diffResult
    +     *            the {@code DiffResult} to append
    +     * @return this
    --- End diff --
    
    Hi Nick,
    
    please add `@since` and `@throws` tags.
    
    Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1233: DiffBuilder add method to al...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the pull request:

    https://github.com/apache/commons-lang/pull/151#issuecomment-220845353
  
    Thanks! :+1: 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1233: DiffBuilder add method to al...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/commons-lang/pull/151


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1233: DiffBuilder add method to al...

Posted by NickManley <gi...@git.apache.org>.
Github user NickManley closed the pull request at:

    https://github.com/apache/commons-lang/pull/151


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1233: DiffBuilder add method to al...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the pull request:

    https://github.com/apache/commons-lang/pull/151#issuecomment-220844854
  
    Hi Nick,
    
    sorry I did not mean to merge the pull request before giving you a change to update.
    
    I will merge this one now.
    
    Sorry again,
    Pascal


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---