Buggy code:
public class EjbObjectCorbaServant extends Servant implements LocalIIOPInvoker , InvokeHandler { private static final Logger logger = Logger . getLogger ( EjbObjectCorbaServant . class ) ; private final ComponentView componentView ; private final ORB orb ; private final Current poaCurrent ; private final Map < String , SkeletonStrategy > methodInvokerMap ; private final String [ ] repositoryIds ; private final InterfaceDef interfaceDef ; private final SASCurrent sasCurrent ; private final InboundTransactionCurrent inboundTxCurrent ; private final TransactionManager transactionManager ; private final MarshallerFactory factory ; private final MarshallingConfiguration configuration ; private final ClassLoader classLoader ; public EjbObjectCorbaServant ( final Current poaCurrent , final Map < String , SkeletonStrategy > methodInvokerMap , final String [ ] repositoryIds , final InterfaceDef interfaceDef , final ORB orb , final ComponentView componentView , final MarshallerFactory factory , final MarshallingConfiguration configuration , final TransactionManager transactionManager , final ClassLoader classLoader ) { } public Object _get_interface_def ( ) { } public String [ ] _all_interfaces ( POA poa , byte [ ] objectId ) { } public OutputStream _invoke ( final String opName , final InputStream in , final ResponseHandler handler ) { if ( EjbObjectCorbaServant . logger . isTraceEnabled ( ) ) { EjbObjectCorbaServant . logger . trace ( ( "EJBObject<seq2seq4repair_space>invocation:<seq2seq4repair_space>" + opName ) ) ; } SkeletonStrategy op = methodInvokerMap . get ( opName ) ; if ( op == null ) { EjbObjectCorbaServant . logger . debug ( ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>opname<seq2seq4repair_space>'" + opName ) + "'<seq2seq4repair_space>valid<seq2seq4repair_space>operations:" ) + ( methodInvokerMap . keySet ( ) ) ) ) ; throw new BAD_OPERATION ( opName ) ; } final NamespaceContextSelector selector = componentView . getComponent ( ) . getNamespaceContextSelector ( ) ; final ClassLoader oldCl = SecurityActions . getContextClassLoader ( ) ; NamespaceContextSelector . pushCurrentSelector ( selector ) ; try { SecurityActions . setContextClassLoader ( classLoader ) ; org . omg . CORBA_2_3 . portable . OutputStream out ; try { <START_BUG> final Object retVal ; <END_BUG> if ( opName . equals ( "_get_handle" ) ) { retVal = new HandleImplIIOP ( orb . object_to_string ( _this_object ( ) ) ) ; } else { Transaction tx = null ; if ( ( inboundTxCurrent ) != null ) tx = inboundTxCurrent . getCurrentTransaction ( ) ; if ( tx != null ) { transactionManager . resume ( tx ) ; } try { SimplePrincipal principal = null ; char [ ] password = null ; if ( ( sasCurrent ) != null ) { final byte [ ] username = sasCurrent . get_incoming_username ( ) ; final byte [ ] credential = sasCurrent . get_incoming_password ( ) ; String name = new String ( username , "UTF-8" ) ; int domainIndex = name . indexOf ( '@' ) ; if ( domainIndex > 0 ) name = name . substring ( 0 , domainIndex ) ; if ( ( name . length ( ) ) == 0 ) { final byte [ ] incomingName = sasCurrent . get_incoming_principal_name ( ) ; if ( ( incomingName . length ) > 0 ) { name = new String ( incomingName , "UTF-8" ) ; domainIndex = name . indexOf ( '@' ) ; if ( domainIndex > 0 ) name = name . substring ( 0 , domainIndex ) ; principal = new SimplePrincipal ( name ) ; password = name . toCharArray ( ) ; } } else { principal = new SimplePrincipal ( name ) ; password = new String ( credential , "UTF-8" ) . toCharArray ( ) ; } } final Object [ ] params = op . readParams ( ( ( org . omg . CORBA_2_3 . portable . InputStream ) ( in ) ) ) ; if ( ( opName . equals ( "isIdentical" ) ) && ( ( params . length ) == 1 ) ) { Object val = params [ 0 ] ; if ( val instanceof Object ) { retVal = handleIsIdentical ( ( ( Object ) ( val ) ) ) ; } else { retVal = false ; } } else { final SecurityContext sc = SecurityContextFactory . createSecurityContext ( "CORBA_REMOTE" ) ; sc . getUtil ( ) . createSubjectInfo ( principal , password , null ) ; final InterceptorContext interceptorContext = new InterceptorContext ( ) ; if ( ( componentView . getComponent ( ) ) instanceof StatefulSessionComponent ) { final SessionID sessionID = ( ( SessionID ) ( unmarshalIdentifier ( ) ) ) ; interceptorContext . putPrivateData ( SESSION_ID_KEY , sessionID ) ; } else if ( ( componentView . getComponent ( ) ) instanceof EntityBeanComponent ) { final Object pk = unmarshalIdentifier ( ) ; interceptorContext . putPrivateData ( PRIMARY_KEY_CONTEXT_KEY , pk ) ; } interceptorContext . setContextData ( new HashMap < String , Object > ( ) ) ; interceptorContext . setParameters ( params ) ; interceptorContext . setMethod ( op . getMethod ( ) ) ; interceptorContext . putPrivateData ( ComponentView . class , componentView ) ; interceptorContext . putPrivateData ( Component . class , componentView . getComponent ( ) ) ; retVal = componentView . invoke ( interceptorContext ) ; } } finally { if ( tx != null ) { if ( ( transactionManager . getStatus ( ) ) != ( Status . STATUS_NO_TRANSACTION ) ) { transactionManager . suspend ( ) ; } } } } out = ( ( org . omg . CORBA_2_3 . portable . OutputStream ) ( handler . createReply ( ) ) ) ; if ( op . isNonVoid ( ) ) { op . writeRetval ( out , retVal ) ; } } catch ( Exception e ) { if ( EjbObjectCorbaServant . logger . isTraceEnabled ( ) ) { EjbObjectCorbaServant . logger . trace ( "Exception<seq2seq4repair_space>in<seq2seq4repair_space>EJBObject<seq2seq4repair_space>invocation" , e ) ; } if ( e instanceof MBeanException ) { e = ( ( MBeanException ) ( e ) ) . getTargetException ( ) ; } RmiIdlUtil . rethrowIfCorbaSystemException ( e ) ;

Fix:
Object retVal ;