MCPcopy Index your code
hub / github.com/clojure/clojure / isMatch

Method isMatch

src/jvm/clojure/lang/Reflector.java:231–253  ·  view source on GitHub ↗
(Method lhs, Method rhs)

Source from the content-addressed store, hash-verified

229
230// DEPRECATED - replaced by isAccessibleMatch()
231public static boolean isMatch(Method lhs, Method rhs) {
232 if(!lhs.getName().equals(rhs.getName())
233 || !Modifier.isPublic(lhs.getDeclaringClass().getModifiers()))
234 {
235 return false;
236 }
237
238 Class[] types1 = lhs.getParameterTypes();
239 Class[] types2 = rhs.getParameterTypes();
240 if(types1.length != types2.length)
241 return false;
242
243 boolean match = true;
244 for (int i=0; i<types1.length; ++i)
245 {
246 if(!types1[i].isAssignableFrom(types2[i]))
247 {
248 match = false;
249 break;
250 }
251 }
252 return match;
253}
254
255public static Method getAsMethodOfAccessibleBase(Class c, Method m, Object target){
256 for(Class iface : c.getInterfaces())

Callers 1

Calls 3

isPublicMethod · 0.80
getNameMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected