Buggy code:
public class IIOPReferenceContextWrapper implements Context { private static Context iiopContext = null ; private static Hashtable wrapperHash = null ; public IIOPReferenceContextWrapper ( Context iiopCtx ) throws NamingException { } private Object resolveObject ( Object o ) throws NamingException { } private Object encodeObject ( Object o , Object name , boolean replace ) throws NamingException { try { if ( ( ! ( o instanceof Remote ) ) && ( o instanceof Referenceable ) ) { IIOPReferenceWrapper irw = new IIOPReferenceWrapper ( ( ( Referenceable ) ( o ) ) . getReference ( ) ) ; ProtocolCurrent . getCurrent ( ) . getCurrentPortableRemoteObject ( ) . exportObject ( irw ) ; IIOPReferenceWrapper oldObj = ( ( IIOPReferenceWrapper ) ( IIOPReferenceContextWrapper . wrapperHash . put ( name , irw ) ) ) ; if ( oldObj != null ) { if ( replace ) { ProtocolCurrent . getCurrent ( ) . getCurrentPortableRemoteObject ( ) . unexportObject ( oldObj ) ; } else { ProtocolCurrent . getCurrent ( ) . getCurrentPortableRemoteObject ( ) . unexportObject ( irw ) ; IIOPReferenceContextWrapper . wrapperHash . put ( name , oldObj ) ; throw new NamingException ( "Object<seq2seq4repair_space>already<seq2seq4repair_space>bind" ) ; } } return irw ; <START_BUG> } <END_BUG> if ( ( ! ( o instanceof Remote ) ) && ( o instanceof Reference ) ) { IIOPReferenceWrapper irw = new IIOPReferenceWrapper ( ( ( Reference ) ( o ) ) ) ; ProtocolCurrent . getCurrent ( ) . getCurrentPortableRemoteObject ( ) . exportObject ( irw ) ; IIOPReferenceWrapper oldObj = ( ( IIOPReferenceWrapper ) ( IIOPReferenceContextWrapper . wrapperHash . put ( name , irw ) ) ) ; if ( oldObj != null ) { if ( replace ) { ProtocolCurrent . getCurrent ( ) . getCurrentPortableRemoteObject ( ) . unexportObject ( oldObj ) ; } else { ProtocolCurrent . getCurrent ( ) . getCurrentPortableRemoteObject ( ) . unexportObject ( irw ) ; IIOPReferenceContextWrapper . wrapperHash . put ( name , oldObj ) ; throw new NamingException ( "Object<seq2seq4repair_space>already<seq2seq4repair_space>bind" ) ; } } return irw ; } else if ( ( ! ( o instanceof Remote ) ) && ( o instanceof Serializable ) ) { IIOPResourceWrapper irw = new IIOPResourceWrapper ( ( ( Serializable ) ( o ) ) ) ; ProtocolCurrent . getCurrent ( ) . getCurrentPortableRemoteObject ( ) . exportObject ( irw ) ; IIOPResourceWrapper oldObj = ( ( IIOPResourceWrapper ) ( IIOPReferenceContextWrapper . wrapperHash . put ( name , irw ) ) ) ; if ( oldObj != null ) { if ( replace ) { ProtocolCurrent . getCurrent ( ) . getCurrentPortableRemoteObject ( ) . unexportObject ( oldObj ) ; } else { ProtocolCurrent . getCurrent ( ) . getCurrentPortableRemoteObject ( ) . unexportObject ( irw ) ; IIOPReferenceContextWrapper . wrapperHash . put ( name , oldObj ) ; throw new NamingException ( "Object<seq2seq4repair_space>already<seq2seq4repair_space>bind" ) ; } } return irw ; } else { return o ; } } catch ( Exception e ) { throw new NamingException ( ( "" + e ) ) ; } } public Object lookup ( String name ) throws NamingException { } public Object lookup ( Name name ) throws NamingException { } public void bind ( String name , Object obj ) throws NamingException { } public void bind ( Name name , Object obj ) throws NamingException { } public void rebind ( String name , Object obj ) throws NamingException { } public void rebind ( Name name , Object obj ) throws NamingException { } public void unbind ( String name ) throws NamingException { } public void unbind ( Name name ) throws NamingException { } public void rename ( String oldName , String newName ) throws NamingException { } public void rename ( Name oldName , Name newName ) throws NamingException { } public NamingEnumeration list ( String name ) throws NamingException { } public NamingEnumeration list ( Name name ) throws NamingException { } public NamingEnumeration listBindings ( String name ) throws NamingException { } public NamingEnumeration listBindings ( Name name ) throws NamingException { } public void destroySubcontext ( String name ) throws NamingException { } public void destroySubcontext ( Name name ) throws NamingException { } public Context createSubcontext ( String name ) throws NamingException { } public Context createSubcontext ( Name name ) throws NamingException { } public Object lookupLink ( String name ) throws NamingException { } public Object lookupLink ( Name name ) throws NamingException { } public NameParser getNameParser ( String name ) throws NamingException { } public NameParser getNameParser ( Name name ) throws NamingException { } public String composeName ( String name , String prefix ) throws NamingException { } public Name composeName ( Name name , Name prefix ) throws NamingException { } public Object addToEnvironment ( String propName , Object propVal ) throws NamingException { } public Object removeFromEnvironment ( String propName ) throws NamingException { } public Hashtable getEnvironment ( ) throws NamingException { } public void close ( ) throws NamingException { } public String getNameInNamespace ( ) throws NamingException { } }

Fix:
} else