Buggy code:
public class RegistrySharedObject extends BaseSharedObject implements IRemoteServiceContainerAdapter { protected RemoteServiceRegistryImpl localRegistry ; protected final Map remoteRegistrys = Collections . synchronizedMap ( new HashMap ( ) ) ; protected final List serviceListeners = new ArrayList ( ) ; protected final Map localServiceRegistrations = new HashMap ( ) ; protected Map addRegistrationRequests = new Hashtable ( ) ; protected int addRegistrationRequestTimeout = RegistrySharedObject . ADD_REGISTRATION_REQUEST_TIMEOUT ; protected List requests = Collections . synchronizedList ( new ArrayList ( ) ) ; protected IConnectContext connectContext ; public RegistrySharedObject ( ) { } public void dispose ( ID containerID ) { } public void addRemoteServiceListener ( IRemoteServiceListener listener ) { } public void removeRemoteServiceListener ( IRemoteServiceListener listener ) { } public IRemoteService getRemoteService ( IRemoteServiceReference reference ) { } private void addReferencesFromRemoteRegistrys ( ID [ ] idFilter , String clazz , IRemoteFilter remoteFilter , List referencesFound ) { } protected int getAddRegistrationRequestTimeout ( ) { } public IRemoteServiceReference [ ] getAllRemoteServiceReferences ( String clazz , String filter ) throws InvalidSyntaxException { } public IRemoteServiceReference [ ] getRemoteServiceReferences ( ID targetID , String clazz , String filter ) throws ContainerConnectException , InvalidSyntaxException { } public IRemoteServiceReference [ ] getRemoteServiceReferences ( ID [ ] idFilter , String clazz , String filter ) throws InvalidSyntaxException { } protected Serializable getAddRegistrationRequestCredentials ( AddRegistrationRequest request ) { } protected ID [ ] getTargetsFromProperties ( Dictionary properties ) { } public IRemoteServiceRegistration registerRemoteService ( String [ ] clazzes , Object service , Dictionary properties ) { } public boolean ungetRemoteService ( IRemoteServiceReference ref ) { } protected ISharedObjectContext getSOContext ( ) { } public void initialize ( ) throws SharedObjectInitException { } protected void handleContainerDisconnectedEvent ( IContainerDisconnectedEvent event ) { } protected void sendRegistryUpdate ( ID targetContainerID ) { } protected void handleContainerConnectedEvent ( IContainerConnectedEvent event ) { } private Request createRequest ( RemoteServiceRegistrationImpl remoteRegistration , IRemoteCall call , IRemoteCallListener listener ) { } protected void fireRemoteServiceListeners ( IRemoteServiceEvent event ) { } private RemoteServiceRegistrationImpl getRemoteServiceRegistrationImpl ( IRemoteServiceReference reference ) { } private void addReferencesFromRegistry ( String clazz , IRemoteFilter remoteFilter , RemoteServiceRegistryImpl registry , List references ) { } protected Object callSynch ( RemoteServiceRegistrationImpl registration , IRemoteCall call ) throws ECFException { Trace . entering ( PLUGIN_ID , METHODS_ENTERING , this . getClass ( ) , "callSynch" , new Object [ ] { registration , call } ) ; boolean doneWaiting = false ; Response response = null ; try { final Request request = sendCallRequest ( registration , call ) ; final long timeout = ( call . getTimeout ( ) ) + ( System . currentTimeMillis ( ) ) ; while ( ( ( timeout - ( System . currentTimeMillis ( ) ) ) > 0 ) && ( ! doneWaiting ) ) { synchronized ( request ) { if ( request . isDone ( ) ) { Trace . trace ( PLUGIN_ID , ( ( Messages . RegistrySharedObject_15 ) + request ) ) ; doneWaiting = true ; response = request . getResponse ( ) ; if ( response == null ) throw new ECFException ( Messages . RegistrySharedObject_EXCEPTION_INVALID_RESPONSE ) ; } else { Trace . trace ( PLUGIN_ID , ( ( ( "Waiting<seq2seq4repair_space>" + ( RegistrySharedObject . RESPONSE_WAIT_INTERVAL ) ) + "<seq2seq4repair_space>for<seq2seq4repair_space>response<seq2seq4repair_space>to<seq2seq4repair_space>request:<seq2seq4repair_space>" ) + request ) ) ; request . wait ( RegistrySharedObject . RESPONSE_WAIT_INTERVAL ) ; } } } if ( ! doneWaiting ) <START_BUG> throw new ECFException ( ( ( ( Messages . RegistrySharedObject_19 ) + ( call . getTimeout ( ) ) ) + ( Messages . RegistrySharedObject_20 ) ) ) ; <END_BUG> } catch ( final IOException e ) { log ( RegistrySharedObject . CALL_REQUEST_ERROR_CODE , RegistrySharedObject . CALL_REQUEST_ERROR_MESSAGE , e ) ; throw new ECFException ( Messages . RegistrySharedObject_EXCEPTION_SENDING_REQUEST , e ) ; } catch ( final InterruptedException e ) { log ( RegistrySharedObject . CALL_REQUEST_TIMEOUT_ERROR_CODE , RegistrySharedObject . CALL_REQUEST_TIMEOUT_ERROR_MESSAGE , e ) ; throw new ECFException ( Messages . RegistrySharedObject_EXCEPTION_WAIT_INTERRUPTED , e ) ; } Object result = null ; if ( response . hadException ( ) ) throw new ECFException ( Messages . RegistrySharedObject_EXCEPTION_IN_REMOTE_CALL , response . getException ( ) ) ; result = response . getResponse ( ) ; Trace . exiting ( PLUGIN_ID , METHODS_EXITING , this . getClass ( ) , "callSynch" , result ) ; return result ; } protected void fireCallStartEvent ( IRemoteCallListener listener , final long requestId , final IRemoteServiceReference reference , final IRemoteCall call ) { } protected void fireCallCompleteEvent ( IRemoteCallListener listener , final long requestId , final Object response , final boolean hadException , final Throwable exception ) { } static String checkServiceClass ( final String [ ] clazzes , final Object serviceObject ) { } private static boolean extensiveCheckServiceClass ( String clazz , Class serviceClazz ) { } 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" ;

Fix:
throw new ECFException ( NLS . bind ( RegistrySharedObject_19 , Long . toString ( call . getTimeout ( ) ) ) , new TimeoutException ( call . getTimeout ( ) ) ) ;