这里绝对没有必要使用反射.所以不要!
public static CalendarMatch tpDailyGregorian( int h, CalendarFactory factory ) { Calendar dt = factory.create(TimeZone.getTimeZone(DEFAULT_TZ_ID)); dt.clear(); dt.set(Calendar.HOUR, h); // this works because of type inference return tpFromCalendar(dt); }
哪里:
public interface CalendarFactory