Buggy code:
public class StatefulComponentDescription extends SessionBeanComponentDescription { private static final Logger logger = Logger . getLogger ( StatefulComponentDescription . class ) ; private Method afterBegin ; private Method afterCompletion ; private Method beforeCompletion ; private final Set < StatefulComponentDescription . StatefulRemoveMethod > removeMethods = new HashSet < StatefulComponentDescription . StatefulRemoveMethod > ( ) ; private StatefulTimeoutInfo statefulTimeout ; private DefaultAccessTimeoutService defaultAccessTimeoutProvider ; private Map < Method , String > initMethods = new HashMap < Method , String > ( 0 ) ; public class StatefulRemoveMethod { private final MethodIdentifier methodIdentifier ; private final boolean retainIfException ; StatefulRemoveMethod ( final MethodIdentifier method , final boolean retainIfException ) { } public MethodIdentifier getMethodIdentifier ( ) { } public boolean isRetainIfException ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } } public StatefulComponentDescription ( final String componentName , final String componentClassName , final EjbJarDescription ejbJarDescription , final ServiceName deploymentUnitServiceName ) { } private void addInitMethodInvokingInterceptor ( ) { } private void addStatefulSessionSynchronizationInterceptor ( ) { } @ Override public ComponentConfiguration createConfiguration ( final ClassIndex classIndex ) { } @ Override public boolean allowsConcurrentAccess ( ) { } public Method getAfterBegin ( ) { } public Method getAfterCompletion ( ) { } public Method getBeforeCompletion ( ) { } @ Override public SessionBeanType getSessionBeanType ( ) { } public void setAfterBegin ( final Method afterBegin ) { } public void setAfterCompletion ( final Method afterCompletion ) { } public void setBeforeCompletion ( final Method afterCompletion ) { } @ Override protected void setupViewInterceptors ( EJBViewDescription view ) { super . setupViewInterceptors ( view ) ; this . addRemoveMethodInterceptor ( view ) ; this . addStatefulInstanceAssociatingInterceptor ( view ) ; this . addViewSerializationInterceptor ( view ) ; if ( view instanceof EJBViewDescription ) { EJBViewDescription ejbViewDescription = ( ( EJBViewDescription ) ( view ) ) ; <START_BUG> if ( ( ( ejbViewDescription . getMethodIntf ( ) ) == ( MethodIntf . REMOTE ) ) || ( ( ejbViewDescription . getMethodIntf ( ) ) == ( MethodIntf . REMOTE ) ) ) { <END_BUG> view . getConfigurators ( ) . add ( new ViewConfigurator ( ) { @ Override public void configure ( final DeploymentPhaseContext context , final ComponentConfiguration componentConfiguration , final ViewDescription description , final ViewConfiguration configuration ) throws DeploymentUnitProcessingException { configuration . setViewInstanceFactory ( new StatefulRemoteViewInstanceFactory ( componentConfiguration . getApplicationName ( ) , componentConfiguration . getModuleName ( ) , componentConfiguration . getComponentDescription ( ) . getModuleDescription ( ) . getDistinctName ( ) , componentConfiguration . getComponentName ( ) ) ) ; } } ) ; } } } @ Override protected ViewConfigurator getSessionBeanObjectViewConfigurator ( ) { } private void addViewSerializationInterceptor ( final ViewDescription view ) { } public void addRemoveMethod ( final MethodIdentifier removeMethod , final boolean retainIfException ) { } public Set < StatefulComponentDescription . StatefulRemoveMethod > getRemoveMethods ( ) { } public StatefulTimeoutInfo getStatefulTimeout ( ) { } public void setStatefulTimeout ( final StatefulTimeoutInfo statefulTimeout ) { } private void addStatefulInstanceAssociatingInterceptor ( final ViewDescription view ) { } private void addRemoveMethodInterceptor ( final ViewDescription view ) { } public void addInitMethod ( final Method method , final String createMethod ) { } public Map < Method , String > getInitMethods ( ) { } }

Fix:
if ( ( ejbViewDescription . getMethodIntf ( ) ) == ( MethodIntf . REMOTE ) ) {