Buggy code:
public class PassivatingBackingCacheImpl < K extends Serializable , V extends Cacheable < K > , E extends BackingCacheEntry < K , V > > extends AbstractBackingCache < K , V , E > implements PassivatingBackingCache < K , V , E > { protected final Logger log = Logger . getLogger ( getClass ( ) . getName ( ) ) ; private final StatefulObjectFactory < V > factory ; private final BackingCacheEntryFactory < K , V , E > entryFactory ; private final ReplicationPassivationManager < K , E > passivationManager ; private final BackingCacheEntryStore < K , V , E > store ; private final ThreadFactory threadFactory ; private volatile ScheduledExecutorService executor ; private final Map < K , Future < ? > > expirationFutures = new ConcurrentHashMap < K , Future < ? > > ( ) ; private final Map < K , Future < ? > > passivationFutures = new ConcurrentHashMap < K , Future < ? > > ( ) ; public PassivatingBackingCacheImpl ( StatefulObjectFactory < V > factory , BackingCacheEntryFactory < K , V , E > entryFactory , ReplicationPassivationManager < K , E > passivationManager , BackingCacheEntryStore < K , V , E > store ) { } public PassivatingBackingCacheImpl ( StatefulObjectFactory < V > factory , BackingCacheEntryFactory < K , V , E > entryFactory , ReplicationPassivationManager < K , E > passivationManager , BackingCacheEntryStore < K , V , E > store , ThreadFactory threadFactory ) { } public PassivatingBackingCacheImpl ( StatefulObjectFactory < V > factory , BackingCacheEntryFactory < K , V , E > entryFactory , ReplicationPassivationManager < K , E > passivationManager , BackingCacheEntryStore < K , V , E > store , ScheduledExecutorService executor ) { } private PassivatingBackingCacheImpl ( StatefulObjectFactory < V > factory , BackingCacheEntryFactory < K , V , E > entryFactory , ReplicationPassivationManager < K , E > passivationManager , BackingCacheEntryStore < K , V , E > store , ThreadFactory threadFactory , ScheduledExecutorService executor ) { } @ Override public boolean isClustered ( ) { } @ Override public E create ( ) { } @ Override public E get ( K key ) throws NoSuchEJBException { } @ Override public void passivate ( K key ) { } @ Override public E peek ( K key ) throws NoSuchEJBException { } @ Override public E release ( K key ) { } @ Override public void discard ( K key ) { } @ Override public void remove ( K key ) { } private void cancelExpirationPassivation ( K id ) { } private void cancel ( Map < K , Future < ? > > futures , K id ) { } private void scheduleExpirationPassivation ( K id ) { if ( ( this . executor ) != null ) { StatefulTimeoutInfo timeout = this . store . getTimeout ( ) ; <START_BUG> if ( timeout != null ) { <END_BUG> this . schedule ( this . expirationFutures , id , this . removeTaskFactory , timeout . getValue ( ) , timeout . getTimeUnit ( ) ) ; } BackingCacheEntryStoreConfig config = this . store . getConfig ( ) ; this . schedule ( this . passivationFutures , id , this . passivateTaskFactory , config . getIdleTimeout ( ) , config . getIdleTimeoutUnit ( ) ) ; } } private void schedule ( Map < K , Future < ? > > futures , K id , PassivatingBackingCacheImpl . TaskFactory < K > factory , long time , TimeUnit unit ) { } @ Override public void start ( ) { } @ Override public void stop ( ) { } @ Override public GroupCompatibilityChecker getCompatibilityChecker ( ) { } interface TaskFactory < K > { Runnable createTask ( K id ) { } } private PassivatingBackingCacheImpl . TaskFactory < K > removeTaskFactory = new PassivatingBackingCacheImpl . TaskFactory < K > ( ) { @ Override public Runnable createTask ( K id ) { } } ; private PassivatingBackingCacheImpl . TaskFactory < K > passivateTaskFactory = new PassivatingBackingCacheImpl . TaskFactory < K > ( ) { @ Override public Runnable createTask ( K id ) { } } ; private void trace ( String pattern , Object ... args ) { } }

Fix:
if ( ( timeout != null ) && ( ( timeout . getValue ( ) ) != ( - 1 ) ) ) {