public static Method getMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes) { return getMethod(clazz, methodName, parameterTypes, clazz); }
public static Method getMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes) { return getMethod(clazz, methodName, parameterTypes, clazz); }
private static Method getMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes, Class<?> original) { Method method = null; try { method = clazz.getDeclaredMethod(methodName, parameterTypes); if (LOG.isLoggable(Level.FINE)) { LOG.fine("found method " + clazz.getName() + "." + methodName + "(" + ArrayUtil.toString(parameterTypes) + ")"); } } catch (SecurityException e) { String message = ExceptionManager.getInstance().getFullMessage( "bp_RU_10", clazz.getName(), methodName, getParameterTypesText(parameterTypes)); throw new BonitaRuntimeException(message, e); } catch (NoSuchMethodException e) { if (clazz.getSuperclass() != null) { return getMethod(clazz.getSuperclass(), methodName, parameterTypes, original); } else { String message = ExceptionManager.getInstance().getFullMessage( "bp_RU_11", original.getName(), methodName, getParameterTypesText(parameterTypes)); throw new BonitaRuntimeException(message, e); } } return method; }
private static Method getMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes, Class<?> original) { Method method = null; try { method = clazz.getDeclaredMethod(methodName, parameterTypes); if (LOG.isLoggable(Level.FINE)) { LOG.fine("found method " + clazz.getName() + "." + methodName + "(" + ArrayUtil.toString(parameterTypes) + ")"); } } catch (SecurityException e) { String message = ExceptionManager.getInstance().getFullMessage( "bp_RU_10", clazz.getName(), methodName, getParameterTypesText(parameterTypes)); throw new BonitaRuntimeException(message, e); } catch (NoSuchMethodException e) { if (clazz.getSuperclass() != null) { return getMethod(clazz.getSuperclass(), methodName, parameterTypes, original); } else { String message = ExceptionManager.getInstance().getFullMessage( "bp_RU_11", original.getName(), methodName, getParameterTypesText(parameterTypes)); throw new BonitaRuntimeException(message, e); } } return method; }