garydgregory commented on PR #1783:
URL: https://github.com/apache/commons-lang/pull/1783#issuecomment-5594307955
Here's another wrinkle: On Java 9 and up, interfaces can contain private
instance methods, which are not inherited and cannot serve as accessible
replacements. So you need to exclude private interface methods as well as
static methods.
Since our code is Java 8-based, the only way to test this is to add a
precompiled Java code to the test resource folder.
For example:
```java
public interface Labels {
private String label() { return "helper"; }
}
static class Bean implements Labels {
public String label() { return "bean"; }
}
```
For `MethodUtils.invokeMethod(new Bean(), "label")`:
- The original code: returns "bean".
- The PE selects the `Labels` private method and throws
`IllegalAccessException`.
--
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]