Buggy code:
public final class Client implements ISynchAsynchConnection { public static class Creator implements ISynchAsynchConnectionInstantiator { public ISynchAsynchConnection makeInstance ( ConnectionDescription description , ISynchAsynchConnectionEventHandler handler , Class [ ] clazzes , Object [ ] args ) throws ConnectionInstantiationException { } } public static final String PROTOCOL = "ecftcp" ; protected static final Trace trace = Trace . create ( "connection" ) ; public static final int SNDR_PRIORITY = Thread . NORM_PRIORITY ; public static final int RCVR_PRIORITY = Thread . NORM_PRIORITY ; public static final long CLOSE_TIMEOUT = 2000 ; public static final int DEF_MAX_MSG = 50 ; protected Socket socket ; private String addressPort = "-1:<no<seq2seq4repair_space>endpoint>:-1" ; protected ObjectOutputStream outputStream ; protected ObjectInputStream inputStream ; protected ISynchAsynchConnectionEventHandler handler ; protected SimpleQueueImpl queue = new SimpleQueueImpl ( ) ; protected int keepAlive = 0 ; protected Thread sendThread ; protected Thread rcvThread ; protected Thread keepAliveThread ; protected boolean isClosing = false ; protected boolean waitForPing = false ; protected PingMessage ping = new PingMessage ( ) ; protected PingResponseMessage pingResp = new PingResponseMessage ( ) ; protected long nextPingTime ; protected int maxMsg = Client . DEF_MAX_MSG ; protected long closeTimeout = Client . CLOSE_TIMEOUT ; protected Vector eventNotify = null ; protected Map properties ; protected ID containerID = null ; protected Object pingLock = new Object ( ) ; public Map getProperties ( ) { } public Object getAdapter ( Class clazz ) { } private String getAddressPort ( ) { } protected void trace ( String msg ) { } protected void dumpStack ( String msg , Throwable e ) { } public void setProperties ( Map props ) { } public Client ( Socket aSocket , ObjectInputStream iStream , ObjectOutputStream oStream , ISynchAsynchConnectionEventHandler handler , int keepAlive ) throws IOException { } private void setSocket ( Socket s ) throws SocketException { } public Client ( Socket aSocket , ObjectInputStream iStream , ObjectOutputStream oStream , ISynchAsynchConnectionEventHandler handler , int keepAlive , int maxmsgs ) throws IOException { } public Client ( ISynchAsynchConnectionEventHandler handler , Integer keepAlive ) { } public Client ( ISynchAsynchConnectionEventHandler handler , int keepAlive ) { } public Client ( ISynchAsynchConnectionEventHandler handler , int keepAlive , int maxmsgs ) { } public synchronized ID getLocalID ( ) { } public synchronized void removeCommEventListener ( IConnectionEventHandler l ) { } public synchronized void addCommEventListener ( IConnectionEventHandler l ) { } public synchronized boolean isConnected ( ) { } public synchronized boolean isStarted ( ) { } protected void fireSuspect ( Exception e ) { } public synchronized Object connect ( ID remote , Object data , int timeout ) throws IOException { trace ( ( ( ( ( ( ( "connect(" + remote ) + "," ) + data ) + "," ) + timeout ) + ")" ) ) ; if ( ( socket ) != null ) throw new ConnectException ( ( "Already<seq2seq4repair_space>connected<seq2seq4repair_space>to<seq2seq4repair_space>" + ( getAddressPort ( ) ) ) ) ; URI anURI = null ; try { <START_BUG> anURI = remote . toURI ( ) ; <END_BUG> } catch ( URISyntaxException e ) { IOException except = new IOException ( ( "Invalid<seq2seq4repair_space>URI<seq2seq4repair_space>for<seq2seq4repair_space>remote<seq2seq4repair_space>" + remote ) ) ; except . setStackTrace ( e . getStackTrace ( ) ) ; throw except ; } SocketFactory fact = SocketFactory . getSocketFactory ( ) ; if ( fact == null ) { fact = SocketFactory . getDefaultSocketFactory ( ) ; } Socket s = fact . createSocket ( anURI . getHost ( ) , anURI . getPort ( ) , timeout ) ; setSocket ( s ) ; outputStream = new ExObjectOutputStream ( new BufferedOutputStream ( s . getOutputStream ( ) ) , false ) ; outputStream . flush ( ) ; inputStream = new ExObjectInputStream ( s . getInputStream ( ) , false ) ; trace ( ( "connect;" + anURI ) ) ; sendIt ( new ConnectRequestMessage ( anURI , ( ( Serializable ) ( data ) ) ) ) ; ConnectResultMessage res = null ; res = ( ( ConnectResultMessage ) ( readObject ( ) ) ) ; trace ( ( "connect;rcv:" + res ) ) ; setupThreads ( ) ; Object ret = res . getData ( ) ; trace ( ( "connect;returning:" + ret ) ) ; return ret ; } private void setupThreads ( ) { } private Thread getSendThread ( ) { } private void closeSocket ( ) { } private void sendIt ( Serializable snd ) throws IOException { } private void receiveResp ( ) { } public void setCloseTimeout ( long t ) { } private void sendClose ( Serializable snd ) throws IOException { } private Thread getRcvThread ( ) { } private void handleRcv ( Serializable rcv ) throws IOException { } public synchronized void start ( ) { } public void stop ( ) { } private Thread setupPing ( ) { } public synchronized void disconnect ( ) throws IOException { } public void sendAsynch ( ID recipient , byte [ ] obj ) throws IOException { } public void sendAsynch ( ID recipient , Object obj ) throws IOException { } public synchronized void queueObject ( ID recipient , Serializable obj ) throws IOException { } public synchronized Serializable sendObject ( ID recipient , Serializable obj ) throws IOException { } public Object sendSynch ( ID rec , Object obj ) throws IOException { } public Object sendSynch ( ID rec , byte [ ] obj ) throws IOException { } private Serializable readObject ( ) throws IOException { } }

Fix:
anURI = new URI ( remote . getName ( ) ) ;