You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/10/06 04:27:29 UTC

[GitHub] [commons-lang] pixelr edited a comment on pull request #583: [LANG-1544] Fixes null pointer exception in distance method in MethodUtils

pixelr edited a comment on pull request #583:
URL: https://github.com/apache/commons-lang/pull/583#issuecomment-704019436


   > Hi @pixelr
   > 
   > After looking again, I'm not sure this PR makes sense. The test you patched calls a private method, and this private method is not going to be called with just any value. In this case, the private method `distance` is only called from `MethodUtils.getMatchingMethod(Class<?>, String, Class<?>...)` where our `getMatchingMethod` calls `java.lang.reflect.Method.getParameterTypes()`.
   > 
   > Do you have a case where `java.lang.reflect.Method.getParameterTypes()`returns an array containing a null? Can you show this by calling a public method like `org.apache.commons.lang3.reflect.MethodUtils.getMatchingMethod(Class<?>, String, Class<?>...)`?
   > 
   > Otherwise, this PR just make the `distance` method more complicated than it has to be, granted not by much, but there would then be no sense if making the whole code base more NPE proof where it does not need to be.
   > 
   > Let us know your findings.
   
   you are right. I don't think complicating code would be right. I have asked bug reporter for further info else will close the PR. Apologies about very delayed reply
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org