Buggy code:
public class StatefulComponentInstanceInterceptor extends AbstractEJBInterceptor { private static final Logger log = Logger . getLogger ( StatefulComponentInstanceInterceptor . class ) ; private final AtomicReference < Serializable > sessionIdReference ; public StatefulComponentInstanceInterceptor ( AtomicReference < Serializable > sessionIdReference ) { } @ Override public Object processInvocation ( InterceptorContext context ) throws Exception { StatefulSessionComponent component = getComponent ( context , StatefulSessionComponent . class ) ; Serializable sessionId = this . sessionIdReference . get ( ) ; if ( sessionId == null ) { throw new IllegalStateException ( ( "Session<seq2seq4repair_space>id<seq2seq4repair_space>hasn't<seq2seq4repair_space>been<seq2seq4repair_space>set<seq2seq4repair_space>for<seq2seq4repair_space>stateful<seq2seq4repair_space>component:<seq2seq4repair_space>" + ( component . getComponentName ( ) ) ) ) ; } StatefulComponentInstanceInterceptor . log . debug ( ( "Looking<seq2seq4repair_space>for<seq2seq4repair_space>stateful<seq2seq4repair_space>component<seq2seq4repair_space>instance<seq2seq4repair_space>with<seq2seq4repair_space>session<seq2seq4repair_space>id:<seq2seq4repair_space>" + sessionId ) ) ; StatefulSessionComponentInstance instance = component . getCache ( ) . get ( sessionId ) ; try { context . putPrivateData ( ComponentInstance . class , instance ) ; return context . proceed ( ) ; } catch ( Exception ex ) { <START_BUG> if ( ( component . getApplicationException ( ex . getClass ( ) ) ) != null ) { <END_BUG> throw ex ; } if ( ( ex instanceof ConcurrentAccessTimeoutException ) || ( ex instanceof ConcurrentAccessException ) ) { throw ex ; } if ( ( ex instanceof RuntimeException ) || ( ex instanceof RemoteException ) ) { if ( StatefulComponentInstanceInterceptor . log . isTraceEnabled ( ) ) StatefulComponentInstanceInterceptor . log . trace ( ( ( "Removing<seq2seq4repair_space>bean<seq2seq4repair_space>" + sessionId ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>exception" ) , ex ) ; component . getCache ( ) . discard ( sessionId ) ; } throw ex ; } catch ( final Error e ) { if ( StatefulComponentInstanceInterceptor . log . isTraceEnabled ( ) ) StatefulComponentInstanceInterceptor . log . trace ( ( ( "Removing<seq2seq4repair_space>bean<seq2seq4repair_space>" + sessionId ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>error" ) , e ) ; component . getCache ( ) . discard ( sessionId ) ; throw e ; } catch ( final Throwable t ) { if ( StatefulComponentInstanceInterceptor . log . isTraceEnabled ( ) ) StatefulComponentInstanceInterceptor . log . trace ( ( ( "Removing<seq2seq4repair_space>bean<seq2seq4repair_space>" + sessionId ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>Throwable" ) , t ) ; component . getCache ( ) . discard ( sessionId ) ; throw new RuntimeException ( t ) ; } finally { context . putPrivateData ( ComponentInstance . class , null ) ; } } static StatefulSessionComponentInstance getComponentInstance ( InterceptorContext context ) { } }

Fix:
if ( ( component . getApplicationException ( ex . getClass ( ) , context . getMethod ( ) ) ) != null ) {