Buggy code:
public class DiscoveredServiceTrackerImpl implements DiscoveredServiceTracker { private DistributionProviderImpl distributionProvider ; private IExecutor executor ; private List serviceLocations = new ArrayList ( ) ; private Map discoveredRemoteServiceRegistrations = Collections . synchronizedMap ( new HashMap ( ) ) ; private List ecfRemoteServiceProperties = Arrays . asList ( new String [ ] { Constants . SERVICE_ID , Constants . OBJECTCLASS , Constants . SERVICE_ID , Constants . SERVICE_CONTAINER_ID , Constants . SERVICE_RANKING , RemoteServicePublication . ENDPOINT_ID , RemoteServicePublication . ENDPOINT_INTERFACE_NAME , RemoteServicePublication . ENDPOINT_LOCATION , RemoteServicePublication . SERVICE_INTERFACE_NAME , RemoteServicePublication . SERVICE_INTERFACE_VERSION , RemoteServicePublication . SERVICE_PROPERTIES , "service.uri" } ) ; public DiscoveredServiceTrackerImpl ( DistributionProviderImpl dp , IExecutor executor ) { } public void serviceChanged ( final DiscoveredServiceNotification notification ) { } private boolean isValidService ( RemoteServiceEndpointDescription desc ) { } private IRemoteServiceContainer [ ] findRemoteServiceContainers ( final IServiceID serviceID , final IRemoteServiceEndpointDescription description , final IProgressMonitor monitor ) { } private void handleDiscoveredServiceAvailable ( RemoteServiceEndpointDescription ecfSED , IProgressMonitor monitor ) { } private void firePreGetRemoteServiceReferences ( final IRemoteServiceEndpointDescription endpointDescription , final IRemoteServiceContainer remoteServiceContainer ) { } private void firePreRegister ( final IRemoteServiceEndpointDescription endpointDescription , final IRemoteServiceContainer remoteServiceContainer , final IRemoteServiceReference remoteServiceReference ) { } private void firePostRegister ( final IRemoteServiceEndpointDescription endpointDescription , final IRemoteServiceContainer remoteServiceContainer , final IRemoteServiceReference remoteServiceReference , final ServiceRegistration serviceRegistration ) { } private void fireUnregister ( final IRemoteServiceEndpointDescription endpointDescription , final ServiceRegistration registration ) { } private RemoteServiceEndpointDescription getECFserviceEndpointDescription ( ServiceEndpointDescription aServiceEndpointDesc ) { } private boolean findProxyServiceRegistration ( RemoteServiceEndpointDescription sed ) { } private ServiceRegistration [ ] removeProxyServiceRegistrations ( ServiceEndpointDescription sed ) { } class RemoteServiceReferenceUnregisteredListener implements IRemoteServiceListener { public void handleServiceEvent ( IRemoteServiceEvent event ) { } } private void unregisterProxyServiceRegistration ( IRemoteServiceEndpointDescription endpointDescription , ServiceRegistration reg ) { } private void registerRemoteServiceReferences ( RemoteServiceEndpointDescription sed , IRemoteServiceContainer ch , IRemoteServiceReference [ ] remoteReferences ) { } private boolean isRemoteServiceProperty ( String propertyKey ) { } private Dictionary getPropertiesForRemoteService ( ServiceEndpointDescription description , IRemoteServiceContainerAdapter containerAdapter , IRemoteServiceReference remoteReference , IRemoteService remoteService ) { Properties results = new Properties ( ) ; String [ ] propKeys = remoteReference . getPropertyKeys ( ) ; for ( int i = 0 ; i < ( propKeys . length ) ; i ++ ) { if ( ! ( isRemoteServiceProperty ( propKeys [ i ] ) ) ) { results . put ( propKeys [ i ] , remoteReference . getProperty ( propKeys [ i ] ) ) ; } } results . put ( ENDPOINT_ID , ( ( ( remoteReference . getProperty ( SERVICE_CONTAINER_ID ) ) + "#" ) + ( remoteReference . getProperty ( SERVICE_ID ) ) ) ) ; <START_BUG> results . put ( REMOTE , remoteService ) ; <END_BUG> return results ; } private boolean addDiscoveredServiceID ( RemoteServiceEndpointDescription desc ) { } private boolean removeDiscoveredServiceID ( RemoteServiceEndpointDescription desc ) { } private boolean containsDiscoveredServiceID ( RemoteServiceEndpointDescription desc ) { } protected void trace ( String methodName , String message ) { } protected void traceException ( String methodName , String message , Throwable t ) { } protected void logError ( String methodName , String message , Throwable t ) { } protected void logError ( String methodName , String message ) { } protected void logWarning ( String methodName , String message ) { } }

Fix:
results . put ( SERVICE_IMPORTED , remoteService ) ;