try { paramSchedule = (Schedule) m.invoke(pg, arguments); return paramSchedule; } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace();
else { Class parameters[] = {Collection.class, TimeSpan.class}; Object arguments[] = {pgInputs, projectSpan}; Method m = null; try { if (!supplyClassPG.isInstance(pg)) { throw new IllegalArgumentException("PG is not an instanceof of "+supplyClassPG+": "+pg); } m = supplyClassPG.getMethod("getParameterSchedule", parameters); paramSchedule = (Schedule) m.invoke(pg, arguments); return paramSchedule; } catch(Exception e) { e.printStackTrace(); }
  public Schedule getParameterSchedule(PropertyGroup pg,                                       Collection pgInputs,                                       TimeSpan projectSpan) {    Schedule paramSchedule = null;    Class parameters[] = {Collection.class, TimeSpan.class};    Object arguments[] = {pgInputs, projectSpan};    Method m = null;    try {      m = supplyClassPG.getMethod("getParameterSchedule", parameters);    } catch (NoSuchMethodException e) {      e.printStackTrace();    } catch (SecurityException e) {      e.printStackTrace();    }    try {      paramSchedule = (Schedule) m.invoke(pg, arguments);      return paramSchedule;    } catch (IllegalAccessException e) {      e.printStackTrace();    } catch (IllegalArgumentException e) {      e.printStackTrace();    } catch (InvocationTargetException e) {      e.printStackTrace();    }    return new ScheduleImpl();  }