### Eclipse Workspace Patch 1.0
#P Smack
Index: source/org/jivesoftware/smackx/MultipleRecipientManager.java
===================================================================
--- source/org/jivesoftware/smackx/MultipleRecipientManager.java	(revision 10959)
+++ source/org/jivesoftware/smackx/MultipleRecipientManager.java	(working copy)
@@ -47,7 +47,7 @@
      * Create a cache to hold the 100 most recently accessed elements for a period of
      * 24 hours.
      */
-    private static Cache services = new Cache(100, 24 * 60 * 60 * 1000);
+    private static Cache<String, String> services = new Cache<String, String>(100, 24 * 60 * 60 * 1000);
 
     /**
      * Sends the specified packet to the list of specified recipients using the
@@ -67,7 +67,7 @@
      * @throws XMPPException if server does not support JEP-33: Extended Stanza Addressing and
      *                       some JEP-33 specific features were requested.
      */
-    public static void send(XMPPConnection connection, Packet packet, List to, List cc, List bcc)
+    public static void send(XMPPConnection connection, Packet packet, List<String> to, List<String> cc, List<String> bcc)
             throws XMPPException {
         send(connection, packet, to, cc, bcc, null, null, false);
     }
@@ -95,7 +95,7 @@
      * @throws XMPPException if server does not support JEP-33: Extended Stanza Addressing and
      *                       some JEP-33 specific features were requested.
      */
