Buggy code:
public class JMDNSDiscoveryContainer extends AbstractDiscoveryContainerAdapter implements IDiscoveryService , ServiceListener , ServiceTypeListener { private static final String SCHEME_PROPERTY = "jmdns.ptcl" ; public static final int DEFAULT_REQUEST_TIMEOUT = 3000 ; private static int instanceCount = 0 ; private InetAddress intf = null ; JmDNS jmdns = null ; private ID targetID = null ; List serviceTypes = null ; boolean disposed = false ; Object lock = new Object ( ) ; SimpleFIFOQueue queue = null ; Thread notificationThread = null ; public JMDNSDiscoveryContainer ( InetAddress addr ) throws IDCreateException { } public ID getConnectedID ( ) { } public void dispose ( ) { } public void connect ( ID targetID1 , IConnectContext joinContext ) throws ContainerConnectException { } private void initializeQueue ( ) { } protected void handleRuntimeException ( Throwable t ) { } public void disconnect ( ) { } public IServiceInfo getServiceInfo ( IServiceID service ) { } public IServiceInfo [ ] getServices ( ) { } public IServiceInfo [ ] getServices ( IServiceTypeID type ) { } public IServiceTypeID [ ] getServiceTypes ( ) { } public void registerService ( IServiceInfo serviceInfo ) throws ECFException { } public void unregisterService ( IServiceInfo serviceInfo ) { } private void runInThread ( Runnable runnable ) { } private void logError ( String errorString ) { } public void serviceTypeAdded ( final ServiceEvent arg0 ) { } void fireTypeDiscovered ( final IServiceTypeID serviceType ) { } public void serviceAdded ( final ServiceEvent arg0 ) { } Collection getAllListeners ( IServiceTypeID serviceTypeID ) { } public void serviceRemoved ( final ServiceEvent arg0 ) { } void fireUndiscovered ( IServiceInfo serviceInfo ) { } public void serviceResolved ( final ServiceEvent arg0 ) { } void fireDiscovered ( IServiceInfo serviceInfo ) { } private void checkServiceInfo ( ServiceInfo serviceInfo ) throws ECFException { } private IServiceTypeID createServiceTypeID ( String type ) { } IServiceInfo createIServiceInfoFromServiceEvent ( final ServiceEvent event ) throws Exception { } private IServiceInfo createIServiceInfoFromServiceInfo ( final ServiceInfo serviceInfo ) throws Exception { } ServiceID createServiceID ( String type , String name ) { } private ServiceInfo createServiceInfoFromIServiceInfo ( IServiceInfo serviceInfo ) { if ( serviceInfo == null ) return null ; final IServiceID sID = serviceInfo . getServiceID ( ) ; final Hashtable props = new Hashtable ( ) ; final IServiceProperties svcProps = serviceInfo . getServiceProperties ( ) ; if ( svcProps != null ) { for ( final Enumeration e = svcProps . getPropertyNames ( ) ; e . hasMoreElements ( ) ; ) { final String key = ( ( String ) ( e . nextElement ( ) ) ) ; final Object val = svcProps . getProperty ( key ) ; if ( val != null ) { props . put ( key , val ) ; } } } URI location = serviceInfo . getLocation ( ) ; props . put ( JMDNSDiscoveryContainer . SCHEME_PROPERTY , location . getScheme ( ) ) ; int priority = ( ( serviceInfo . getPriority ( ) ) == ( - 1 ) ) ? 0 : serviceInfo . getPriority ( ) ; int weight = ( ( serviceInfo . getWeight ( ) ) == ( - 1 ) ) ? 0 : serviceInfo . getWeight ( ) ; final String serviceName = ( ( sID . getServiceName ( ) ) == null ) ? location . getHost ( ) : sID . getServiceName ( ) ; <START_BUG> final ServiceInfo si = ServiceInfo . create ( sID . getServiceTypeID ( ) . getInternal ( ) , serviceName , location . getPort ( ) , priority , weight , props ) ; <END_BUG> return si ; } }

Fix:
final ServiceInfo si = ServiceInfo . create ( sID . getServiceTypeID ( ) . getInternal ( ) , serviceName , location . getPort ( ) , weight , priority , props ) ;