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

Method isAccessibleMatch

src/jvm/clojure/lang/Reflector.java:279–302  ·  view source on GitHub ↗
(Method lhs, Method rhs, Object target)

Source from the content-addressed store, hash-verified

277}
278
279public static boolean isAccessibleMatch(Method lhs, Method rhs, Object target) {
280 if(!lhs.getName().equals(rhs.getName())
281 || !Modifier.isPublic(lhs.getDeclaringClass().getModifiers())
282 || !canAccess(lhs, target))
283 {
284 return false;
285 }
286
287 Class[] types1 = lhs.getParameterTypes();
288 Class[] types2 = rhs.getParameterTypes();
289 if(types1.length != types2.length)
290 return false;
291
292 boolean match = true;
293 for (int i=0; i<types1.length; ++i)
294 {
295 if(!types1[i].isAssignableFrom(types2[i]))
296 {
297 match = false;
298 break;
299 }
300 }
301 return match;
302}
303
304public static Object invokeConstructor(Class c, Object[] args) {
305 try

Callers 1

Calls 4

canAccessMethod · 0.95
isPublicMethod · 0.80
getNameMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected