Buggy code:
private final Map < Method , List < AutoTimer > > autoTimers ; private final InjectedValue < TimerPersistence > timerPersistence = new InjectedValue < TimerPersistence > ( ) ; private final Map < String , TimerImpl > persistentTimers = Collections . synchronizedMap ( new HashMap < String , TimerImpl > ( ) ) ; private final Map < String , TimerImpl > nonPersistentTimers = Collections . synchronizedMap ( new HashMap < String , TimerImpl > ( ) ) ; private final Map < String , TimerImpl > persistentWaitingOnTxCompletionTimers = Collections . synchronizedMap ( new HashMap < String , TimerImpl > ( ) ) ; private final Map < String , TimerTask > scheduledTimerFutures = new HashMap < String , TimerTask > ( ) ; private TransactionManager transactionManager ; private volatile boolean started = false ; public TimerServiceImpl ( final Map < Method , List < AutoTimer > > autoTimers , final ServiceName serviceName ) { } @ Override public synchronized void start ( final StartContext context ) throws StartException { } @ Override public synchronized void stop ( final StopContext context ) { } @ Override public synchronized TimerService getValue ( ) throws IllegalArgumentException , IllegalStateException { } @ Override public javax . ejb . Timer createCalendarTimer ( ScheduleExpression schedule ) throws IllegalArgumentException , IllegalStateException , EJBException { } @ Override public javax . ejb . Timer createCalendarTimer ( ScheduleExpression schedule , TimerConfig timerConfig ) throws IllegalArgumentException , IllegalStateException , EJBException { } @ Override public javax . ejb . Timer createIntervalTimer ( Date initialExpiration , long intervalDuration , TimerConfig timerConfig ) throws IllegalArgumentException , IllegalStateException , EJBException { } @ Override public javax . ejb . Timer createIntervalTimer ( long initialDuration , long intervalDuration , TimerConfig timerConfig ) throws IllegalArgumentException , IllegalStateException , EJBException { } @ Override public javax . ejb . Timer createSingleActionTimer ( Date expiration , TimerConfig timerConfig ) throws IllegalArgumentException , IllegalStateException , EJBException { } @ Override public javax . ejb . Timer createSingleActionTimer ( long duration , TimerConfig timerConfig ) throws IllegalArgumentException , IllegalStateException , EJBException { } @ Override public javax . ejb . Timer createTimer ( long duration , Serializable info ) throws IllegalArgumentException , IllegalStateException , EJBException { } @ Override public javax . ejb . Timer createTimer ( Date expiration , Serializable info ) throws IllegalArgumentException , IllegalStateException , EJBException { } @ Override public javax . ejb . Timer createTimer ( long initialDuration , long intervalDuration , Serializable info ) throws IllegalArgumentException , IllegalStateException , EJBException { } @ Override public javax . ejb . Timer createTimer ( Date initialExpiration , long intervalDuration , Serializable info ) throws IllegalArgumentException , IllegalStateException , EJBException { } public TimerImpl loadAutoTimer ( ScheduleExpression schedule , TimerConfig timerConfig , Method timeoutMethod ) { } @ Override public Collection < javax . ejb . Timer > getTimers ( ) throws IllegalStateException , EJBException { } private javax . ejb . Timer createTimer ( Date initialExpiration , long intervalDuration , Serializable info , boolean persistent ) { } private Object currentPrimaryKey ( ) { } private TimerImpl createCalendarTimer ( ScheduleExpression schedule , Serializable info , boolean persistent , Method timeoutMethod ) { } protected void addTimer ( TimerImpl timer ) { } public TimedObjectInvoker getInvoker ( ) { } public TimerImpl getTimer ( TimerHandle handle ) { } protected Transaction getTransaction ( ) { } public void persistTimer ( final TimerImpl timer , boolean newTimer ) { } public void suspendTimers ( ) { } public void restoreTimers ( final List < ScheduleTimer > autoTimers ) { } protected void startTimer ( TimerImpl timer ) { } protected void registerTimerWithTx ( TimerImpl timer ) { } private void registerSynchronization ( Synchronization synchronization ) { } boolean transactionActive ( ) { } private boolean isBeforeCompletion ( ) { } protected boolean isLifecycleCallbackInvocation ( ) { } protected void scheduleTimeout ( TimerImpl timer , boolean newTimer ) { } protected void cancelTimeout ( final TimerImpl timer ) { } private boolean isSingletonBeanInvocation ( ) { } private TimerImpl getPersistedTimer ( TimerHandleImpl timerHandle ) { String id = timerHandle . getId ( ) ; String timedObjectId = timerHandle . getTimedObjectId ( ) ; if ( ( timerPersistence ) == null ) { return null ; } final TimerEntity timerEntity = timerPersistence . getValue ( ) . loadTimer ( id , timedObjectId ) ; if ( timerEntity == null ) { <START_BUG> throw EjbLogger . EJB3_LOGGER . timerNotFound ( id ) ; <END_BUG> } if ( timerEntity . isCalendarTimer ( ) ) { return new CalendarTimer ( ( ( CalendarTimerEntity ) ( timerEntity ) ) , this ) ; } return new TimerImpl ( timerEntity , this ) ; } private List < TimerImpl > getActivePersistentTimers ( final Object primaryKey ) { } private Serializable clone ( final Serializable info ) throws Exception { } private boolean doesTimeoutMethodMatch ( final TimeoutMethod timeoutMethod , final String timeoutMethodName , final String [ ] methodParams ) { } private boolean doesScheduleMatch ( final ScheduleExpression expression1 , final ScheduleExpression expression2 ) { } private boolean same ( Object i1 , Object i2 ) { } private boolean isEitherParamNull ( Object param1 , Object param2 ) { } private boolean methodParamsMatch ( String [ ] methodParams , String [ ] otherMethodParams ) { } private void setRollbackOnly ( ) { } private void startNewTx ( ) { } private void assertTimerServiceState ( ) { } public InjectedValue < EJBComponent > getEjbComponentInjectedValue ( ) { } public InjectedValue < ExecutorService > getExecutorServiceInjectedValue ( ) { } public InjectedValue < Timer > getTimerInjectedValue ( ) { } public InjectedValue < TimerPersistence > getTimerPersistence ( ) { } public ServiceName getServiceName ( ) { } public boolean isStarted ( ) { } public InjectedValue < TimedObjectInvoker > getTimedObjectInvoker ( ) { } private class TimerCreationTransactionSynchronization implements Synchronization { private final TimerImpl timer ; public TimerCreationTransactionSynchronization ( TimerImpl timer ) { }

Fix:
throw EjbMessages . MESSAGES . timerNotFound ( id ) ;