Buggy code:
public class JSLPNamespace extends Namespace { private static final String JSLP_SCHEME = "jslp" ; private static final long serialVersionUID = - 3041453162456476102L ; public static final String NAME = "ecf.namespace.slp" ; public ID createInstance ( Object [ ] parameters ) throws IDCreateException { if ( ( ( parameters == null ) || ( ( parameters . length ) < 1 ) ) || ( ( parameters . length ) > 3 ) ) { throw new IDCreateException ( Messages . JSLPNamespace_2 ) ; } else if ( ( ( parameters [ 0 ] ) == null ) || ( parameters [ 0 ] . equals ( "" ) ) ) { throw new IDCreateException ( Messages . JSLPNamespace_3 ) ; } else if ( ( parameters [ 0 ] ) instanceof ServiceURL ) { ServiceURL anURL = ( ( ServiceURL ) ( parameters [ 0 ] ) ) ; IServiceTypeID stid = new JSLPServiceTypeID ( this , anURL , ( ( String [ ] ) ( parameters [ 2 ] ) ) ) ; <START_BUG> String serviceName = ( ( String ) ( ( ( parameters [ 2 ] ) != null ) ? parameters [ 1 ] : anURL . getHost ( ) ) ) ; <END_BUG> return new JSLPServiceID ( this , stid , serviceName ) ; } else if ( ( parameters [ 0 ] ) instanceof JSLPServiceID ) { return ( ( ID ) ( parameters [ 0 ] ) ) ; } else if ( ( ( parameters [ 0 ] ) instanceof IServiceID ) && ( ( parameters . length ) == 1 ) ) { IServiceID anId = ( ( IServiceID ) ( parameters [ 0 ] ) ) ; Object [ ] newParams = new Object [ 2 ] ; newParams [ 0 ] = anId . getServiceTypeID ( ) ; newParams [ 1 ] = anId . getName ( ) ; return createInstance ( newParams ) ; } else if ( ( parameters [ 0 ] ) instanceof IServiceTypeID ) { IServiceTypeID stid = ( ( IServiceTypeID ) ( parameters [ 0 ] ) ) ; parameters [ 0 ] = stid . getName ( ) ; return createInstance ( parameters ) ; } else if ( ( parameters [ 0 ] ) instanceof ServiceType ) { IServiceTypeID stid = new JSLPServiceTypeID ( this , ( ( ServiceType ) ( parameters [ 0 ] ) ) ) ; return new JSLPServiceID ( this , stid , ( ( String ) ( parameters [ 1 ] ) ) ) ; } else if ( ( ( parameters [ 0 ] ) instanceof String ) && ( ( ( String ) ( parameters [ 0 ] ) ) . startsWith ( "service:" ) ) ) { parameters [ 0 ] = new ServiceType ( ( ( String ) ( parameters [ 0 ] ) ) ) ; return createInstance ( parameters ) ; } else if ( ( ( parameters [ 0 ] ) instanceof String ) && ( ( ( String ) ( parameters [ 0 ] ) ) . startsWith ( "_" ) ) ) { String type = ( ( String ) ( parameters [ 0 ] ) ) ; String name = ( ( String ) ( parameters [ 1 ] ) ) ; IServiceTypeID stid = new JSLPServiceTypeID ( this , new ServiceTypeID ( this , type ) ) ; return new JSLPServiceID ( this , stid , name ) ; } else if ( ( ( parameters [ 0 ] ) instanceof String ) && ( ( ( String ) ( parameters [ 0 ] ) ) . startsWith ( ( ( getScheme ( ) ) + ( Namespace . SCHEME_SEPARATOR ) ) ) ) ) { String str = ( ( String ) ( parameters [ 0 ] ) ) ; int index = str . indexOf ( SCHEME_SEPARATOR ) ; parameters [ 0 ] = str . substring ( ( index + 1 ) ) ; return createInstance ( parameters ) ; } else if ( ( ( ( parameters . length ) == 2 ) && ( ( parameters [ 1 ] ) != null ) ) && ( ! ( ( parameters [ 1 ] ) instanceof String ) ) ) { throw new IDCreateException ( Messages . JSLPNamespace_4 ) ; } else { throw new IDCreateException ( Messages . JSLPNamespace_3 ) ; } } public String getScheme ( ) { } public Class [ ] [ ] getSupportedParameterTypes ( ) { } }

Fix:
String serviceName = ( ( String ) ( ( ( parameters [ 1 ] ) != null ) ? parameters [ 1 ] : anURL . getHost ( ) ) ) ;