DaveAKing / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Matching accessible methods in a class given parameters. #1700

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I need to obtain using reflection the accessible methods in a class given 
certain parameters.
The parameters do not have necessary the exact types of the method declaration 
parameters (otherwise I could use Class.getDeclaredMethod), but they are 
compatible with them (e.g., parameters (int, int) are compatible with 
parameters (Integer, Number) declared in the method).

I see that in Apache commons there is this method: 
MethodUtils.getMatchingAccessibleMethod

Is there an equivalent method in Guava or any possibility of this to be added 
in a future Guava version ?

Thanks,

Sergio

Original issue reported on code.google.com by sergio...@gmail.com on 20 Mar 2014 at 2:23

GoogleCodeExporter commented 9 years ago
I was wondering the same thing and so far have not come up with a solution 
using Guava. Does Guava support this? Is there any plan to ever support this?

Original comment by DeRijcke.Erik@gmail.com on 24 Aug 2014 at 7:02

GoogleCodeExporter commented 9 years ago
I don't think that Apache MethodUtils.getMatchingAccessibleMethod does it 
correctly. See 
http://stackoverflow.com/questions/11765627/how-to-find-an-overloaded-method-in-
java

Original comment by Maaarti...@gmail.com on 27 Aug 2014 at 3:04

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:09

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:07