Buggy code:
public class ECFConnection implements ISynchAsynchConnection { private static final String GOOGLE_TALK_HOST = "talk.google.com" ; public static final String CLIENT_TYPE = "ecf." ; public static final boolean DEBUG = Boolean . getBoolean ( "smack.debug" ) ; protected static final String STRING_ENCODING = "UTF-8" ; public static final String OBJECT_PROPERTY_NAME = ( ECFConnection . class . getName ( ) ) + ".object" ; protected static final int XMPP_DEFAULT_PORT = 5222 ; protected static final int XMPPS_DEFAULT_PORT = 5223 ; private XMPPConnection connection = null ; private IAsynchEventHandler handler = null ; private boolean isStarted = false ; private String serverName ; private int serverPort = - 1 ; private String serverResource ; private final Map properties = null ; private boolean isConnected = false ; private Namespace namespace = null ; private boolean google = false ; private boolean secure = false ; private boolean disconnecting = false ; private final PacketListener packetListener = new PacketListener ( ) { public void processPacket ( Packet arg0 ) { } } ; private final ConnectionListener connectionListener = new ConnectionListener ( ) { public void connectionClosed ( ) { } public void connectionClosedOnError ( Exception e ) { } } ; protected void logException ( String msg , Throwable t ) { } public Map getProperties ( ) { } public Object getAdapter ( Class adapter ) { } public XMPPConnection getXMPPConnection ( ) { } public ECFConnection ( boolean google , Namespace ns , IAsynchEventHandler h , boolean secure ) { } public ECFConnection ( boolean google , Namespace ns , IAsynchEventHandler h ) { } protected String getPasswordForObject ( Object data ) { } private XMPPID getXMPPID ( ID remote ) throws ECFException { } public synchronized Object connect ( ID remote , Object data , int timeout ) throws ECFException { if ( ( connection ) != null ) throw new ECFException ( "already<seq2seq4repair_space>connected" ) ; if ( timeout > 0 ) SmackConfiguration . setPacketReplyTimeout ( timeout ) ; Roster . setDefaultSubscriptionMode ( SUBSCRIPTION_MANUAL ) ; final XMPPID jabberURI = getXMPPID ( remote ) ; <START_BUG> final String username = jabberURI . getUsername ( ) ; <END_BUG> serverName = jabberURI . getHostname ( ) ; serverPort = jabberURI . getPort ( ) ; serverResource = jabberURI . getResourceName ( ) ; if ( ( ( serverResource ) == null ) || ( serverResource . equals ( PATH_DELIMITER ) ) ) { serverResource = getClientIdentifier ( ) ; jabberURI . setResourceName ( serverResource ) ; } try { if ( google ) { if ( secure ) { if ( ( serverPort ) == ( - 1 ) ) { serverPort = ECFConnection . XMPPS_DEFAULT_PORT ; } connection = new SSLXMPPConnection ( ECFConnection . GOOGLE_TALK_HOST , serverPort , jabberURI . getHostname ( ) ) ; } else { if ( ( serverPort ) == ( - 1 ) ) { serverPort = ECFConnection . XMPP_DEFAULT_PORT ; } connection = new XMPPConnection ( ECFConnection . GOOGLE_TALK_HOST , serverPort , jabberURI . getHostname ( ) ) ; } } else if ( ( serverPort ) == ( - 1 ) ) { if ( secure ) { connection = new SSLXMPPConnection ( serverName ) ; } else { connection = new XMPPConnection ( serverName ) ; } } else { if ( secure ) { connection = new SSLXMPPConnection ( serverName , serverPort ) ; } else { connection = new XMPPConnection ( serverName , serverPort ) ; } } connection . addPacketListener ( packetListener , null ) ; connection . addConnectionListener ( connectionListener ) ; connection . login ( username , ( ( String ) ( data ) ) , serverResource ) ; isConnected = true ; } catch ( final XMPPException e ) { if ( e . getMessage ( ) . equals ( "(401)" ) ) throw new org . eclipse . ecf . core . ContainerAuthenticationException ( "Password<seq2seq4repair_space>incorrect" , e ) ; throw new org . eclipse . ecf . core . ContainerConnectException ( e . getLocalizedMessage ( ) , e ) ; } return null ; } private String getClientIdentifier ( ) { } public void sendPacket ( Packet packet ) throws XMPPException { } public synchronized void disconnect ( ) { } public synchronized boolean isConnected ( ) { } public synchronized ID getLocalID ( ) { } public synchronized void start ( ) { } public boolean isStarted ( ) { } public synchronized void stop ( ) { } protected void handleConnectionClosed ( Exception e ) { } protected void handlePacket ( Packet arg0 ) { } public synchronized void sendAsynch ( ID receiver , byte [ ] data ) throws IOException { } protected void sendMessage ( ID receiver , Message aMsg ) throws IOException { } public synchronized Object sendSynch ( ID receiver , byte [ ] data ) throws IOException { } public void addListener ( IConnectionListener listener ) { } public void removeListener ( IConnectionListener listener ) { } public void sendMessage ( ID target , String message ) throws IOException { } public static Map getPropertiesFromPacket ( Packet packet ) { } public static Packet setPropertiesInPacket ( Packet input , Map properties ) { } public void sendMessage ( ID target , ID thread , Type type , String subject , String body , Map properties2 ) throws IOException { } public void sendPresenceUpdate ( ID target , Presence presence ) throws IOException { } public void sendRosterAdd ( String user , String name , String [ ] groups ) throws IOException , XMPPException { } public void sendRosterRemove ( String user ) throws IOException , XMPPException { } public Roster getRoster ( ) throws IOException { } }

Fix:
final String username = jabberURI . getNodename ( ) ;