Buggy code:
public class FileTimerPersistence implements TimerPersistence , Service < FileTimerPersistence > { public static final ServiceName SERVICE_NAME = JBOSS . append ( "ejb3" , "timerService" , "fileTimerPersistence" ) ; private final boolean createIfNotExists ; private static final Logger logger = Logger . getLogger ( FileTimerPersistence . class ) ; private MarshallerFactory factory ; private MarshallingConfiguration configuration ; private final InjectedValue < TransactionManager > transactionManager = new InjectedValue < TransactionManager > ( ) ; private final InjectedValue < TransactionSynchronizationRegistry > transactionSynchronizationRegistry = new InjectedValue < TransactionSynchronizationRegistry > ( ) ; private final InjectedValue < ModuleLoader > moduleLoader = new InjectedValue < ModuleLoader > ( ) ; private final InjectedValue < String > baseDir = new InjectedValue < String > ( ) ; private final ConcurrentMap < String , Map < String , TimerEntity > > timers = new ConcurrentHashMap < String , Map < String , TimerEntity > > ( ) ; private final ConcurrentMap < String , Lock > locks = new ConcurrentHashMap < String , Lock > ( ) ; private final ConcurrentMap < String , String > directories = new ConcurrentHashMap < String , String > ( ) ; private volatile boolean started = false ; public FileTimerPersistence ( final boolean createIfNotExists ) { } @ Override public synchronized void start ( final StartContext context ) { } @ Override public void stop ( final StopContext context ) { } @ Override public FileTimerPersistence getValue ( ) throws IllegalArgumentException , IllegalStateException { } @ Override public void persistTimer ( final TimerEntity timerEntity ) { } @ Override public TimerEntity loadTimer ( final String id , final String timedObjectId ) { } @ Override public void removeTimer ( final TimerEntity timerEntity ) { } @ Override public List < TimerEntity > loadActiveTimers ( final String timedObjectId ) { } private Lock getLock ( final String timedObjectId ) { } private Map < String , TimerEntity > getTimers ( final String timedObjectId ) { } private Map < String , TimerEntity > loadTimersFromFile ( final String timedObjectId ) { } private File fileName ( String timedObjectId , String timerId ) { } private String getDirectory ( String timedObjectId ) { } private void writeFile ( TimerEntity entity ) { } private final class PersistTransactionSynchronization implements Synchronization { private final TimerEntity timer ; private final Lock lock ; public PersistTransactionSynchronization ( final TimerEntity timer , final Lock lock ) { } @ Override public void beforeCompletion ( ) { } @ Override public void afterCompletion ( final int status ) { try { lock . lock ( ) ; if ( status == ( Status . STATUS_COMMITTED ) ) { <START_BUG> Map < String , TimerEntity > map = getTimers ( timer . getTimedObjectId ( ) ) ; <END_BUG> map . put ( timer . getId ( ) , timer ) ; writeFile ( timer ) ; } } finally { lock . unlock ( ) ; } } } public InjectedValue < TransactionManager > getTransactionManager ( ) { } public InjectedValue < TransactionSynchronizationRegistry > getTransactionSynchronizationRegistry ( ) { } public InjectedValue < ModuleLoader > getModuleLoader ( ) { } public InjectedValue < String > getBaseDir ( ) { } }

Fix:
final Map < String , TimerEntity > map = getTimers ( timer . getTimedObjectId ( ) ) ;