wuwu2000 commented on PR #1414:
URL: https://github.com/apache/commons-lang/pull/1414#issuecomment-3089962195

   So far only 
   
   - 
`org.apache.commons.lang3.reflect.MethodUtils.getMethodsListWithAnnotation(Class<?>,
 Class<? extends Annotation>, boolean, boolean)` 
   - `org.apache.commons.lang3.reflect.MethodUtils.getAnnotation(Method, 
Class<A>, boolean, boolean)` and
   - `org.apache.commons.lang3.reflect.MethodUtils.getMatchingMethod(Class<?>, 
Class<? extends Annotation>, boolean, boolean)`
   
   are using this private method.
   
   getMethodsListWithAnnotation in my opinion is uncritical. You just get every 
method annotated and it works fine
   
   getAnnotation I just checked it has the same issue as getMatchingMethod had 
before this fix.
   
   To be honest, the thing that getAnnotation and getMatchingMethod find the 
method most "near" to the implementing class is more like a opinion. I guess 
the consumer may expect either
   
   1. find the (annotation of) the method most "up"/"near to implementing 
class" - sorry I don't know how to express this
   2. find the (annotation of) the method of the interface
   3. get an exception if it's unclear for MethodUtil 
   
   I think option 1 is the most intuitive (that's how spring mvc annotation 
system works, at least similar). Maybe MethodUtils.getAnnotation and 
MethodUtils.getMatchingMethod need additional parameters to be able to fulfil 
the expectations of the consumer?
   
   
   I think in nearer future the order of getAllSuperclassesAndInterfaces should 
be in the order concrete class => super => super.super etc.. => interfaces - 
sorry for my quite dirty fix only for getMatchingMethod, I wasn't sure how much 
I am allowed to change 🗡️ 
   
   
   


-- 
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]

Reply via email to