Alwaysgaurav1 opened a new pull request, #1778:
URL: https://github.com/apache/commons-lang/pull/1778
## Summary
- **Align `ReflectionDiffBuilder` with `AbstractReflection`:**
- `ReflectionDiffBuilder<T>` now extends `AbstractReflection` for
consistency with `EqualsBuilder`, `HashCodeBuilder`, `CompareToBuilder`, and
`ToStringBuilder`.
- `ReflectionDiffBuilder.Builder<T>` extends
`AbstractReflection.AbstractBuilder<Builder<T>>` and implements
`Supplier<ReflectionDiffBuilder<T>>` via `get()`, inheriting
`setForceAccessible(boolean)`.
- Replaces custom `readField` with
`AbstractReflection.setAccessible(field)` and `Reflection.getUnchecked(field,
target)` with runtime module safety.
- **Cycle Detection & StackOverflow Protection:**
- Introduces a thread-local cycle registry (`REGISTRY`) to track object
pairs during reflection diffing.
- Guards recursive traversal in `ReflectionDiffBuilder.build()` and
`DiffBuilder` constructor to avoid `StackOverflowError` on self-referential or
mutually-referential object graphs.
- **Tests & Changes:**
- Added unit test cases in `ReflectionDiffBuilderTest` covering
self-referential cycles, mutually-referential cycles, asymmetric cycles, and
builder configuration.
- Added release note entry in `src/changes/changes.xml`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]