You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2020/03/29 09:56:20 UTC
[GitHub] [groovy] vipcxj edited a comment on issue #1147: fix GROOVY-9367
vipcxj edited a comment on issue #1147: fix GROOVY-9367
URL: https://github.com/apache/groovy/pull/1147#issuecomment-605611721
> I only now did see this PR due to the comment from shils. I can understand the goal, but not exactly the change itself. What I would have done is to change the null-branch in calculateParameterDistance and in there add the check for NullObject. Going with a distance of 0 for NullObject would make it the same as if there is Object. To actually prefere NullObject I would consider returning a distance of for Object 1 and 0 for NullObject instead. Since usually 2 is used for the distance this should be ok, but of course this pends actual checks in form of a test. If that does not work, then we have to look onto why. @danielsun1106 @paulk-asert @vipcxj what do you think?
At first, I consider returning a distance 0 for NullObject and 1 for Object, and check NullObject before the Object. but it not work. because a negative distance is still valid. Then I have to change handleMatches to do a extra check to make NullObject win. You can found it in my commit history.
----------------------------------------------------------------
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
With regards,
Apache Git Services