Buggy code:
public class EventHookImpl implements EventHook { private static final String [ ] EMPTY_STRING_ARRAY = new String [ 0 ] ; private static final String REMOTE_INTERFACES_WILDCARD = "*" ; public static final String ECF_RS_PROVIDER_CONFIGURATION = "ecf" ; private final DistributionProviderImpl distributionProvider ; private final Map remoteServiceReferences = new HashMap ( ) ; public EventHookImpl ( DistributionProviderImpl distributionProvider ) { } public void event ( ServiceEvent event , Collection contexts ) { } private void handleUnregisteringServiceEvent ( ServiceReference serviceReference , Collection contexts ) { } private void handleRegisteredServiceEvent ( ServiceReference serviceReference , Collection contexts ) { <START_BUG> Object remoteInterfaces = serviceReference . getProperty ( OSGI_REMOTE_INTERFACES_KEY ) ; <END_BUG> if ( remoteInterfaces != null ) { Map configuration = getConfiguration ( serviceReference ) ; if ( configuration != null ) { trace ( "handleRegisteredServiceEvent" , ( ( ( "serviceReference=" + serviceReference ) + "<seq2seq4repair_space>has<seq2seq4repair_space>remoteInterfaces=" ) + remoteInterfaces ) ) ; String [ ] remoteInterfacesArr = ( ( String [ ] ) ( ( remoteInterfaces instanceof String [ ] ) ? remoteInterfaces : null ) ) ; String [ ] remotes = ( remoteInterfacesArr != null ) ? getInterfacesForServiceReference ( remoteInterfacesArr , serviceReference ) : null ; if ( remotes != null ) { IRemoteServiceContainerAdapter [ ] rscas = findRemoteServiceContainerAdapters ( remotes , serviceReference , configuration ) ; if ( rscas != null ) registerRemoteService ( rscas , remotes , serviceReference ) ; } else trace ( "handleRegisteredServiceEvent" , ( ( "serviceReference=" + serviceReference ) + "<seq2seq4repair_space>has<seq2seq4repair_space>no<seq2seq4repair_space>remote<seq2seq4repair_space>interfaces" ) ) ; } else trace ( "handleRegisteredServiceEvent" , ( ( "serviceReference=" + serviceReference ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>recognized<seq2seq4repair_space>as<seq2seq4repair_space>ecf<seq2seq4repair_space>configuration" ) ) ; } } private Map getConfiguration ( ServiceReference serviceReference ) { } private Map parseECFConfigurationType ( String [ ] remoteConfigurationType ) { } protected Object getService ( ServiceReference sr ) { } protected void registerRemoteService ( IRemoteServiceContainerAdapter [ ] rscas , String [ ] remoteInterfaces , ServiceReference sr ) { } protected Dictionary createPropertiesForRemoteService ( IRemoteServiceContainerAdapter iRemoteServiceContainerAdapter , String [ ] remotes , ServiceReference sr ) { } private void notifyRemoteServiceRegistered ( ServiceReference serviceReference , IRemoteServiceRegistration remoteServiceRegistration ) { } protected IRemoteServiceContainerAdapter [ ] findRemoteServiceContainerAdapters ( String [ ] remotes , ServiceReference serviceReference , Map ecfConfiguration ) { } private IRemoteServiceContainerAdapter [ ] getRSCAsFromContainers ( IContainer [ ] containers ) { } private String [ ] getInterfacesForServiceReference ( String [ ] remoteInterfaces , ServiceReference serviceReference ) { } private void handleModifiedServiceEvent ( ServiceReference serviceReference , Collection contexts ) { } private void traceEntering ( String methodName ) { } private void traceExiting ( String methodName ) { } private void trace ( String methodName , String message ) { } }

Fix:
Object remoteInterfaces = serviceReference . getProperty ( OSGI_REMOTE_INTERFACES ) ;