Buggy code:
private static final String FIRE_REQUEST = "handleFireRequest" ; private static final String FIRE_REQUEST_ERROR_MESSAGE = Messages . RegistrySharedObject_EXCEPTION_SENDING_FIRE_REQUEST ; private static final int FIRE_REQUEST_ERROR_CODE = 202 ; private static final String CALL_REQUEST = "handleCallRequest" ; private static final String CALL_REQUEST_ERROR_MESSAGE = Messages . RegistrySharedObject_EXCEPTION_SENDING_CALL_REQUEST ; private static final int CALL_REQUEST_ERROR_CODE = 203 ; private static final String CALL_REQUEST_TIMEOUT_ERROR_MESSAGE = Messages . RegistrySharedObject_EXCEPTION_TIMEOUT_FOR_CALL_REQUEST ; private static final int CALL_REQUEST_TIMEOUT_ERROR_CODE = 204 ; private static final String UNREGISTER = "handleUnregister" ; private static final String UNREGISTER_ERROR_MESSAGE = Messages . RegistrySharedObject_EXCEPTION_SENDING_SERVICE_UNREGISTER ; private static final int UNREGISTER_ERROR_CODE = 206 ; private static final String MSG_INVOKE_ERROR_MESSAGE = Messages . RegistrySharedObject_EXCEPTION_SHARED_OBJECT_INVOKE ; private static final int MSG_INVOKE_ERROR_CODE = 207 ; private static final String SERVICE_INVOKE_ERROR_MESSAGE = Messages . RegistrySharedObject_EXCEPTION_INVOKING_SERVICE ; private static final int SERVICE_INVOKE_ERROR_CODE = 208 ; private static final String HANDLE_REQUEST_ERROR_MESSAGE = Messages . RegistrySharedObject_EXCEPTION_LOCALLY_INVOKING_REMOTE_CALL ; private static final int HANDLE_REQUEST_ERROR_CODE = 209 ; private static final String CALL_RESPONSE = "handleCallResponse" ; private static final String CALL_RESPONSE_ERROR_MESSAGE = Messages . RegistrySharedObject_EXCEPTION_SENDING_RESPONSE ; private static final int CALL_RESPONSE_ERROR_CODE = 210 ; private static final String REQUEST_NOT_FOUND_ERROR_MESSAGE = Messages . RegistrySharedObject_EXCEPTION_REQUEST_NOT_FOUND ; private static final int REQUEST_NOT_FOUND_ERROR_CODE = 211 ; private static final long RESPONSE_WAIT_INTERVAL = 5000 ; private static final String ADD_REGISTRATION = "handleAddRegistration" ; private static final String ADD_REGISTRATION_ERROR_MESSAGE = Messages . RegistrySharedObject_EXCEPTION_SENDING_ADD_SERVICE ; private static final int ADD_REGISTRATION_ERROR_CODE = 212 ; private static final String ADD_REGISTRATION_REFUSED = "handleAddRegistrationRefused" ; private static final String ADD_REGISTRATION_REFUSED_ERROR_MESSAGE = "Error<seq2seq4repair_space>sending<seq2seq4repair_space>addRegistration<seq2seq4repair_space>refused" ; private static final int ADD_REGISTRATION_REFUSED_ERROR_CODE = 214 ; private static final String REQUEST_SERVICE = "handleRequestService" ; private static final int REQUEST_SERVICE_ERROR_CODE = 213 ; private static final String REQUEST_SERVICE_ERROR_MESSAGE = "Error<seq2seq4repair_space>sending<seq2seq4repair_space>requestServiceReference" ; private static final String REGISTRY_UPDATE_REQUEST = "handleRegistryUpdateRequest" ; private static final int ADD_REGISTRATION_REQUEST_TIMEOUT = 10000 ; protected void sendRegistryUpdateRequest ( ) { } protected void handleRegistryUpdateRequest ( ID remoteContainerID ) { } protected AddRegistrationRequest sendAddRegistrationRequest ( ID receiver , AddRegistrationRequest request , Serializable credentials ) { } protected void checkRequestServiceAuthorization ( ID remoteContainerID , AddRegistrationRequest request , Serializable credentials ) throws AccessControlException { } protected void handleRequestService ( ID remoteContainerID , AddRegistrationRequest request , Integer requestId , Serializable credentials ) { } protected void sendAddRegistration ( ID receiver , RemoteServiceRegistrationImpl reg ) { } protected void sendAddRegistration ( ID receiver , Integer requestId , RemoteServiceRegistrationImpl reg ) { } protected void sendAddRegistrationRequestRefused ( ID receiver , Integer requestId , Exception except ) { } protected void handleAddRegistrationRequestRefused ( ID remoteContainerID , Integer requestId , AccessControlException e ) { } protected void handleAddRegistration ( ID remoteContainerID , final RemoteServiceRegistrationImpl registration ) { } protected void handleAddRegistration ( ID remoteContainerID , Integer requestId , final RemoteServiceRegistrationImpl registration ) { } private void notifyAddRegistrationResponse ( Integer requestId , AccessControlException exception ) { } private void localRegisterService ( RemoteServiceRegistrationImpl registration ) { final Object localServiceRegistrationValue = registration . getProperty ( AUTOREGISTER_REMOTE_PROXY ) ; if ( localServiceRegistrationValue != null ) { final BundleContext context = Activator . getDefault ( ) . getContext ( ) ; if ( context == null ) return ; final RemoteServiceImpl remoteServiceImpl = new RemoteServiceImpl ( this , registration ) ; Object service ; try { service = remoteServiceImpl . getProxy ( ) ; } catch ( final ECFException e ) { e . printStackTrace ( ) ; log ( "localRegisterService" , e ) ; return ; } final Hashtable properties = new Hashtable ( ) ; final String [ ] keys = registration . getPropertyKeys ( ) ; for ( int i = 0 ; i < ( keys . length ) ; i ++ ) { final Object value = registration . getProperty ( keys [ i ] ) ; if ( value != null ) { properties . put ( keys [ i ] , value ) ; } } final ID remoteContainerID = registration . getContainerID ( ) ; <START_BUG> properties . put ( REMOTE_SERVICE_CONTAINER_ID , remoteContainerID . getName ( ) ) ; <END_BUG> final ServiceRegistration serviceRegistration = context . registerService ( registration . getClasses ( ) , service , properties ) ; addLocalServiceRegistration ( remoteContainerID , serviceRegistration ) ; } } private void addLocalServiceRegistration ( ID remoteContainerID , ServiceRegistration registration ) { } protected Request sendCallRequest ( RemoteServiceRegistrationImpl remoteRegistration , final IRemoteCall call ) throws IOException { } protected void handleCallRequest ( Request request ) { } protected void sendCallRequestWithListener ( RemoteServiceRegistrationImpl remoteRegistration , IRemoteCall call , IRemoteCallListener listener ) { } protected void sendCallResponse ( ID responseTarget , Response response ) { } protected void handleCallResponse ( Response response ) { } protected Request sendFireRequest ( RemoteServiceRegistrationImpl remoteRegistration , IRemoteCall call ) throws ECFException { } protected void handleFireRequest ( Request request ) { } protected void sendUnregister ( RemoteServiceRegistrationImpl serviceRegistration ) { } private void unregisterServiceRegistrationsForContainer ( ID containerID ) { } private void unregisterAllServiceRegistrations ( ) { } protected void handleUnregister ( ID containerID , Long serviceId ) { } protected IRemoteServiceUnregisteredEvent createUnregisteredEvent ( final RemoteServiceRegistrationImpl registration ) { } protected IRemoteServiceRegisteredEvent createRegisteredEvent ( final RemoteServiceRegistrationImpl registration ) { } protected RemoteServiceRegistryImpl addRemoteRegistry ( RemoteServiceRegistryImpl registry ) { } protected RemoteServiceRegistryImpl getRemoteRegistry ( ID containerID ) { } protected RemoteServiceRegistryImpl removeRemoteRegistry ( ID containerID ) { } private RemoteServiceRegistrationImpl getLocalRegistrationForRequest ( Request request ) { } private boolean addRequest ( Request request ) { } private Request getRequest ( long requestId ) { } private boolean removeRequest ( Request request ) { } protected void logException ( int code , String message , Throwable e ) { } protected boolean handleSharedObjectMsg ( SharedObjectMsg msg ) { } IProgressMonitor progressMonitor = Job . getJobManager ( ) . createProgressGroup ( ) ; public IFuture asyncGetRemoteServiceReferences ( final ID [ ] idFilter , final String clazz , final String filter ) { } public Namespace getRemoteServiceNamespace ( ) { } public IRemoteFilter createRemoteFilter ( String filter ) throws InvalidSyntaxException { } public IRemoteServiceReference getRemoteServiceReference ( IRemoteServiceID serviceId ) { } public IRemoteServiceID getRemoteServiceID ( ID containerId , long containerRelativeId ) { }

Fix:
properties . put ( SERVICE_CONTAINER_ID , remoteContainerID . getName ( ) ) ;