Here you can find the source of getMethod(Class> clazz, String name)
public static Method getMethod(Class<?> clazz, String name)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; public class Main { public static Method getMethod(Class<?> clazz, String name) { try {//from w w w . ja v a 2 s. c o m Method m = clazz.getMethod(name); if (m != null) return m; } catch (Exception e) { } for (Method m : clazz.getMethods()) if (m.getName().equalsIgnoreCase(name)) return m; return null; } }