Buggy code:
public class JMDNSDiscoveryContainer extends AbstractDiscoveryContainerAdapter implements IDiscoveryService , ServiceListener , ServiceTypeListener { private static final String SCHEME_PROPERTY = "jmdns.ptcl" ; private static final String URI_PATH_PROPERTY = "path" ; private static final String NAMING_AUTHORITY_PROPERTY = "jmdns.namingauthority" ; 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 ; final Map services = Collections . synchronizedMap ( new HashMap ( ) ) ; boolean disposed = false ; final Object lock = new Object ( ) ; SimpleFIFOQueue queue = null ; Thread notificationThread = null ; public JMDNSDiscoveryContainer ( final InetAddress addr ) { } public ID getConnectedID ( ) { } public void dispose ( ) { } public void connect ( final ID targetID1 , final IConnectContext joinContext ) throws ContainerConnectException { } private void initializeQueue ( ) { } public void disconnect ( ) { } public IServiceInfo getServiceInfo ( final IServiceID service ) { } public IServiceInfo [ ] getServices ( ) { } public IServiceInfo [ ] getServices ( final IServiceTypeID type ) { } public IServiceTypeID [ ] getServiceTypes ( ) { } public void registerService ( final IServiceInfo serviceInfo ) { } public void unregisterService ( final IServiceInfo serviceInfo ) { } public void unregisterAllServices ( ) { } public IServiceInfo [ ] purgeCache ( ) { } private void runInThread ( final Runnable runnable ) { } public void serviceTypeAdded ( final ServiceEvent arg0 ) { } void fireTypeDiscovered ( final IServiceTypeID serviceType ) { } public void serviceAdded ( final ServiceEvent arg0 ) { } public void serviceRemoved ( final ServiceEvent arg0 ) { } void fireUndiscovered ( final IServiceInfo serviceInfo ) { } public void serviceResolved ( final ServiceEvent arg0 ) { } void fireDiscovered ( final IServiceInfo serviceInfo ) { } private void checkServiceInfo ( final ServiceInfo serviceInfo ) { } IServiceInfo createIServiceInfoFromServiceInfo ( final ServiceInfo serviceInfo ) throws Exception { Assert . isNotNull ( serviceInfo ) ; final int priority = serviceInfo . getPriority ( ) ; final int weight = serviceInfo . getWeight ( ) ; final Properties props = new Properties ( ) ; String uriProtocol = null ; String namingAuthority = IServiceTypeID . DEFAULT_NA ; for ( final Enumeration e = serviceInfo . getPropertyNames ( ) ; e . hasMoreElements ( ) ; ) { final String key = ( ( String ) ( e . nextElement ( ) ) ) ; if ( JMDNSDiscoveryContainer . SCHEME_PROPERTY . equals ( key ) ) { uriProtocol = serviceInfo . getPropertyString ( key ) ; } else if ( JMDNSDiscoveryContainer . NAMING_AUTHORITY_PROPERTY . equals ( key ) ) { namingAuthority = serviceInfo . getPropertyString ( key ) ; } else if ( JMDNSDiscoveryContainer . URI_PATH_PROPERTY . equals ( key ) ) { } else { final byte [ ] bytes = serviceInfo . getPropertyBytes ( key ) ; try { final ObjectInputStream in = new ObjectInputStream ( new ByteArrayInputStream ( bytes ) ) ; final Object object = in . readObject ( ) ; in . close ( ) ; props . put ( key , object ) ; } catch ( final StreamCorruptedException ioe ) { props . put ( key , serviceInfo . getPropertyString ( key ) ) ; } catch ( final EOFException eofe ) { props . put ( key , serviceInfo . getPropertyString ( key ) ) ; } } } final String proto = serviceInfo . getProtocol ( ) ; final String domain = serviceInfo . getDomain ( ) ; final String [ ] scopes = new String [ ] { domain } ; <START_BUG> final URI uri = new URI ( serviceInfo . getURL ( proto ) ) ; <END_BUG> String st = serviceInfo . getType ( ) ; final int end = st . indexOf ( proto ) ; String [ ] types = StringUtils . split ( st . substring ( 1 , end ) , "._" ) ; final IServiceTypeID sID = ServiceIDFactory . getDefault ( ) . createServiceTypeID ( getServicesNamespace ( ) , types , scopes , new String [ ] { proto } , namingAuthority ) ; final String name = serviceInfo . getName ( ) ; return new org . eclipse . ecf . discovery . ServiceInfo ( uri , name , sID , priority , weight , new ServiceProperties ( props ) ) ; } private ServiceInfo createServiceInfoFromIServiceInfo ( final IServiceInfo serviceInfo ) { } }

Fix:
final URI uri = new URI ( serviceInfo . getURL ( ( uriProtocol == null ? proto : uriProtocol ) ) ) ;