Buggy code:
public class DatabaseTimerPersistence implements TimerPersistence , Service < DatabaseTimerPersistence > { private final InjectedValue < ManagedReferenceFactory > dataSourceInjectedValue = new InjectedValue < ManagedReferenceFactory > ( ) ; private final InjectedValue < ModuleLoader > moduleLoader = new InjectedValue < ModuleLoader > ( ) ; private final String name ; private final String database ; private final String partition ; private volatile ManagedReference managedReference ; private volatile DataSource dataSource ; private volatile Properties sql ; private MarshallerFactory factory ; private MarshallingConfiguration configuration ; private static final String CREATE_TABLE = "create-table" ; private static final String CREATE_TIMER = "create-timer" ; private static final String UPDATE_TIMER = "update-timer" ; private static final String LOAD_ALL_TIMERS = "load-all-timers" ; private static final String LOAD_TIMER = "load-timer" ; private static final String DELETE_TIMER = "delete-timer" ; public DatabaseTimerPersistence ( final String name , final String database , String partition ) { } @ Override public void start ( final StartContext context ) throws StartException { } @ Override public void stop ( final StopContext context ) { } void runCreateTable ( ) { } private String sql ( final String key ) { } @ Override public void addTimer ( final TimerImpl timerEntity ) { } @ Override public void persistTimer ( final TimerImpl timerEntity ) { } @ Override public void timerUndeployed ( final String timedObjectId ) { } @ Override public List < TimerImpl > loadActiveTimers ( final String timedObjectId , final TimerServiceImpl timerService ) { } @ Override public DatabaseTimerPersistence getValue ( ) throws IllegalArgumentException , IllegalStateException { } private TimerImpl timerFromResult ( final ResultSet resultSet , final TimerServiceImpl timerService ) throws SQLException { boolean calendarTimer = resultSet . getBoolean ( 24 ) ; TimerImpl . Builder builder = null ; if ( calendarTimer ) { CalendarTimer . Builder cb = CalendarTimer . builder ( ) ; builder = cb ; cb . setScheduleExprSecond ( resultSet . getString ( 10 ) ) ; cb . setScheduleExprMinute ( resultSet . getString ( 11 ) ) ; cb . setScheduleExprHour ( resultSet . getString ( 12 ) ) ; cb . setScheduleExprDayOfWeek ( resultSet . getString ( 13 ) ) ; cb . setScheduleExprDayOfMonth ( resultSet . getString ( 14 ) ) ; cb . setScheduleExprMonth ( resultSet . getString ( 15 ) ) ; cb . setScheduleExprYear ( resultSet . getString ( 16 ) ) ; cb . setScheduleExprStartDate ( resultSet . getTimestamp ( 17 ) ) ; cb . setScheduleExprEndDate ( resultSet . getTimestamp ( 18 ) ) ; cb . setScheduleExprTimezone ( resultSet . getString ( 19 ) ) ; cb . setAutoTimer ( resultSet . getBoolean ( 20 ) ) ; final String clazz = resultSet . getString ( 21 ) ; final String methodName = resultSet . getString ( 22 ) ; if ( methodName != null ) { final String paramString = resultSet . getString ( 23 ) ; final String [ ] params = ( ( paramString == null ) || ( paramString . isEmpty ( ) ) ) ? new String [ 0 ] : paramString . split ( ";" ) ; <START_BUG> final Method timeoutMethod = CalendarTimer . getTimeoutMethod ( new TimeoutMethod ( clazz , methodName , params ) , timerService . getTimedObjectInvoker ( ) . getValue ( ) ) ; <END_BUG> if ( timeoutMethod == null ) { ROOT_LOGGER . timerReinstatementFailed ( resultSet . getString ( 2 ) , resultSet . getString ( 1 ) , new NoSuchMethodException ( ) ) ; } cb . setTimeoutMethod ( timeoutMethod ) ; } } else { builder = TimerImpl . builder ( ) ; } builder . setId ( resultSet . getString ( 1 ) ) ; builder . setTimedObjectId ( resultSet . getString ( 2 ) ) ; builder . setInitialDate ( resultSet . getTimestamp ( 3 ) ) ; builder . setRepeatInterval ( resultSet . getLong ( 4 ) ) ; builder . setNextDate ( resultSet . getTimestamp ( 5 ) ) ; builder . setPreviousRun ( resultSet . getTimestamp ( 6 ) ) ; builder . setPrimaryKey ( deSerialize ( resultSet . getString ( 7 ) ) ) ; builder . setInfo ( ( ( Serializable ) ( deSerialize ( resultSet . getString ( 8 ) ) ) ) ) ; builder . setTimerState ( TimerState . valueOf ( resultSet . getString ( 9 ) ) ) ; builder . setPersistent ( true ) ; return builder . build ( timerService ) ; } private void statementParameters ( final TimerImpl timerEntity , final PreparedStatement statement ) throws SQLException { } private String serialize ( final Serializable serializable ) { } public Object deSerialize ( final String data ) throws SQLException { } private Timestamp timestamp ( final Date date ) { } public InjectedValue < ManagedReferenceFactory > getDataSourceInjectedValue ( ) { } public InjectedValue < ModuleLoader > getModuleLoader ( ) { } private static void safeClose ( final Closeable resource ) { } private static void safeClose ( final Statement resource ) { } private static void safeClose ( final Connection resource ) { } private static void safeClose ( final ResultSet resource ) { } }

Fix:
final Method timeoutMethod = CalendarTimer . getTimeoutMethod ( new TimeoutMethod ( clazz , methodName , params ) , timerService . getTimedObjectInvoker ( ) . getValue ( ) . getClassLoader ( ) ) ;