alhudz opened a new pull request, #1748: URL: https://github.com/apache/commons-lang/pull/1748
Repro: `FieldUtils.getField(cls, "CONSTANT")` where `cls` implements an interface that extends the interface actually declaring `CONSTANT` (or a diamond where two implemented interfaces share a common super-interface). Cause: `ClassUtils.getAllInterfaces` also returns the transitively inherited interfaces, so `class1.getField(fieldName)` resolves the same `Field` more than once; the loop rejects on `match == null` alone and raises a false `IllegalArgumentException` about the field being ambiguous across two or more interfaces. Fix: only reject when the newly found field differs (`match == null || match.equals(test)`). `Field.equals` compares declaring class, name and type, so the identical inherited field dedupes while two different fields on unrelated interfaces still throw. -- 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]
