Buggy code:
public final class WebAsyncManager { private static final Object RESULT_NONE = new Object ( ) ; private static final Log logger = LogFactory . getLog ( WebAsyncManager . class ) ; private AsyncWebRequest asyncWebRequest ; private AsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor ( this . getClass ( ) . getSimpleName ( ) ) ; private Object concurrentResult = WebAsyncManager . RESULT_NONE ; private Object [ ] concurrentResultContext ; private final Map < Object , CallableProcessingInterceptor > callableInterceptors = new LinkedHashMap < Object , CallableProcessingInterceptor > ( ) ; private final Map < Object , DeferredResultProcessingInterceptor > deferredResultInterceptors = new LinkedHashMap < Object , DeferredResultProcessingInterceptor > ( ) ; private static final UrlPathHelper urlPathHelper = new UrlPathHelper ( ) ; WebAsyncManager ( ) { } public void setAsyncWebRequest ( final AsyncWebRequest asyncWebRequest ) { } public void setTaskExecutor ( AsyncTaskExecutor taskExecutor ) { } public boolean isConcurrentHandlingStarted ( ) { } public boolean hasConcurrentResult ( ) { } public Object getConcurrentResult ( ) { } public Object [ ] getConcurrentResultContext ( ) { } public CallableProcessingInterceptor getCallableInterceptor ( Object key ) { } public DeferredResultProcessingInterceptor getDeferredResultInterceptor ( Object key ) { } public void registerCallableInterceptor ( Object key , CallableProcessingInterceptor interceptor ) { } public void registerDeferredResultInterceptor ( Object key , DeferredResultProcessingInterceptor interceptor ) { } public void clearConcurrentResult ( ) { } public void startCallableProcessing ( final Callable < ? > callable , Object ... processingContext ) { } public void startCallableProcessing ( AsyncTask < ? > asyncTask , Object ... processingContext ) { } public void startDeferredResultProcessing ( final DeferredResult < ? > deferredResult , Object ... processingContext ) throws Exception { Assert . notNull ( deferredResult , "DeferredResult<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; Long timeout = deferredResult . getTimeoutMilliseconds ( ) ; if ( timeout != null ) { this . asyncWebRequest . setTimeout ( timeout ) ; } if ( deferredResult . hasTimeoutResult ( ) ) { this . asyncWebRequest . setTimeoutHandler ( new Runnable ( ) { public void run ( ) { deferredResult . applyTimeoutResult ( ) ; } } ) ; } final DeferredResultInterceptorChain chain = new DeferredResultInterceptorChain ( this . deferredResultInterceptors . values ( ) ) ; chain . applyPreProcess ( this . asyncWebRequest , deferredResult ) ; this . asyncWebRequest . addCompletionHandler ( new Runnable ( ) { public void run ( ) { <START_BUG> if ( ! ( deferredResult . getAndSetExpired ( ) ) ) { <END_BUG> chain . triggerAfterExpiration ( asyncWebRequest , deferredResult ) ; } } } ) ; startAsyncProcessing ( processingContext ) ; deferredResult . setResultHandler ( new DeferredResultHandler ( ) { public void handleResult ( Object result ) { concurrentResult = result ; if ( WebAsyncManager . logger . isDebugEnabled ( ) ) { WebAsyncManager . logger . debug ( ( ( "Deferred<seq2seq4repair_space>result<seq2seq4repair_space>value<seq2seq4repair_space>[" + ( concurrentResult ) ) + "]" ) ) ; } chain . applyPostProcess ( asyncWebRequest , deferredResult , result ) ; WebAsyncManager . logger . debug ( "Dispatching<seq2seq4repair_space>request<seq2seq4repair_space>to<seq2seq4repair_space>complete<seq2seq4repair_space>processing" ) ; asyncWebRequest . dispatch ( ) ; } } ) ; } private void startAsyncProcessing ( Object [ ] processingContext ) { } }

Fix:
if ( deferredResult . expire ( ) ) {