This is an automated email from the ASF dual-hosted git repository.

garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new fcc560b1b Use DiffBuilder.builder() in nested diff example (#1859)
fcc560b1b is described below

commit fcc560b1b4db016e67aeb429b100d888d9111379
Author: maria zortea <[email protected]>
AuthorDate: Wed Nov 11 17:03:36 2026 -0300

    Use DiffBuilder.builder() in nested diff example (#1859)
    
    The nested diff example still used a constructor that is marked deprecated. 
Use the builder, like the class-level example does.
    
    Assisted-By: Claude
---
 src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java 
b/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
index 4ad0f4af3..ce72612c3 100644
--- a/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
+++ b/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
@@ -383,8 +383,12 @@ public DiffBuilder<T> append(final String fieldName, final 
char[] lhs, final cha
      *
      *   ...
      *
-     *   public DiffResult diff(Person obj) {
-     *     return new DiffBuilder(this, obj, ToStringStyle.SHORT_PREFIX_STYLE)
+     *   public DiffResult<Person> diff(Person obj) {
+     *     return DiffBuilder.<Person>builder()
+     *         .setLeft(this)
+     *         .setRight(obj)
+     *         .setStyle(ToStringStyle.SHORT_PREFIX_STYLE)
+     *         .build()
      *       .append("name", this.name, obj.name)
      *       .append("address", this.address.diff(obj.address))
      *       .build();

Reply via email to