-    public static void send(XMPPConnection connection, Packet packet, List to, List cc, List bcc,
+    public static void send(XMPPConnection connection, Packet packet, List<String> to, List<String> cc, List<String> bcc,
             String replyTo, String replyRoom, boolean noReply) throws XMPPException {
         String serviceAddress = getMultipleRecipienServiceAddress(connection);
         if (serviceAddress != null) {
@@ -151,14 +151,14 @@
         }
         else {
             // Send reply to multiple recipients
-            List to = new ArrayList();
-            List cc = new ArrayList();
-            for (Iterator it = info.getTOAddresses().iterator(); it.hasNext();) {
-                String jid = ((MultipleAddresses.Address) it.next()).getJid();
+            List<String> to = new ArrayList<String>();
+            List<String> cc = new ArrayList<String>();
+            for (Iterator<MultipleAddresses.Address> it = info.getTOAddresses().iterator(); it.hasNext();) {
+                String jid = (it.next()).getJid();
                 to.add(jid);
             }
-            for (Iterator it = info.getCCAddresses().iterator(); it.hasNext();) {
-                String jid = ((MultipleAddresses.Address) it.next()).getJid();
+            for (Iterator<MultipleAddresses.Address> it = info.getCCAddresses().iterator(); it.hasNext();) {
+                String jid = (it.next()).getJid();
                 cc.add(jid);
             }
             // Add original sender as a 'to' address (if not already present)
@@ -202,50 +202,50 @@
     }
 
     private static void sendToIndividualRecipients(XMPPConnection connection, Packet packet,
-            List to, List cc, List bcc) {
+            List<String> to, List<String> cc, List<String> bcc) {
         if (to != null) {
-            for (Iterator it = to.iterator(); it.hasNext();) {
-                String jid = (String) it.next();
+            for (Iterator<String> it = to.iterator(); it.hasNext();) {
+                String jid = it.next();
                 packet.setTo(jid);
                 connection.sendPacket(new PacketCopy(packet.toXML()));
             }
         }
         if (cc != null) {
-            for (Iterator it = cc.iterator(); it.hasNext();) {
-                String jid = (String) it.next();
+            for (Iterator<String> it = cc.iterator(); it.hasNext();) {
+                String jid = it.next();
                 packet.setTo(jid);
                 connection.sendPacket(new PacketCopy(packet.toXML()));
             }
         }
         if (bcc != null) {
-            for (Iterator it = bcc.iterator(); it.hasNext();) {
-                String jid = (String) it.next();
+            for (Iterator<String> it = bcc.iterator(); it.hasNext();) {
+                String jid = it.next();
                 packet.setTo(jid);
                 connection.sendPacket(new PacketCopy(packet.toXML()));
             }
         }
     }
 
-    private static void sendThroughService(XMPPConnection connection, Packet packet, List to,
-            List cc, List bcc, String replyTo, String replyRoom, boolean noReply,
+    private static void sendThroughService(XMPPConnection connection, Packet packet, List<String> to,
+            List<String> cc, List<String> bcc, String replyTo, String replyRoom, boolean noReply,
             String serviceAddress) {
         // Create multiple recipient extension
         MultipleAddresses multipleAddresses = new MultipleAddresses();
         if (to != null) {
-            for (Iterator it = to.iterator(); it.hasNext();) {
-                String jid = (String) it.next();
+            for (Iterator<String> it = to.iterator(); it.hasNext();) {
+                String jid = it.next();
                 multipleAddresses.addAddress(MultipleAddresses.TO, jid, null, null, false, null);
             }
         }
         if (cc != null) {
-            for (Iterator it = cc.iterator(); it.hasNext();) {
-                String jid = (String) it.next();
+            for (Iterator<String>  it = cc.iterator(); it.hasNext();) {
+                String jid = it.next();
                 multipleAddresses.addAddress(MultipleAddresses.CC, jid, null, null, false, null);
             }
         }
         if (bcc != null) {
-            for (Iterator it = bcc.iterator(); it.hasNext();) {
-                String jid = (String) it.next();
+            for (Iterator<String> it = bcc.iterator(); it.hasNext();) {
+                String jid = it.next();
                 multipleAddresses.addAddress(MultipleAddresses.BCC, jid, null, null, false, null);
             }
         }
@@ -300,8 +300,8 @@
                             // Get the disco items and send the disco packet to each server item
                             DiscoverItems items = ServiceDiscoveryManager.getInstanceFor(connection)
                                     .discoverItems(serviceName);
-                            for (Iterator it = items.getItems(); it.hasNext();) {
-                                DiscoverItems.Item item = (DiscoverItems.Item) it.next();
+                            for (Iterator<DiscoverItems.Item> it = items.getItems(); it.hasNext();) {
+                                DiscoverItems.Item item = it.next();
                                 info = ServiceDiscoveryManager.getInstanceFor(connection)
                                         .discoverInfo(item.getEntityID(), item.getNode());
                                 if (info.containsFeature("http://jabber.org/protocol/address")) {
Index: source/org/jivesoftware/smackx/packet/MultipleAddresses.java
===================================================================
--- source/org/jivesoftware/smackx/packet/MultipleAddresses.java	(revision 10959)
+++ source/org/jivesoftware/smackx/packet/MultipleAddresses.java	(working copy)
@@ -41,7 +41,7 @@
     public static final String TO = "to";
 
 
-    private List addresses = new ArrayList();
+    private List<Address> addresses = new ArrayList<Address>();
 
     /**
      * Adds a new address to which the packet is going to be sent or was sent.
@@ -84,9 +84,9 @@
      * @param type Examples of address type are: TO, CC, BCC, etc.
      * @return the list of addresses that matches the specified type.
      */
-    public List getAddressesOfType(String type) {
-        List answer = new ArrayList(addresses.size());
-        for (Iterator it = addresses.iterator(); it.hasNext();) {
+    public List<Address> getAddressesOfType(String type) {
+        List<Address> answer = new ArrayList<Address>(addresses.size());
+        for (Iterator<Address> it = addresses.iterator(); it.hasNext();) {
             Address address = (Address) it.next();
             if (address.getType().equals(type)) {
                 answer.add(address);
@@ -109,7 +109,7 @@
         buf.append("<").append(getElementName());
         buf.append(" xmlns=\"").append(getNamespace()).append("\">");
         // Loop through all the addresses and append them to the string buffer
-        for (Iterator i = addresses.iterator(); i.hasNext();) {
+        for (Iterator<Address> i = addresses.iterator(); i.hasNext();) {
             Address address = (Address) i.next();
             buf.append(address.toXML());
         }
Index: source/org/jivesoftware/smackx/PrivateDataManager.java
===================================================================
--- source/org/jivesoftware/smackx/PrivateDataManager.java	(revision 10959)
+++ source/org/jivesoftware/smackx/PrivateDataManager.java	(working copy)
@@ -62,7 +62,7 @@
     /**
      * Map of provider instances.
      */
-    private static Map privateDataProviders = new Hashtable();
+    private static Map<String, PrivateDataProvider> privateDataProviders = new Hashtable<String, PrivateDataProvider>();
 
     /**
      * Returns the private data provider registered to the specified XML element name and namespace.
Index: source/org/jivesoftware/smackx/provider/DataFormProvider.java
===================================================================
--- source/org/jivesoftware/smackx/provider/DataFormProvider.java	(revision 10959)
+++ source/org/jivesoftware/smackx/provider/DataFormProvider.java	(working copy)
@@ -45,7 +45,8 @@
 
     public PacketExtension parseExtension(XmlPullParser parser) throws Exception {
         boolean done = false;
-        StringBuilder buffer = null;
+        //Removed - not used
+        //StringBuilder buffer = null;
         DataForm dataForm = new DataForm(parser.getAttributeValue("", "type"));
         while (!done) {
             int eventType = parser.next();
@@ -105,7 +106,7 @@
 
     private DataForm.Item parseItem(XmlPullParser parser) throws Exception {
         boolean done = false;
-        List fields = new ArrayList();
+        List<FormField> fields = new ArrayList<FormField>();
         while (!done) {
             int eventType = parser.next();
             if (eventType == XmlPullParser.START_TAG) {
@@ -123,7 +124,7 @@
 
     private DataForm.ReportedData parseReported(XmlPullParser parser) throws Exception {
         boolean done = false;
-        List fields = new ArrayList();
+        List<FormField> fields = new ArrayList<FormField>();
         while (!done) {
             int eventType = parser.next();
             if (eventType == XmlPullParser.START_TAG) {
Index: source/org/jivesoftware/smackx/RosterExchangeManager.java
===================================================================
--- source/org/jivesoftware/smackx/RosterExchangeManager.java	(revision 10959)
+++ source/org/jivesoftware/smackx/RosterExchangeManager.java	(working copy)
@@ -38,7 +38,7 @@
  */
 public class RosterExchangeManager {
 
-    private List rosterExchangeListeners = new ArrayList();
+    private List<RosterExchangeListener> rosterExchangeListeners = new ArrayList<RosterExchangeListener>();
 
     private XMPPConnection con;
 
@@ -147,8 +147,8 @@
             listeners = new RosterExchangeListener[rosterExchangeListeners.size()];
             rosterExchangeListeners.toArray(listeners);
         }
-        for (int i = 0; i < listeners.length; i++) {
-            listeners[i].entriesReceived(from, remoteRosterEntries);
+        for (RosterExchangeListener listener : listeners) {
+        	listener.entriesReceived(from, remoteRosterEntries);
         }
     }
 
Index: source/org/jivesoftware/smackx/filetransfer/FileTransferManager.java
===================================================================
--- source/org/jivesoftware/smackx/filetransfer/FileTransferManager.java	(revision 10959)
+++ source/org/jivesoftware/smackx/filetransfer/FileTransferManager.java	(working copy)
@@ -48,7 +48,7 @@
 
 	private final FileTransferNegotiator fileTransferNegotiator;
 
-	private List listeners;
+	private List<FileTransferListener> listeners;
 
 	private XMPPConnection connection;
 
@@ -83,7 +83,7 @@
 	}
 
 	private void initListeners() {
-		listeners = new ArrayList();
+		listeners = new ArrayList<FileTransferListener>();
 
 		connection.addPacketListener(new PacketListener() {
 			public void processPacket(Packet packet) {
Index: source/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java
===================================================================
--- source/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java	(revision 10959)
+++ source/org/jivesoftware/smackx/filetransfer/FileTransferNegotiator.java	(working copy)
@@ -175,7 +175,7 @@
      *
      * @return Returns a collection of the supported transfer protocols.
      */
-    public static Collection getSupportedProtocols() {
+    public static Collection<String> getSupportedProtocols() {
         return Collections.unmodifiableList(Arrays.asList(PROTOCOLS));
     }
 
@@ -271,8 +271,8 @@
 
     private FormField getStreamMethodField(DataForm form) {
         FormField field = null;
-        for (Iterator it = form.getFields(); it.hasNext();) {
-            field = (FormField) it.next();
+        for (Iterator<FormField> it = form.getFields(); it.hasNext();) {
+            field = it.next();
             if (field.getVariable().equals(STREAM_DATA_FIELD_NAME)) {
                 break;
             }
@@ -286,8 +286,8 @@
         String variable;
         boolean isByteStream = false;
         boolean isIBB = false;
-        for (Iterator it = field.getOptions(); it.hasNext();) {
-            variable = ((FormField.Option) it.next()).getValue();
+        for (Iterator<FormField.Option> it = field.getOptions(); it.hasNext();) {
+            variable = (it.next()).getValue();
             if (variable.equals(BYTE_STREAM) && !IBB_ONLY) {
                 isByteStream = true;
             }
Index: source/org/jivesoftware/smackx/search/UserSearchManager.java
===================================================================
--- source/org/jivesoftware/smackx/search/UserSearchManager.java	(revision 10959)
+++ source/org/jivesoftware/smackx/search/UserSearchManager.java	(working copy)
@@ -93,7 +93,7 @@
      * @return a Collection of search services found on the server.
      * @throws XMPPException thrown if a server error has occurred.
      */
-    public Collection getSearchServices() throws XMPPException {
+    public Collection<String> getSearchServices() throws XMPPException {
         final List<String> searchServices = new ArrayList<String>();
         ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(con);
         DiscoverItems items = discoManager.discoverItems(con.getServiceName());
Index: source/org/jivesoftware/smackx/workgroup/util/MetaDataUtils.java
===================================================================
--- source/org/jivesoftware/smackx/workgroup/util/MetaDataUtils.java	(revision 10959)
+++ source/org/jivesoftware/smackx/workgroup/util/MetaDataUtils.java	(working copy)
@@ -47,7 +47,7 @@
         if ((eventType == XmlPullParser.START_TAG)
                 && parser.getName().equals(MetaData.ELEMENT_NAME)
                 && parser.getNamespace().equals(MetaData.NAMESPACE)) {
-            Map metaData = new Hashtable();
+            Map<String, List<String>> metaData = new Hashtable<String, List<String>>();
 
             eventType = parser.nextTag();
 
@@ -58,11 +58,11 @@
                 String value = parser.nextText();
 
                 if (metaData.containsKey(name)) {
-                    List values = (List)metaData.get(name);
+                    List<String> values = metaData.get(name);
                     values.add(value);
                 }
                 else {
-                    List values = new ArrayList();
+                    List<String> values = new ArrayList<String>();
                     values.add(value);
                     metaData.put(name, values);
                 }
Index: jingle/extension/source/org/jivesoftware/smackx/packet/JingleDescription.java
===================================================================
--- jingle/extension/source/org/jivesoftware/smackx/packet/JingleDescription.java	(revision 10959)
+++ jingle/extension/source/org/jivesoftware/smackx/packet/JingleDescription.java	(working copy)
@@ -90,7 +90,7 @@
      */
     public void addAudioPayloadTypes(final List<PayloadType> pts) {
         synchronized (payloads) {
-            Iterator ptIter = pts.iterator();
+            Iterator<PayloadType> ptIter = pts.iterator();
             while (ptIter.hasNext()) {
                 PayloadType.Audio pt = (PayloadType.Audio) ptIter.next();
                 addPayloadType(new PayloadType.Audio(pt));
Index: source/org/jivesoftware/smackx/workgroup/user/Workgroup.java
===================================================================
--- source/org/jivesoftware/smackx/workgroup/user/Workgroup.java	(revision 10959)
+++ source/org/jivesoftware/smackx/workgroup/user/Workgroup.java	(working copy)
@@ -16,6 +16,34 @@
 
 package org.jivesoftware.smackx.workgroup.user;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.jivesoftware.smack.PacketCollector;
+import org.jivesoftware.smack.PacketListener;
+import org.jivesoftware.smack.SmackConfiguration;
+import org.jivesoftware.smack.XMPPConnection;
+import org.jivesoftware.smack.XMPPException;
+import org.jivesoftware.smack.filter.AndFilter;
+import org.jivesoftware.smack.filter.FromContainsFilter;
+import org.jivesoftware.smack.filter.PacketFilter;
+import org.jivesoftware.smack.filter.PacketIDFilter;
+import org.jivesoftware.smack.filter.PacketTypeFilter;
+import org.jivesoftware.smack.packet.IQ;
+import org.jivesoftware.smack.packet.Message;
+import org.jivesoftware.smack.packet.Packet;
+import org.jivesoftware.smack.packet.PacketExtension;
+import org.jivesoftware.smack.packet.Presence;
+import org.jivesoftware.smack.util.StringUtils;
+import org.jivesoftware.smackx.Form;
+import org.jivesoftware.smackx.FormField;
+import org.jivesoftware.smackx.ServiceDiscoveryManager;
+import org.jivesoftware.smackx.muc.MultiUserChat;
+import org.jivesoftware.smackx.packet.DataForm;
+import org.jivesoftware.smackx.packet.DiscoverInfo;
+import org.jivesoftware.smackx.packet.MUCUser;
 import org.jivesoftware.smackx.workgroup.MetaData;
 import org.jivesoftware.smackx.workgroup.WorkgroupInvitation;
 import org.jivesoftware.smackx.workgroup.WorkgroupInvitationListener;
@@ -24,23 +52,11 @@
 import org.jivesoftware.smackx.workgroup.packet.QueueUpdate;
 import org.jivesoftware.smackx.workgroup.packet.SessionID;
 import org.jivesoftware.smackx.workgroup.packet.UserID;
-import org.jivesoftware.smackx.workgroup.settings.*;
-import org.jivesoftware.smack.*;
-import org.jivesoftware.smack.filter.*;
-import org.jivesoftware.smack.packet.*;
-import org.jivesoftware.smack.util.StringUtils;
-import org.jivesoftware.smackx.Form;
-import org.jivesoftware.smackx.FormField;
-import org.jivesoftware.smackx.ServiceDiscoveryManager;
-import org.jivesoftware.smackx.muc.MultiUserChat;
-import org.jivesoftware.smackx.packet.DataForm;
-import org.jivesoftware.smackx.packet.DiscoverInfo;
-import org.jivesoftware.smackx.packet.MUCUser;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import org.jivesoftware.smackx.workgroup.settings.ChatSetting;
+import org.jivesoftware.smackx.workgroup.settings.ChatSettings;
+import org.jivesoftware.smackx.workgroup.settings.OfflineSettings;
+import org.jivesoftware.smackx.workgroup.settings.SoundSettings;
+import org.jivesoftware.smackx.workgroup.settings.WorkgroupProperties;
 
 /**
  * Provides workgroup services for users. Users can join the workgroup queue, depart the
@@ -58,8 +74,8 @@
     private String workgroupJID;
     private XMPPConnection connection;
     private boolean inQueue;
-    private List invitationListeners;
-    private List queueListeners;
+    private List<WorkgroupInvitationListener> invitationListeners;
+    private List<QueueListener> queueListeners;
     private List siteInviteListeners;
 
     private int queuePosition = -1;
@@ -84,8 +100,8 @@
         this.workgroupJID = workgroupJID;
         this.connection = connection;
         inQueue = false;
-        invitationListeners = new ArrayList();
-        queueListeners = new ArrayList();
+        invitationListeners = new ArrayList<WorkgroupInvitationListener>();
+        queueListeners = new ArrayList<QueueListener>();
         siteInviteListeners = new ArrayList();
 
         // Register as a queue listener for internal usage by this instance.
@@ -489,7 +505,7 @@
 
     private void fireInvitationEvent(WorkgroupInvitation invitation) {
         synchronized (invitationListeners) {
-            for (Iterator i = invitationListeners.iterator(); i.hasNext();) {
+            for (Iterator<WorkgroupInvitationListener> i = invitationListeners.iterator(); i.hasNext();) {
                 WorkgroupInvitationListener listener = (WorkgroupInvitationListener)i.next();
                 listener.invitationReceived(invitation);
             }
@@ -498,7 +514,7 @@
 
     private void fireQueueJoinedEvent() {
         synchronized (queueListeners) {
-            for (Iterator i = queueListeners.iterator(); i.hasNext();) {
+            for (Iterator<QueueListener> i = queueListeners.iterator(); i.hasNext();) {
                 QueueListener listener = (QueueListener)i.next();
                 listener.joinedQueue();
             }
@@ -507,7 +523,7 @@
 
     private void fireQueueDepartedEvent() {
         synchronized (queueListeners) {
-            for (Iterator i = queueListeners.iterator(); i.hasNext();) {
+            for (Iterator<QueueListener> i = queueListeners.iterator(); i.hasNext();) {
                 QueueListener listener = (QueueListener)i.next();
                 listener.departedQueue();
             }
@@ -516,7 +532,7 @@
 
     private void fireQueuePositionEvent(int currentPosition) {
         synchronized (queueListeners) {
-            for (Iterator i = queueListeners.iterator(); i.hasNext();) {
+            for (Iterator<QueueListener> i = queueListeners.iterator(); i.hasNext();) {
                 QueueListener listener = (QueueListener)i.next();
                 listener.queuePositionUpdated(currentPosition);
             }
@@ -525,7 +541,7 @@
 
     private void fireQueueTimeEvent(int secondsRemaining) {
         synchronized (queueListeners) {
-            for (Iterator i = queueListeners.iterator(); i.hasNext();) {
+            for (Iterator<QueueListener> i = queueListeners.iterator(); i.hasNext();) {
                 QueueListener listener = (QueueListener)i.next();
                 listener.queueWaitTimeUpdated(secondsRemaining);
             }
Index: source/org/jivesoftware/smackx/ReportedData.java
===================================================================
--- source/org/jivesoftware/smackx/ReportedData.java	(revision 10959)
+++ source/org/jivesoftware/smackx/ReportedData.java	(working copy)
@@ -69,18 +69,18 @@
      */
     private ReportedData(DataForm dataForm) {
         // Add the columns to the report based on the reported data fields
-        for (Iterator fields = dataForm.getReportedData().getFields(); fields.hasNext();) {
-            FormField field = (FormField)fields.next();
+        for (Iterator<FormField> fields = dataForm.getReportedData().getFields(); fields.hasNext();) {
+            FormField field = fields.next();
             columns.add(new Column(field.getLabel(), field.getVariable(), field.getType()));
         }
 
         // Add the rows to the report based on the form's items
-        for (Iterator items = dataForm.getItems(); items.hasNext();) {
-            DataForm.Item item = (DataForm.Item)items.next();
+        for (Iterator<DataForm.Item> items = dataForm.getItems(); items.hasNext();) {
+            DataForm.Item item = items.next();
             List<Field> fieldList = new ArrayList<Field>(columns.size());
             FormField field;
-            for (Iterator fields = item.getFields(); fields.hasNext();) {
-                field = (FormField) fields.next();
+            for (Iterator<FormField> fields = item.getFields(); fields.hasNext();) {
+                field = fields.next();
                 // The field is created with all the values of the data form's field
                 List<String> values = new ArrayList<String>();
                 for (Iterator<String> it=field.getValues(); it.hasNext();) {
@@ -231,7 +231,7 @@
          * @param variable the variable to match.
          * @return the values of the field whose variable matches the requested variable.
          */
-        public Iterator getValues(String variable) {
+        public Iterator<String> getValues(String variable) {
             for(Iterator<Field> it=getFields();it.hasNext();) {
                 Field field = it.next();
                 if (variable.equalsIgnoreCase(field.getVariable())) {
Index: source/org/jivesoftware/smackx/bookmark/BookmarkManager.java
===================================================================
--- source/org/jivesoftware/smackx/bookmark/BookmarkManager.java	(revision 10959)
+++ source/org/jivesoftware/smackx/bookmark/BookmarkManager.java	(working copy)
@@ -36,7 +36,7 @@
  * @author Alexander Wenckus
  */
 public class BookmarkManager {
-    private static final Map bookmarkManagerMap = new HashMap();
+    private static final Map<XMPPConnection, BookmarkManager> bookmarkManagerMap = new HashMap<XMPPConnection, BookmarkManager>();
     static {
         PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks",
                 new Bookmarks.Provider());
@@ -87,7 +87,7 @@
      * the server.
      * @see BookmarkedConference
      */
-    public Collection getBookmarkedConferences() throws XMPPException {
+    public Collection<BookmarkedConference> getBookmarkedConferences() throws XMPPException {
         retrieveBookmarks();
         return Collections.unmodifiableCollection(bookmarks.getBookmarkedConferences());
     }
@@ -109,7 +109,7 @@
         retrieveBookmarks();
         BookmarkedConference bookmark
                 = new BookmarkedConference(name, jid, isAutoJoin, nickname, password);
-        List conferences = bookmarks.getBookmarkedConferences();
+        List<BookmarkedConference> conferences = bookmarks.getBookmarkedConferences();
         if(conferences.contains(bookmark)) {
             BookmarkedConference oldConference = (BookmarkedConference)
                     conferences.get(conferences.indexOf(bookmark));
@@ -138,7 +138,7 @@
      */
     public void removeBookmarkedConference(String jid) throws XMPPException {
         retrieveBookmarks();
-        Iterator it = bookmarks.getBookmarkedConferences().iterator();
+        Iterator<BookmarkedConference> it = bookmarks.getBookmarkedConferences().iterator();
         while(it.hasNext()) {
             BookmarkedConference conference = (BookmarkedConference) it.next();
             if(conference.getJid().equalsIgnoreCase(jid)) {
@@ -158,7 +158,7 @@
      * @return returns an unmodifiable collection of all bookmarked urls.
      * @throws XMPPException thrown when there is a problem retriving bookmarks from the server.
      */
-    public Collection getBookmarkedURLs() throws XMPPException {
+    public Collection<BookmarkedURL> getBookmarkedURLs() throws XMPPException {
         retrieveBookmarks();
         return Collections.unmodifiableCollection(bookmarks.getBookmarkedURLS());
     }
@@ -175,7 +175,7 @@
     public void addBookmarkedURL(String URL, String name, boolean isRSS) throws XMPPException {
         retrieveBookmarks();
         BookmarkedURL bookmark = new BookmarkedURL(URL, name, isRSS);
-        List urls = bookmarks.getBookmarkedURLS();
+        List<BookmarkedURL> urls = bookmarks.getBookmarkedURLS();
         if(urls.contains(bookmark)) {
             BookmarkedURL oldURL = (BookmarkedURL) urls.get(urls.indexOf(bookmark));
             if(oldURL.isShared()) {
@@ -199,7 +199,7 @@
      */
     public void removeBookmarkedURL(String bookmarkURL) throws XMPPException {
         retrieveBookmarks();
-        Iterator it = bookmarks.getBookmarkedURLS().iterator();
+        Iterator<BookmarkedURL> it = bookmarks.getBookmarkedURLS().iterator();
         while(it.hasNext()) {
             BookmarkedURL bookmark = (BookmarkedURL) it.next();
             if(bookmark.getURL().equalsIgnoreCase(bookmarkURL)) {
Index: source/org/jivesoftware/smackx/packet/VCard.java
===================================================================
--- source/org/jivesoftware/smackx/packet/VCard.java	(revision 10959)
+++ source/org/jivesoftware/smackx/packet/VCard.java	(working copy)
@@ -740,9 +740,9 @@
         }
 
         private void appendPhones(Map<String, String> phones, final String code) {
-            Iterator it = phones.entrySet().iterator();
+            Iterator<Map.Entry<String, String>> it = phones.entrySet().iterator();
             while (it.hasNext()) {
-                final Map.Entry entry = (Map.Entry) it.next();
+                final Map.Entry<String, String> entry = it.next();
                 appendTag("TEL", true, new ContentBuilder() {
                     public void addTagContent() {
                         appendEmptyTag(entry.getKey());
@@ -759,9 +759,9 @@
                     public void addTagContent() {
                         appendEmptyTag(code);
 
-                        Iterator it = addr.entrySet().iterator();
+                        Iterator<Map.Entry<String,String>> it = addr.entrySet().iterator();
                         while (it.hasNext()) {
-                            final Map.Entry entry = (Map.Entry) it.next();
+                            final Map.Entry<String, String> entry = it.next();
                             appendTag((String) entry.getKey(), StringUtils.escapeForXML((String) entry.getValue()));
                         }
                     }
@@ -774,16 +774,16 @@
         }
 
         private void appendGenericFields() {
-            Iterator it = otherSimpleFields.entrySet().iterator();
+            Iterator<Map.Entry<String,String>> it = otherSimpleFields.entrySet().iterator();
             while (it.hasNext()) {
-                Map.Entry entry = (Map.Entry) it.next();
+            	Map.Entry<String,String> entry = it.next();
                 appendTag(entry.getKey().toString(),
                         StringUtils.escapeForXML((String) entry.getValue()));
             }
 
             it = otherUnescapableFields.entrySet().iterator();
             while (it.hasNext()) {
-                Map.Entry entry = (Map.Entry) it.next();
+            	Map.Entry<String,String> entry = (Map.Entry<String,String>) it.next();
                 appendTag(entry.getKey().toString(), (String) entry.getValue());
             }
         }
Index: source/org/jivesoftware/smackx/provider/VCardProvider.java
===================================================================
--- source/org/jivesoftware/smackx/provider/VCardProvider.java	(revision 10959)
+++ source/org/jivesoftware/smackx/provider/VCardProvider.java	(working copy)
@@ -184,8 +184,8 @@
                 Element addressNode = (Element) allAddresses.item(i);
 
                 String type = null;
-                List code = new ArrayList();
-                List value = new ArrayList();
+                List<String> code = new ArrayList<String>();
+                List<String> value = new ArrayList<String>();
                 NodeList childNodes = addressNode.getChildNodes();
                 for (int j = 0; j < childNodes.getLength(); j++) {
                     Node node = childNodes.item(j);
Index: source/org/jivesoftware/smack/NonSASLAuthentication.java
===================================================================
--- source/org/jivesoftware/smack/NonSASLAuthentication.java	(revision 10959)
+++ source/org/jivesoftware/smack/NonSASLAuthentication.java	(working copy)
@@ -20,15 +20,14 @@
 
 package org.jivesoftware.smack;
 
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.PasswordCallback;
+
 import org.jivesoftware.smack.filter.PacketIDFilter;
 import org.jivesoftware.smack.packet.Authentication;
 import org.jivesoftware.smack.packet.IQ;
 
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.Callback;
-import java.io.IOException;
-
 /**
  * Implementation of JEP-0078: Non-SASL Authentication. Follow the following
  * <a href=http://www.jabber.org/jeps/jep-0078.html>link</a> to obtain more
Index: source/org/jivesoftware/smackx/MultipleRecipientInfo.java
===================================================================
--- source/org/jivesoftware/smackx/MultipleRecipientInfo.java	(revision 10959)
+++ source/org/jivesoftware/smackx/MultipleRecipientInfo.java	(working copy)
@@ -44,7 +44,7 @@
      *
      * @return list of primary recipients of the packet.
      */
-    public List getTOAddresses() {
+    public List<MultipleAddresses.Address>  getTOAddresses() {
         return extension.getAddressesOfType(MultipleAddresses.TO);
     }
 
@@ -54,7 +54,7 @@
      *
      * @return list of secondary recipients of the packet.
      */
-    public List getCCAddresses() {
+    public List<MultipleAddresses.Address>  getCCAddresses() {
         return extension.getAddressesOfType(MultipleAddresses.CC);
     }
 
@@ -68,8 +68,8 @@
      *         no specific address was provided.
      */
     public String getReplyRoom() {
-        List replyRoom = extension.getAddressesOfType(MultipleAddresses.REPLY_ROOM);
-        return replyRoom.isEmpty() ? null : ((MultipleAddresses.Address) replyRoom.get(0)).getJid();
+        List<MultipleAddresses.Address> replyRoom = extension.getAddressesOfType(MultipleAddresses.REPLY_ROOM);
+        return replyRoom.isEmpty() ? null : (replyRoom.get(0)).getJid();
     }
 
     /**
@@ -92,7 +92,7 @@
      *         no specific address was provided.
      */
     public MultipleAddresses.Address getReplyAddress() {
-        List replyTo = extension.getAddressesOfType(MultipleAddresses.REPLY_TO);
-        return replyTo.isEmpty() ? null : (MultipleAddresses.Address) replyTo.get(0);
+        List<MultipleAddresses.Address> replyTo = extension.getAddressesOfType(MultipleAddresses.REPLY_TO);
+        return replyTo.isEmpty() ? null : replyTo.get(0);
     }
 }
Index: source/org/jivesoftware/smackx/PEPManager.java
===================================================================
--- source/org/jivesoftware/smackx/PEPManager.java	(revision 10959)
+++ source/org/jivesoftware/smackx/PEPManager.java	(working copy)
@@ -126,8 +126,8 @@
             listeners = new PEPListener[pepListeners.size()];
             pepListeners.toArray(listeners);
         }
-        for (int i = 0; i < listeners.length; i++) {
-            listeners[i].eventReceived(from, event);
+        for (PEPListener listener : pepListeners) {
+        	listener.eventReceived(from, event);
         }
     }
 
Index: source/org/jivesoftware/smack/proxy/Socks4ProxySocketFactory.java
===================================================================
--- source/org/jivesoftware/smack/proxy/Socks4ProxySocketFactory.java	(revision 10959)
+++ source/org/jivesoftware/smack/proxy/Socks4ProxySocketFactory.java	(working copy)
@@ -60,7 +60,8 @@
         String proxy_host = proxy.getProxyAddress();
         int proxy_port = proxy.getProxyPort();
         String user = proxy.getProxyUsername();
-        String passwd = proxy.getProxyPassword();
+        //not used
+        //String passwd = proxy.getProxyPassword();
         
         try
         {
Index: source/org/jivesoftware/smackx/packet/MUCOwner.java
===================================================================
--- source/org/jivesoftware/smackx/packet/MUCOwner.java	(revision 10959)
+++ source/org/jivesoftware/smackx/packet/MUCOwner.java	(working copy)
@@ -35,7 +35,7 @@
  */
 public class MUCOwner extends IQ {
 
-    private List items = new ArrayList();
+    private List<Item> items = new ArrayList<Item>();
     private Destroy destroy;
 
     /**
@@ -45,7 +45,7 @@
      * @return an Iterator for item childs that holds information about affiliation,
      *          jids and nicks.
      */
-    public Iterator getItems() {
+    public Iterator<Item> getItems() {
         synchronized (items) {
             return Collections.unmodifiableList(new ArrayList(items)).iterator();
         }
Index: source/org/jivesoftware/smack/sasl/SASLGSSAPIMechanism.java
===================================================================
--- source/org/jivesoftware/smack/sasl/SASLGSSAPIMechanism.java	(revision 10959)
+++ source/org/jivesoftware/smack/sasl/SASLGSSAPIMechanism.java	(working copy)
@@ -19,15 +19,15 @@
 
 package org.jivesoftware.smack.sasl;
 
-import org.jivesoftware.smack.SASLAuthentication;
-import org.jivesoftware.smack.XMPPException;
-
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.Map;
-import java.util.HashMap;
+
+import javax.security.auth.callback.CallbackHandler;
 import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslClient;
-import javax.security.auth.callback.CallbackHandler;
+
+import org.jivesoftware.smack.SASLAuthentication;
+import org.jivesoftware.smack.XMPPException;
 
 /**
  * Implementation of the SASL GSSAPI mechanism
@@ -61,7 +61,7 @@
      */
     public void authenticate(String username, String host, CallbackHandler cbh) throws IOException, XMPPException {
         String[] mechanisms = { getName() };
-        Map props = new HashMap();
+        Map<String, String> props = new HashMap<String, String>();
         props.put(Sasl.SERVER_AUTH,"TRUE");
         sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, cbh);
         authenticate();
@@ -80,7 +80,7 @@
      */
     public void authenticate(String username, String host, String password) throws IOException, XMPPException {
         String[] mechanisms = { getName() };
-        Map props = new HashMap();
+        Map<String, String> props = new HashMap<String, String>();
         props.put(Sasl.SERVER_AUTH,"TRUE");
         sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, this);
         authenticate();
Index: source/org/jivesoftware/smackx/packet/MessageEvent.java
===================================================================
--- source/org/jivesoftware/smackx/packet/MessageEvent.java	(revision 10959)
+++ source/org/jivesoftware/smackx/packet/MessageEvent.java	(working copy)
@@ -167,8 +167,8 @@
      *
      * @return an iterator over all the types of events of the MessageEvent.
      */
-    public Iterator getEventTypes() {
-        ArrayList allEvents = new ArrayList();
+    public Iterator<String> getEventTypes() {
+        ArrayList<String> allEvents = new ArrayList<String>();
         if (isDelivered()) {
             allEvents.add(MessageEvent.DELIVERED);
         }
Index: source/org/jivesoftware/smack/proxy/ProxyException.java
===================================================================
--- source/org/jivesoftware/smack/proxy/ProxyException.java	(revision 10959)
+++ source/org/jivesoftware/smack/proxy/ProxyException.java	(working copy)
@@ -10,7 +10,9 @@
 public class ProxyException 
     extends IOException
 {
-    public ProxyException(ProxyInfo.ProxyType type, String ex, Throwable cause)
+	private static final long serialVersionUID = 1L;
+
+	public ProxyException(ProxyInfo.ProxyType type, String ex, Throwable cause)
     {
         super("Proxy Exception " + type.toString() + " : "+ex+", "+cause);
     }
Index: jingle/extension/source/org/jivesoftware/smackx/jingle/JingleException.java
===================================================================
--- jingle/extension/source/org/jivesoftware/smackx/jingle/JingleException.java	(revision 10959)
+++ jingle/extension/source/org/jivesoftware/smackx/jingle/JingleException.java	(working copy)
@@ -11,7 +11,8 @@
      */
     public class JingleException extends XMPPException {
 
-        private final JingleError error;
+    	private static final long serialVersionUID = 1L;
+		private final JingleError error;
 
         /**
          * Default constructor.
Index: jingle/extension/source/org/jivesoftware/smackx/packet/JingleTransport.java
===================================================================
--- jingle/extension/source/org/jivesoftware/smackx/packet/JingleTransport.java	(revision 10959)
+++ jingle/extension/source/org/jivesoftware/smackx/packet/JingleTransport.java	(working copy)
@@ -95,7 +95,7 @@
      *
      * @return an iterator
      */
-    public Iterator getCandidates() {
+    public Iterator<JingleTransportCandidate> getCandidates() {
         return Collections.unmodifiableList(getCandidatesList()).iterator();
     }
 
@@ -160,7 +160,7 @@
         synchronized (candidates) {
             if (getCandidatesCount() > 0) {
                 buf.append(">");
-                Iterator iter = getCandidates();
+                Iterator<JingleTransportCandidate> iter = getCandidates();
 
                 while (iter.hasNext()) {
                     JingleTransportCandidate candidate = (JingleTransportCandidate) iter
Index: source/org/jivesoftware/smackx/RemoteRosterEntry.java
===================================================================
--- source/org/jivesoftware/smackx/RemoteRosterEntry.java	(revision 10959)
+++ source/org/jivesoftware/smackx/RemoteRosterEntry.java	(working copy)
@@ -77,7 +77,7 @@
      *
      * @return an Iterator for the group names.
      */
-    public Iterator getGroupNames() {
+    public Iterator<String> getGroupNames() {
         synchronized (groupNames) {
             return Collections.unmodifiableList(groupNames).iterator();
         }
Index: source/org/jivesoftware/smackx/bookmark/Bookmarks.java
===================================================================
--- source/org/jivesoftware/smackx/bookmark/Bookmarks.java	(revision 10959)
+++ source/org/jivesoftware/smackx/bookmark/Bookmarks.java	(working copy)
@@ -62,15 +62,15 @@
  */
 public class Bookmarks implements PrivateData {
 
-    private List bookmarkedURLS;
-    private List bookmarkedConferences;
+    private List<BookmarkedURL> bookmarkedURLS;
+    private List<BookmarkedConference> bookmarkedConferences;
 
     /**
      * Required Empty Constructor to use Bookmarks.
      */
     public Bookmarks() {
-        bookmarkedURLS = new ArrayList();
-        bookmarkedConferences = new ArrayList();
+        bookmarkedURLS = new ArrayList<BookmarkedURL>();
+        bookmarkedConferences = new ArrayList<BookmarkedConference>();
     }
 
     /**
@@ -128,7 +128,7 @@
      *
      * @return a collection of all Bookmarked URLs.
      */
-    public List getBookmarkedURLS() {
+    public List<BookmarkedURL> getBookmarkedURLS() {
         return bookmarkedURLS;
     }
 
@@ -137,7 +137,7 @@
      *
      * @return a collection of all Bookmarked Conferences.
      */
-    public List getBookmarkedConferences() {
+    public List<BookmarkedConference> getBookmarkedConferences() {
         return bookmarkedConferences;
     }
 
@@ -169,9 +169,9 @@
         StringBuilder buf = new StringBuilder();
         buf.append("<storage xmlns=\"storage:bookmarks\">");
 
-        final Iterator urls = getBookmarkedURLS().iterator();
+        final Iterator<BookmarkedURL> urls = getBookmarkedURLS().iterator();
         while (urls.hasNext()) {
-            BookmarkedURL urlStorage = (BookmarkedURL) urls.next();
+            BookmarkedURL urlStorage = urls.next();
             if(urlStorage.isShared()) {
                 continue;
             }
@@ -184,9 +184,9 @@
         }
 
         // Add Conference additions
-        final Iterator conferences = getBookmarkedConferences().iterator();
+        final Iterator<BookmarkedConference> conferences = getBookmarkedConferences().iterator();
         while (conferences.hasNext()) {
-            BookmarkedConference conference = (BookmarkedConference) conferences.next();
+            BookmarkedConference conference = conferences.next();
             if(conference.isShared()) {
                 continue;
             }
Index: source/org/jivesoftware/smackx/packet/SharedGroupsInfo.java
===================================================================
--- source/org/jivesoftware/smackx/packet/SharedGroupsInfo.java	(revision 10959)
+++ source/org/jivesoftware/smackx/packet/SharedGroupsInfo.java	(working copy)
@@ -19,21 +19,21 @@
  */
 public class SharedGroupsInfo extends IQ {
 
-    private List groups = new ArrayList();
+    private List<String> groups = new ArrayList<String>();
 
     /**
      * Returns a collection with the shared group names returned from the server.
      *
      * @return collection with the shared group names returned from the server.
      */
-    public List getGroups() {
+    public List<String> getGroups() {
         return groups;
     }
 
     public String getChildElementXML() {
         StringBuilder buf = new StringBuilder();
         buf.append("<sharedgroup xmlns=\"http://www.jivesoftware.org/protocol/sharedgroup\">");
-        for (Iterator it=groups.iterator(); it.hasNext();) {
+        for (Iterator<String> it=groups.iterator(); it.hasNext();) {
             buf.append("<group>").append(it.next()).append("</group>");
         }
         buf.append("</sharedgroup>");
Index: source/org/jivesoftware/smack/util/ObservableWriter.java
===================================================================
--- source/org/jivesoftware/smack/util/ObservableWriter.java	(revision 10959)
+++ source/org/jivesoftware/smack/util/ObservableWriter.java	(working copy)
@@ -84,8 +84,8 @@
             writerListeners = new WriterListener[listeners.size()];
             listeners.toArray(writerListeners);
         }
-        for (int i = 0; i < writerListeners.length; i++) {
-            writerListeners[i].write(str);
+        for (WriterListener listner : writerListeners) {
+        	listner.write(str);
         }
     }
 
Index: source/org/jivesoftware/smackx/packet/MUCAdmin.java
===================================================================
--- source/org/jivesoftware/smackx/packet/MUCAdmin.java	(revision 10959)
+++ source/org/jivesoftware/smackx/packet/MUCAdmin.java	(working copy)
@@ -36,7 +36,7 @@
  */
 public class MUCAdmin extends IQ {
 
-    private List items = new ArrayList();
+    private List<Item> items = new ArrayList<Item>();
 
     /**
      * Returns an Iterator for item childs that holds information about roles, affiliation, 
@@ -45,7 +45,7 @@
      * @return an Iterator for item childs that holds information about roles, affiliation,
      *          jids and nicks.
      */
-    public Iterator getItems() {
+    public Iterator<Item> getItems() {
         synchronized (items) {
             return Collections.unmodifiableList(new ArrayList(items)).iterator();
         }
@@ -66,8 +66,7 @@
         StringBuilder buf = new StringBuilder();
         buf.append("<query xmlns=\"http://jabber.org/protocol/muc#admin\">");
         synchronized (items) {
-            for (int i = 0; i < items.size(); i++) {
-                Item item = (Item) items.get(i);
+            for (Item item : items) {
                 buf.append(item.toXML());
             }
         }
Index: jingle/extension/source/org/jivesoftware/smackx/packet/Jingle.java
===================================================================
--- jingle/extension/source/org/jivesoftware/smackx/packet/Jingle.java	(revision 10959)
+++ jingle/extension/source/org/jivesoftware/smackx/packet/Jingle.java	(working copy)
@@ -218,7 +218,7 @@
      */
     public Iterator<JingleContent> getContents() {
         synchronized (contents) {
-            return Collections.unmodifiableList(new ArrayList(contents)).iterator();
+            return Collections.unmodifiableList(new ArrayList<JingleContent>(contents)).iterator();
         }
     }
 
Index: source/org/jivesoftware/smack/filter/PacketTypeFilter.java
===================================================================
--- source/org/jivesoftware/smack/filter/PacketTypeFilter.java	(revision 10959)
+++ source/org/jivesoftware/smack/filter/PacketTypeFilter.java	(working copy)
@@ -35,7 +35,7 @@
  */
 public class PacketTypeFilter implements PacketFilter {
 
-    Class packetType;
+    private Class packetType;
 
     /**
      * Creates a new packet type filter that will filter for packets that are the
Index: source/org/jivesoftware/smackx/packet/OfflineMessageRequest.java
===================================================================
--- source/org/jivesoftware/smackx/packet/OfflineMessageRequest.java	(revision 10959)
+++ source/org/jivesoftware/smackx/packet/OfflineMessageRequest.java	(working copy)
@@ -37,7 +37,7 @@
  */
 public class OfflineMessageRequest extends IQ {
 
-    private List items = new ArrayList();
+    private List<Item> items = new ArrayList<Item>();
     private boolean purge = false;
     private boolean fetch = false;
 
@@ -48,7 +48,7 @@
      * @return an Iterator for item childs that holds information about offline messages to
      *         view or delete.
      */
-    public Iterator getItems() {
+    public Iterator<Item> getItems() {
         synchronized (items) {
             return Collections.unmodifiableList(new ArrayList(items)).iterator();
         }
Index: source/org/jivesoftware/smack/util/ObservableReader.java
===================================================================
--- source/org/jivesoftware/smack/util/ObservableReader.java	(revision 10959)
+++ source/org/jivesoftware/smack/util/ObservableReader.java	(working copy)
@@ -32,7 +32,7 @@
 public class ObservableReader extends Reader {
 
     Reader wrappedReader = null;
-    List listeners = new ArrayList();
+    List<ReaderListener> listeners = new ArrayList<ReaderListener>();
 
     public ObservableReader(Reader wrappedReader) {
         this.wrappedReader = wrappedReader;
@@ -48,8 +48,9 @@
                 readerListeners = new ReaderListener[listeners.size()];
                 listeners.toArray(readerListeners);
             }
-            for (int i = 0; i < readerListeners.length; i++) {
-                readerListeners[i].read(str);
+            // int i = 0; i < readerListeners.length; i++
+            for (ReaderListener listener : readerListeners) {
+            	listener.read(str);
             }
         }
         return count;
Index: source/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiatorManager.java
===================================================================
--- source/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiatorManager.java	(revision 10959)
+++ source/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiatorManager.java	(working copy)
@@ -127,9 +127,9 @@
         catch (XMPPException e) {
             return null;
         }
-        Iterator itx = info.getIdentities();
+        Iterator<DiscoverInfo.Identity> itx = info.getIdentities();
         while (itx.hasNext()) {
-            DiscoverInfo.Identity identity = (DiscoverInfo.Identity) itx.next();
+            DiscoverInfo.Identity identity = itx.next();
             if ("proxy".equalsIgnoreCase(identity.getCategory())
                     && "bytestreams".equalsIgnoreCase(
                     identity.getType())) {
@@ -145,9 +145,9 @@
                 .getInstanceFor(connection);
         try {
             DiscoverItems discoItems = manager.discoverItems(connection.getServiceName());
-            Iterator it = discoItems.getItems();
+            Iterator<DiscoverItems.Item> it = discoItems.getItems();
             while (it.hasNext()) {
-                DiscoverItems.Item item = (DiscoverItems.Item) it.next();
+                DiscoverItems.Item item = it.next();
                 String proxy = checkIsProxy(manager, item);
                 if (proxy != null) {
                     proxies.add(proxy);
@@ -167,7 +167,7 @@
      */
     private void initStreamHosts() {
         List<Bytestream.StreamHost> streamHosts = new ArrayList<Bytestream.StreamHost>();
-        Iterator it = proxies.iterator();
+        Iterator<String> it = proxies.iterator();
         IQ query;
         PacketCollector collector;
         Bytestream response;
Index: jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java
===================================================================
--- jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java	(revision 10959)
+++ jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java	(working copy)
@@ -96,7 +96,7 @@
 	private static final SmackLogger LOGGER = SmackLogger.getLogger(JingleSession.class);
 
 	// static
-    private static final HashMap sessions = new HashMap();
+    private static final HashMap<XMPPConnection, JingleSession> sessions = new HashMap<XMPPConnection, JingleSession>();
 
     private static final Random randomGenerator = new Random();
 
Index: source/org/jivesoftware/smackx/search/SimpleUserSearch.java
===================================================================
--- source/org/jivesoftware/smackx/search/SimpleUserSearch.java	(revision 10959)
+++ source/org/jivesoftware/smackx/search/SimpleUserSearch.java	(working copy)
@@ -122,9 +122,9 @@
                 fields.add(field);
 
                 boolean exists = false;
-                Iterator cols = data.getColumns();
+                Iterator<ReportedData.Column> cols = data.getColumns();
                 while (cols.hasNext()) {
-                    ReportedData.Column column = (ReportedData.Column) cols.next();
+                    ReportedData.Column column = cols.next();
                     if (column.getVariable().equals(name)) {
                         exists = true;
                     }
Index: source/org/jivesoftware/smackx/provider/RosterExchangeProvider.java
===================================================================
--- source/org/jivesoftware/smackx/provider/RosterExchangeProvider.java	(revision 10959)
+++ source/org/jivesoftware/smackx/provider/RosterExchangeProvider.java	(working copy)
@@ -57,13 +57,13 @@
         RemoteRosterEntry remoteRosterEntry = null;
 		String jid = "";
 		String name = "";
-		ArrayList groupsName = new ArrayList();
+		ArrayList<String> groupsName = new ArrayList<String>();
         while (!done) {
             int eventType = parser.next();
             if (eventType == XmlPullParser.START_TAG) {
                 if (parser.getName().equals("item")) {
                 	// Reset this variable since they are optional for each item
-					groupsName = new ArrayList();
+					groupsName = new ArrayList<String>();
 					// Initialize the variables from the parsed XML
                     jid = parser.getAttributeValue("", "jid");
                     name = parser.getAttributeValue("", "name");
Index: source/org/jivesoftware/smackx/workgroup/util/ListenerEventDispatcher.java
===================================================================
--- source/org/jivesoftware/smackx/workgroup/util/ListenerEventDispatcher.java	(revision 10959)
+++ source/org/jivesoftware/smackx/workgroup/util/ListenerEventDispatcher.java	(working copy)
@@ -34,7 +34,7 @@
 public class ListenerEventDispatcher
     implements Runnable {
 
-    protected transient ArrayList triplets;
+    protected transient ArrayList<TripletContainer> triplets;
 
     protected transient boolean hasFinishedDispatching;
     protected transient boolean isRunning;
@@ -42,7 +42,7 @@
     public ListenerEventDispatcher () {
         super();
 
-        this.triplets = new ArrayList();
+        this.triplets = new ArrayList<TripletContainer>();
 
         this.hasFinishedDispatching = false;
         this.isRunning = false;
@@ -81,7 +81,7 @@
     }
 
     public void run() {
-        ListIterator li = null;
+        ListIterator<TripletContainer> li = null;
 
         this.isRunning = true;
 
Index: source/org/jivesoftware/smack/packet/Privacy.java
===================================================================
--- source/org/jivesoftware/smack/packet/Privacy.java	(revision 10959)
+++ source/org/jivesoftware/smack/packet/Privacy.java	(working copy)
@@ -58,7 +58,7 @@
      * @param listItem the {@link PrivacyItem} that rules the list.
      * @return the privacy List.
      */
-    public List setPrivacyList(String listName, List<PrivacyItem> listItem) {
+    public List<PrivacyItem> setPrivacyList(String listName, List<PrivacyItem> listItem) {
         // Add new list to the itemLists
         this.getItemLists().put(listName, listItem);
         return listItem;
Index: source/org/jivesoftware/smackx/provider/DiscoverInfoProvider.java
===================================================================
--- source/org/jivesoftware/smackx/provider/DiscoverInfoProvider.java	(revision 10959)
+++ source/org/jivesoftware/smackx/provider/DiscoverInfoProvider.java	(working copy)
@@ -36,7 +36,8 @@
     public IQ parseIQ(XmlPullParser parser) throws Exception {
         DiscoverInfo discoverInfo = new DiscoverInfo();
         boolean done = false;
-        DiscoverInfo.Feature feature = null;
+        //Removed not used
+        //DiscoverInfo.Feature feature = null;
         DiscoverInfo.Identity identity = null;
         String category = "";
         String name = "";
Index: source/org/jivesoftware/smackx/packet/RosterExchange.java
===================================================================
--- source/org/jivesoftware/smackx/packet/RosterExchange.java	(revision 10959)
+++ source/org/jivesoftware/smackx/packet/RosterExchange.java	(working copy)
@@ -52,7 +52,7 @@
  */
 public class RosterExchange implements PacketExtension {
 
-    private List remoteRosterEntries = new ArrayList();
+    private List<RemoteRosterEntry> remoteRosterEntries = new ArrayList<RemoteRosterEntry>();
 
     /**
      * Creates a new empty roster exchange package.
Index: source/org/jivesoftware/smackx/Form.java
===================================================================
--- source/org/jivesoftware/smackx/Form.java	(revision 10959)
+++ source/org/jivesoftware/smackx/Form.java	(working copy)
@@ -389,8 +389,8 @@
     public String getInstructions() {
         StringBuilder sb = new StringBuilder();
         // Join the list of instructions together separated by newlines
-        for (Iterator it = dataForm.getInstructions(); it.hasNext();) {
-            sb.append((String) it.next());
+        for (Iterator<String> it = dataForm.getInstructions(); it.hasNext();) {
+            sb.append(it.next());
             // If this is not the last instruction then append a newline
             if (it.hasNext()) {
                 sb.append("\n");
Index: source/org/jivesoftware/smack/util/DNSUtil.java
===================================================================
--- source/org/jivesoftware/smack/util/DNSUtil.java	(revision 10959)
+++ source/org/jivesoftware/smack/util/DNSUtil.java	(working copy)
@@ -36,13 +36,13 @@
      * Create a cache to hold the 100 most recently accessed DNS lookups for a period of
      * 10 minutes.
      */
-    private static Map cache = new Cache(100, 1000*60*10);
+    private static Map<String, HostAddress> cache = new Cache<String, HostAddress>(100, 1000*60*10);
 
     private static DirContext context;
 
     static {
         try {
-            Hashtable env = new Hashtable();
+            Hashtable<String, String> env = new Hashtable<String, String>();
             env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
             context = new InitialDirContext(env);
         }
Index: source/org/jivesoftware/smack/SmackConfiguration.java
===================================================================
--- source/org/jivesoftware/smack/SmackConfiguration.java	(revision 10959)
+++ source/org/jivesoftware/smack/SmackConfiguration.java	(working copy)
@@ -65,9 +65,9 @@
             // Get an array of class loaders to try loading the providers files from.
             ClassLoader[] classLoaders = getClassLoaders();
             for (ClassLoader classLoader : classLoaders) {
-                Enumeration configEnum = classLoader.getResources("META-INF/smack-config.xml");
+                Enumeration<URL> configEnum = classLoader.getResources("META-INF/smack-config.xml");
                 while (configEnum.hasMoreElements()) {
-                    URL url = (URL) configEnum.nextElement();
+                    URL url = configEnum.nextElement();
                     InputStream systemStream = null;
                     try {
                         systemStream = url.openStream();
Index: jingle/extension/source/org/jivesoftware/smackx/packet/JingleContentDescription.java
===================================================================
--- jingle/extension/source/org/jivesoftware/smackx/packet/JingleContentDescription.java	(revision 10959)
+++ jingle/extension/source/org/jivesoftware/smackx/packet/JingleContentDescription.java	(working copy)
@@ -19,14 +19,14 @@
  */
 package org.jivesoftware.smackx.packet;
 
-import org.jivesoftware.smack.packet.PacketExtension;
-import org.jivesoftware.smackx.jingle.media.PayloadType;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
+import org.jivesoftware.smack.packet.PacketExtension;
+import org.jivesoftware.smackx.jingle.media.PayloadType;
+
 /**
  * Jingle content description.
  *
@@ -40,7 +40,7 @@
 
     // non-static
 
-    private final List payloads = new ArrayList();
+    private final List<JinglePayloadType> payloads = new ArrayList<JinglePayloadType>();
 
     /**
      * Creates a content description..
@@ -81,11 +81,11 @@
      *
      * @param pts the payloads to add.
      */
-    public void addAudioPayloadTypes(final List pts) {
+    public void addAudioPayloadTypes(final List<PayloadType.Audio> pts) {
         synchronized (payloads) {
-            Iterator ptIter = pts.iterator();
+            Iterator<PayloadType.Audio> ptIter = pts.iterator();
             while (ptIter.hasNext()) {
-                PayloadType.Audio pt = (PayloadType.Audio) ptIter.next();
+                PayloadType.Audio pt = ptIter.next();
                 addJinglePayloadType(new JinglePayloadType.Audio(pt));
             }
         }
@@ -96,7 +96,7 @@
      *
      * @return an Iterator for the audio payloads in the packet.
      */
-    public Iterator getJinglePayloadTypes() {
+    public Iterator<JinglePayloadType> getJinglePayloadTypes() {
         return Collections.unmodifiableList(getJinglePayloadTypesList()).iterator();
     }
 
@@ -105,9 +105,9 @@
      *
      * @return a list for the audio payloads in the packet.
      */
-    public ArrayList getJinglePayloadTypesList() {
+    public ArrayList<JinglePayloadType> getJinglePayloadTypesList() {
         synchronized (payloads) {
-            return new ArrayList(payloads);
+            return new ArrayList<JinglePayloadType>(payloads);
         }
     }
 
@@ -116,9 +116,9 @@
      *
      * @return a list of PayloadType.Audio
      */
-    public ArrayList getAudioPayloadTypesList() {
-        ArrayList result = new ArrayList();
-        Iterator jinglePtsIter = getJinglePayloadTypes();
+    public ArrayList<PayloadType> getAudioPayloadTypesList() {
+        ArrayList<PayloadType> result = new ArrayList<PayloadType>();
+        Iterator<JinglePayloadType> jinglePtsIter = getJinglePayloadTypes();
 
         while (jinglePtsIter.hasNext()) {
             JinglePayloadType jpt = (JinglePayloadType) jinglePtsIter.next();
@@ -155,7 +155,7 @@
                 buf.append("<").append(getElementName());
                 buf.append(" xmlns=\"").append(getNamespace()).append("\" >");
 
-                Iterator pt = payloads.listIterator();
+                Iterator<JinglePayloadType> pt = payloads.listIterator();
                 while (pt.hasNext()) {
                     JinglePayloadType pte = (JinglePayloadType) pt.next();
                     buf.append(pte.toXML());
Index: source/org/jivesoftware/smackx/debugger/EnhancedDebugger.java
===================================================================
--- source/org/jivesoftware/smackx/debugger/EnhancedDebugger.java	(revision 10959)
+++ source/org/jivesoftware/smackx/debugger/EnhancedDebugger.java	(working copy)
@@ -253,7 +253,9 @@
                 new DefaultTableModel(
                         new Object[]{"Hide", "Timestamp", "", "", "Message", "Id", "Type", "To", "From"},
                         0) {
-                    public boolean isCellEditable(int rowIndex, int mColIndex) {
+					private static final long serialVersionUID = 1L;
+
+					public boolean isCellEditable(int rowIndex, int mColIndex) {
                         return false;
                     }
 
@@ -645,7 +647,9 @@
                 new DefaultTableModel(new Object[][]{{"IQ", 0, 0}, {"Message", 0, 0},
                         {"Presence", 0, 0}, {"Other", 0, 0}, {"Total", 0, 0}},
                         new Object[]{"Type", "Received", "Sent"}) {
-                    public boolean isCellEditable(int rowIndex, int mColIndex) {
+        			private static final long serialVersionUID = 1L;
+
+					public boolean isCellEditable(int rowIndex, int mColIndex) {
                         return false;
                     }
                 };
Index: source/org/jivesoftware/smackx/packet/DataForm.java
===================================================================
--- source/org/jivesoftware/smackx/packet/DataForm.java	(revision 10959)
+++ source/org/jivesoftware/smackx/packet/DataForm.java	(working copy)
@@ -202,7 +202,7 @@
         if (getTitle() != null) {
             buf.append("<title>").append(getTitle()).append("</title>");
         }
-        for (Iterator it=getInstructions(); it.hasNext();) {
+        for (Iterator<String> it=getInstructions(); it.hasNext();) {
             buf.append("<instructions>").append(it.next()).append("</instructions>");
         }
         // Append the list of fields returned from a search
@@ -210,13 +210,13 @@
             buf.append(getReportedData().toXML());
         }
         // Loop through all the items returned from a search and append them to the string buffer
-        for (Iterator i = getItems(); i.hasNext();) {
-            Item item = (Item) i.next();
+        for (Iterator<Item> i = getItems(); i.hasNext();) {
+            Item item = i.next();
             buf.append(item.toXML());
         }
         // Loop through all the form fields and append them to the string buffer
-        for (Iterator i = getFields(); i.hasNext();) {
-            FormField field = (FormField) i.next();
+        for (Iterator<FormField> i = getFields(); i.hasNext();) {
+            FormField field = i.next();
             buf.append(field.toXML());
         }
         buf.append("</").append(getElementName()).append(">");
@@ -250,8 +250,8 @@
             StringBuilder buf = new StringBuilder();
             buf.append("<reported>");
             // Loop through all the form items and append them to the string buffer
-            for (Iterator i = getFields(); i.hasNext();) {
-                FormField field = (FormField) i.next();
+            for (Iterator<FormField> i = getFields(); i.hasNext();) {
+                FormField field = i.next();
                 buf.append(field.toXML());
             }
             buf.append("</reported>");
@@ -285,8 +285,8 @@
             StringBuilder buf = new StringBuilder();
             buf.append("<item>");
             // Loop through all the form items and append them to the string buffer
-            for (Iterator i = getFields(); i.hasNext();) {
-                FormField field = (FormField) i.next();
+            for (Iterator<FormField> i = getFields(); i.hasNext();) {
+                FormField field = i.next();
                 buf.append(field.toXML());
             }
             buf.append("</item>");
Index: source/org/jivesoftware/smackx/FormField.java
===================================================================
--- source/org/jivesoftware/smackx/FormField.java	(revision 10959)
+++ source/org/jivesoftware/smackx/FormField.java	(working copy)
@@ -292,8 +292,8 @@
             buf.append("<value>").append(i.next()).append("</value>");
         }
         // Loop through all the values and append them to the string buffer
-        for (Iterator i = getOptions(); i.hasNext();) {
-            buf.append(((Option) i.next()).toXML());
+        for (Iterator<Option> i = getOptions(); i.hasNext();) {
+            buf.append(i.next().toXML());
         }
         buf.append("</field>");
         return buf.toString();
Index: source/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java
===================================================================
--- source/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java	(revision 10959)
+++ source/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java	(working copy)
@@ -179,11 +179,11 @@
      */
     private SelectedHostInfo selectHost(Bytestream streamHostsInfo)
             throws XMPPException {
-        Iterator it = streamHostsInfo.getStreamHosts().iterator();
+        Iterator<StreamHost> it = streamHostsInfo.getStreamHosts().iterator();
         StreamHost selectedHost = null;
         Socket socket = null;
         while (it.hasNext()) {
-            selectedHost = (StreamHost) it.next();
+            selectedHost = it.next();
             String address = selectedHost.getAddress();
 
             // Check to see if this address has been blacklisted
Index: source/org/jivesoftware/smack/sasl/SASLMechanism.java
===================================================================
--- source/org/jivesoftware/smack/sasl/SASLMechanism.java	(revision 10959)
+++ source/org/jivesoftware/smack/sasl/SASLMechanism.java	(working copy)
@@ -178,21 +178,21 @@
      * 
      */
     public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
-        for (int i = 0; i < callbacks.length; i++) {
-            if (callbacks[i] instanceof NameCallback) {
-                NameCallback ncb = (NameCallback)callbacks[i];
+        for (Callback callback : callbacks) {     	
+            if (callback instanceof NameCallback) {
+                NameCallback ncb = (NameCallback)callback;
                 ncb.setName(authenticationId);
-            } else if(callbacks[i] instanceof PasswordCallback) {
-                PasswordCallback pcb = (PasswordCallback)callbacks[i];
+            } else if(callback instanceof PasswordCallback) {
+                PasswordCallback pcb = (PasswordCallback)callback;
                 pcb.setPassword(password.toCharArray());
-            } else if(callbacks[i] instanceof RealmCallback) {
-                RealmCallback rcb = (RealmCallback)callbacks[i];
+            } else if(callback instanceof RealmCallback) {
+                RealmCallback rcb = (RealmCallback)callback;
                 rcb.setText(hostname);
-            } else if(callbacks[i] instanceof RealmChoiceCallback){
+            } else if(callback instanceof RealmChoiceCallback){
                 //unused
                 //RealmChoiceCallback rccb = (RealmChoiceCallback)callbacks[i];
             } else {
-               throw new UnsupportedCallbackException(callbacks[i]);
+               throw new UnsupportedCallbackException(callback);
             }
          }
     }
Index: source/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java
===================================================================
--- source/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java	(revision 10959)
+++ source/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java	(working copy)
@@ -260,16 +260,16 @@
             listeners = new AgentRosterListener[this.listeners.size()];
             this.listeners.toArray(listeners);
         }
-        for (int i = 0; i < listeners.length; i++) {
+        for (AgentRosterListener listener : listeners) {
             switch (eventType) {
                 case EVENT_AGENT_ADDED:
-                    listeners[i].agentAdded((String)eventObject);
+                	listener.agentAdded((String)eventObject);
                     break;
                 case EVENT_AGENT_REMOVED:
-                    listeners[i].agentRemoved((String)eventObject);
+                	listener.agentRemoved((String)eventObject);
                     break;
                 case EVENT_PRESENCE_CHANGED:
-                    listeners[i].presenceChanged((Presence)eventObject);
+                	listener.presenceChanged((Presence)eventObject);
                     break;
             }
         }
Index: source/org/jivesoftware/smackx/workgroup/util/ModelUtil.java
===================================================================
--- source/org/jivesoftware/smackx/workgroup/util/ModelUtil.java	(revision 10959)
+++ source/org/jivesoftware/smackx/workgroup/util/ModelUtil.java	(working copy)
@@ -130,9 +130,8 @@
      */
     public static final boolean hasNonNullElement(Object[] array) {
         if (array != null) {
-            final int n = array.length;
-            for (int i = 0; i < n; i++) {
-                if (array[i] != null) {
+            for (Object obj : array) {
+                if (obj != null) {
                     return true;
                 }
             }
@@ -163,9 +162,7 @@
     public static final String concat(String[] strs, String delim) {
         if (strs != null) {
             final StringBuilder buf = new StringBuilder();
-            final int n = strs.length;
-            for (int i = 0; i < n; i++) {
-                final String str = strs[i];
+            for (String str : strs) {
                 if (str != null) {
                     buf.append(str).append(delim);
                 }
Index: source/org/jivesoftware/smackx/MessageEventManager.java
===================================================================
--- source/org/jivesoftware/smackx/MessageEventManager.java	(revision 10959)
+++ source/org/jivesoftware/smackx/MessageEventManager.java	(working copy)
@@ -38,8 +38,8 @@
  */
 public class MessageEventManager {
 
-    private List messageEventNotificationListeners = new ArrayList();
-    private List messageEventRequestListeners = new ArrayList();
+    private List<MessageEventNotificationListener> messageEventNotificationListeners = new ArrayList<MessageEventNotificationListener>();
+    private List<MessageEventRequestListener> messageEventRequestListeners = new ArrayList<MessageEventRequestListener>();
 
     private XMPPConnection con;
 
@@ -201,18 +201,18 @@
                     (MessageEvent) message.getExtension("x", "jabber:x:event");
                 if (messageEvent.isMessageEventRequest()) {
                     // Fire event for requests of message events
-                    for (Iterator it = messageEvent.getEventTypes(); it.hasNext();)
+                    for (Iterator<String> it = messageEvent.getEventTypes(); it.hasNext();)
                         fireMessageEventRequestListeners(
                             message.getFrom(),
                             message.getPacketID(),
-                            ((String) it.next()).concat("NotificationRequested"));
+                            (it.next()).concat("NotificationRequested"));
                 } else
                     // Fire event for notifications of message events
-                    for (Iterator it = messageEvent.getEventTypes(); it.hasNext();)
+                    for (Iterator<String> it = messageEvent.getEventTypes(); it.hasNext();)
                         fireMessageEventNotificationListeners(
                             message.getFrom(),
                             messageEvent.getPacketID(),
-                            ((String) it.next()).concat("Notification"));
+                            (it.next()).concat("Notification"));
 
             };
 
Index: source/org/jivesoftware/smackx/OfflineMessageManager.java
===================================================================
--- source/org/jivesoftware/smackx/OfflineMessageManager.java	(revision 10959)
+++ source/org/jivesoftware/smackx/OfflineMessageManager.java	(working copy)
@@ -113,8 +113,8 @@
         List<OfflineMessageHeader> answer = new ArrayList<OfflineMessageHeader>();
         DiscoverItems items = ServiceDiscoveryManager.getInstanceFor(connection).discoverItems(
                 null, namespace);
-        for (Iterator it = items.getItems(); it.hasNext();) {
-            DiscoverItems.Item item = (DiscoverItems.Item) it.next();
+        for (Iterator<DiscoverItems.Item> it = items.getItems(); it.hasNext();) {
+            DiscoverItems.Item item = it.next();
             answer.add(new OfflineMessageHeader(item));
         }
         return answer.iterator();
Index: source/org/jivesoftware/smackx/packet/DefaultPrivateData.java
===================================================================
--- source/org/jivesoftware/smackx/packet/DefaultPrivateData.java	(revision 10959)
+++ source/org/jivesoftware/smackx/packet/DefaultPrivateData.java	(working copy)
@@ -51,7 +51,7 @@
 
     private String elementName;
     private String namespace;
-    private Map map;
+    private Map<String, String> map;
 
     /**
      * Creates a new generic private data object.
@@ -85,8 +85,8 @@
     public String toXML() {
         StringBuilder buf = new StringBuilder();
         buf.append("<").append(elementName).append(" xmlns=\"").append(namespace).append("\">");
-        for (Iterator i=getNames(); i.hasNext(); ) {
-            String name = (String)i.next();
+        for (Iterator<String> i=getNames(); i.hasNext(); ) {
+            String name = i.next();
             String value = getValue(name);
             buf.append("<").append(name).append(">");
             buf.append(value);
@@ -102,11 +102,11 @@
      *
      * @return an Iterator for the names.
      */
-    public synchronized Iterator getNames() {
+    public synchronized Iterator<String> getNames() {
         if (map == null) {
             return Collections.EMPTY_LIST.iterator();
         }
-        return Collections.unmodifiableMap(new HashMap(map)).keySet().iterator();
+        return Collections.unmodifiableMap(new HashMap<String, String>(map)).keySet().iterator();
     }
 
     /**
@@ -130,7 +130,7 @@
      */
     public synchronized void setValue(String name, String value) {
         if (map == null) {
-            map = new HashMap();
+            map = new HashMap<String, String>();
         }
         map.put(name, value);
     }
Index: source/org/jivesoftware/smackx/muc/MultiUserChat.java
===================================================================
--- source/org/jivesoftware/smackx/muc/MultiUserChat.java	(revision 10959)
+++ source/org/jivesoftware/smackx/muc/MultiUserChat.java	(working copy)
@@ -1673,8 +1673,8 @@
         }
         // Get the list of affiliates from the server's answer
         List<Affiliate> affiliates = new ArrayList<Affiliate>();
-        for (Iterator it = answer.getItems(); it.hasNext();) {
-            affiliates.add(new Affiliate((MUCOwner.Item) it.next()));
+        for (Iterator<MUCOwner.Item> it = answer.getItems(); it.hasNext();) {
+            affiliates.add(new Affiliate(it.next()));
         }
         return affiliates;
     }
@@ -1714,8 +1714,8 @@
         }
         // Get the list of affiliates from the server's answer
         List<Affiliate> affiliates = new ArrayList<Affiliate>();
-        for (Iterator it = answer.getItems(); it.hasNext();) {
-            affiliates.add(new Affiliate((MUCAdmin.Item) it.next()));
+        for (Iterator<MUCAdmin.Item> it = answer.getItems(); it.hasNext();) {
+            affiliates.add(new Affiliate(it.next()));
         }
         return affiliates;
     }
@@ -1776,8 +1776,8 @@
         }
         // Get the list of participants from the server's answer
         List<Occupant> participants = new ArrayList<Occupant>();
-        for (Iterator it = answer.getItems(); it.hasNext();) {
-            participants.add(new Occupant((MUCAdmin.Item) it.next()));
+        for (Iterator<MUCAdmin.Item> it = answer.getItems(); it.hasNext();) {
+            participants.add(new Occupant(it.next()));
         }
         return participants;
     }
