Buggy code:
public class XMPPContainer extends ClientSOContainer implements IPresenceService { public static final int DEFAULT_KEEPALIVE = 30000 ; public static final String CONNECT_NAMESPACE = XmppPlugin . getDefault ( ) . getNamespaceIdentifier ( ) ; public static final String CONTAINER_HELPER_ID = ( XMPPContainer . class . getName ( ) ) + ".xmpphandler" ; protected static final String GOOGLE_SERVICENAME = "gmail.com" ; private static final String [ ] googleHosts = new String [ ] { XMPPContainer . GOOGLE_SERVICENAME , "talk.google.com" , "googlemail.com" } ; public static final String XMPP_GOOGLE_OVERRIDE_PROP_NAME = "ecf.xmpp.google.override" ; private static Set googleNames = new HashSet ( ) ; protected int keepAlive = 0 ; XMPPContainerAccountManager accountManager = null ; XMPPChatRoomManager chatRoomManager = null ; XMPPOutgoingFileTransferHelper outgoingFileTransferContainerAdapter = null ; XMPPContainerPresenceHelper presenceHelper = null ; XMPPUserSearchManager searchManager = null ; protected ID presenceHelperID = null ; protected XMPPContainer ( SOContainerConfig config , int keepAlive ) throws Exception { } public XMPPContainer ( ) throws Exception { } public XMPPContainer ( int ka ) throws Exception { } public XMPPContainer ( String userhost , int ka ) throws Exception { } public IRosterManager getRosterManager ( ) { } public IUserSearchManager getUserSearchManager ( ) { } public IAccountManager getAccountManager ( ) { } public IChatRoomManager getChatRoomManager ( ) { } public IChatManager getChatManager ( ) { } public Namespace getConnectNamespace ( ) { } public void connect ( ID remote , IConnectContext joinContext ) throws ContainerConnectException { } public void disconnect ( ) { } public void dispose ( ) { } public Object getAdapter ( Class clazz ) { } protected ID handleConnectResponse ( ID originalTarget , Object serverData ) throws Exception { } protected ISynchAsynchConnection createConnection ( ID remoteSpace , Object data ) throws ConnectionCreateException { } protected boolean isGoogle ( ID remoteSpace ) { } protected Object getConnectData ( ID remote , IConnectContext joinContext ) throws IOException , UnsupportedCallbackException { } protected Object createConnectData ( ID target , Callback [ ] cbs , Object data ) { } protected Callback [ ] createAuthorizationCallbacks ( ) { } protected int getConnectTimeout ( ) { } protected Roster getRoster ( ) throws IOException { } protected void deliverEvent ( Event evt ) { } protected void handleXMPPMessage ( Packet aPacket ) throws IOException { } protected boolean handleAsExtension ( Packet packet ) { <START_BUG> final Iterator i = packet . getExtensions ( ) ; <END_BUG> for ( ; i . hasNext ( ) ; ) { final Object extension = i . next ( ) ; if ( extension instanceof XHTMLExtension ) { final XHTMLExtension xhtmlExtension = ( ( XHTMLExtension ) ( extension ) ) ; deliverEvent ( new MessageEvent ( ( ( Message ) ( packet ) ) , xhtmlExtension . getBodies ( ) ) ) ; return true ; } if ( ( packet instanceof Presence ) && ( extension instanceof MUCUser ) ) { return true ; } } return false ; } protected SOContext createSharedObjectContext ( SOConfig soconfig , IQueueEnqueue queue ) { } protected void processAsynch ( AsynchEvent e ) { } public ECFConnection getECFConnection ( ) { } public XMPPConnection getXMPPConnection ( ) { } protected void log ( String msg , Throwable e ) { } }

Fix:
final Iterator i = packet . getExtensions ( ) . iterator ( ) ;