Index: /main/trunk/greenstone3/src/java/org/greenstone/admin/gui/ConfPane.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/admin/gui/ConfPane.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/admin/gui/ConfPane.java	(revision 25635)
@@ -81,5 +81,5 @@
 
 	protected JPanel main_contentPane = null;
-	public Hashtable conf_table;
+	public Hashtable<Object, Object> conf_table;
 
 	/** The panel that contains a Conf_list */
@@ -158,5 +158,5 @@
 
 	//An array to store all the details in the build.properties file
-	private ArrayList conf_array;
+	private ArrayList<String> conf_array;
 
 	//Site configuration
@@ -172,5 +172,5 @@
 	public ConfPane()
 	{
-		conf_table = new Hashtable();
+		conf_table = new Hashtable<Object, Object>();
 		// create all the control button panes
 		inner_control_pane = new JPanel();
@@ -652,5 +652,5 @@
 	{
 		String new_string;
-		Enumeration keys = conf_table.keys();
+		Enumeration<Object> keys = conf_table.keys();
 		String key;
 		String value;
@@ -662,5 +662,5 @@
 			for (int j = 0; j < conf_array.size(); j++)
 			{
-				if (((String) conf_array.get(j)).startsWith(key.toLowerCase()))
+				if (conf_array.get(j).startsWith(key.toLowerCase()))
 				{
 					new_string = key + "=" + value;
@@ -719,5 +719,5 @@
 		 * store all the details from the build.properties
 		 */
-		conf_array = new ArrayList();
+		conf_array = new ArrayList<String>();
 		conf_setting = new Object[rowLength][colLength];
 		try
Index: /main/trunk/greenstone3/src/java/org/greenstone/admin/gui/LogPane.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/admin/gui/LogPane.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/admin/gui/LogPane.java	(revision 25635)
@@ -93,5 +93,5 @@
     private JPanel control_pane = null;
 
-    private ArrayList logFiles = new ArrayList();
+    private ArrayList<File> logFiles = new ArrayList<File>();
     private File currentlySelectedFile = null;
       
@@ -387,5 +387,5 @@
 		    //no selection
 		} else if (log_list.getSelectedIndex () == 0 ) {
-		    File log_file = (File)logFiles.get(0);
+		    File log_file = logFiles.get(0);
 		    currentlySelectedFile = log_file;
 		    String filename = log_file.getPath();
@@ -394,5 +394,5 @@
 		    clear_button.setEnabled(true);
 		} else if (log_list.getSelectedIndex () == 1) {
-		    File log_file = (File)logFiles.get(1);
+		    File log_file = logFiles.get(1);
 		    currentlySelectedFile = log_file;
 		    String filename = log_file.getPath();
Index: /main/trunk/greenstone3/src/java/org/greenstone/admin/gui/SetServerPane.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/admin/gui/SetServerPane.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/admin/gui/SetServerPane.java	(revision 25635)
@@ -84,5 +84,5 @@
     ServerSettingTableModel server_setting_table_model = null;
     private boolean setting_confirm = false;
-    private ArrayList conf_array;
+    private ArrayList<String> conf_array;
     private boolean success = false;
     private boolean file_saved = true;
@@ -251,5 +251,5 @@
 	    if (!server_setting_table_model.getValueAt(i,1).toString().matches("^\\s*$")){
 		for (int j=0; j < conf_array.size(); j++){
-		    if (((String)conf_array.get(j)).startsWith(server_setting_table_model.getValueAt(i,0).toString().toLowerCase())){
+		    if (conf_array.get(j).startsWith(server_setting_table_model.getValueAt(i,0).toString().toLowerCase())){
 			//System.err.println("What is the value in conf_array:" + conf_array.get(j));
 			new_string = server_setting_table_model.getValueAt(i,0).toString()+"="+server_setting_table_model.getValueAt(i,1).toString();
@@ -265,5 +265,5 @@
 	String fileLine;
 	/*conf_array[] store all the details from the build.properties*/
-	conf_array = new ArrayList();
+	conf_array = new ArrayList<String>();
 	try {
 	    BufferedReader conf_in = new BufferedReader(new FileReader(filename));
Index: /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/Command.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/Command.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/Command.java	(revision 25635)
@@ -15,5 +15,5 @@
 public class Command implements Runnable
 {
-    HashMap _osCommands = new HashMap();
+    HashMap<String, String> _osCommands = new HashMap<String, String>();
     CommandStep _parent = null;
 
@@ -133,5 +133,5 @@
 	String currentos = System.getProperty("os.name");
 
-	String command = (String)_osCommands.get(currentos);
+	String command = _osCommands.get(currentos);
 	if(command != null){
 	    return command;
@@ -139,5 +139,5 @@
 	
 	if(currentos.contains("Windows")){
-	    command = (String)_osCommands.get("Windows");
+	    command = _osCommands.get("Windows");
 	    
 	    if(command != null){
@@ -145,5 +145,5 @@
 	    }   
 	}
-	return (String)_osCommands.get("default");
+	return _osCommands.get("default");
     }
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/CommandStep.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/CommandStep.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/CommandStep.java	(revision 25635)
@@ -27,5 +27,5 @@
 public class CommandStep extends Step
 {
-    protected ArrayList _commandsAndCallbacks = new ArrayList();
+    protected ArrayList<Runnable> _commandsAndCallbacks = new ArrayList<Runnable>();
     protected LoggedMessageArea _messageArea = new LoggedMessageArea(this.getClass());
     protected int _threadCount = -1;
@@ -85,5 +85,5 @@
 
 	    _threadCount = 0;
-	    Thread newThread = new Thread((Runnable)_commandsAndCallbacks.get(0));
+	    Thread newThread = new Thread(_commandsAndCallbacks.get(0));
 	    newThread.start();
 	}
@@ -106,5 +106,5 @@
 
 	if(_threadCount < _commandsAndCallbacks.size()){
-	    Thread newThread = new Thread((Runnable)_commandsAndCallbacks.get(_threadCount));
+	    Thread newThread = new Thread(_commandsAndCallbacks.get(_threadCount));
 	    newThread.start();
 	}
Index: /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/DownloadStep.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/DownloadStep.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/DownloadStep.java	(revision 25635)
@@ -123,5 +123,5 @@
 	    String defaultDownloadLocation = GAI.getGSDL3ExtensionHome() + System.getProperty("file.separator") + fileStem;
 
-	    ArrayList sourceElements = new ArrayList();
+	    ArrayList<Source> sourceElements = new ArrayList<Source>();
 	    sourceElements.add(_mainSource);
 
@@ -134,5 +134,5 @@
 	    for(int i = 0; i < sourceElements.size(); i++){
 		
-		Source currentSource = (Source)sourceElements.get(i);
+		Source currentSource = sourceElements.get(i);
 		String destinationFolder = null;
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/ExtPane.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/ExtPane.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/ExtPane.java	(revision 25635)
@@ -79,5 +79,5 @@
     protected DefaultMutableTreeNode top = new DefaultMutableTreeNode("Extension List");
     
-    protected HashMap extensionInformation = null;
+    protected HashMap<String, ArrayList> extensionInformation = null;
       
     protected JPanel extensionContentHeaderPane = null;
@@ -97,5 +97,5 @@
     
     protected Element extFileRootElement = null;
-    protected HashMap extensions = null;
+    protected HashMap<String, ExtensionInformation> extensions = null;
     protected HashMap extClasses = null;
     protected Properties dependencies = new Properties();
@@ -119,5 +119,5 @@
 	current_description_pane = new JPanel();
 	extensionContentHeaderPane = new JPanel();
-	extensionInformation = new HashMap();
+	extensionInformation = new HashMap<String, ArrayList>();
 
 	// Extension_Pane
@@ -137,5 +137,5 @@
 	Element[] extensionElements = ExtXMLHelper.getMultipleChildElements(extFileRootElement, ExtXMLHelper.EXTENSION, true);
 	if(extensionElements != null){
-	    extensions = new HashMap();
+	    extensions = new HashMap<String, ExtensionInformation>();
 
 	    for(int i = 0; i < extensionElements.length; i++){
@@ -153,12 +153,12 @@
          	
 	load_Admin_UI();
-	HashMap projectNameMap = getProjectList();
-    	Set s = projectNameMap.keySet();
-    	Iterator it = s.iterator();
+	HashMap<String, ArrayList<String>> projectNameMap = getProjectList();
+    	Set<String> s = projectNameMap.keySet();
+    	Iterator<String> it = s.iterator();
     	int i = 0;
     	
 	while(it.hasNext()){
-	    String projectNameGroup = (String)it.next(); 
-	    ArrayList alist = (ArrayList)projectNameMap.get(projectNameGroup);
+	    String projectNameGroup = it.next(); 
+	    ArrayList alist = projectNameMap.get(projectNameGroup);
 	    DefaultMutableTreeNode projecti = new DefaultMutableTreeNode (projectNameGroup);
 	    
@@ -243,7 +243,7 @@
     }
     
-    protected HashMap getProjectList(){
-    	
-	HashMap projectGroupMap = new HashMap();
+    protected HashMap<String, ArrayList<String>> getProjectList(){
+    	
+	HashMap<String, ArrayList<String>> projectGroupMap = new HashMap<String, ArrayList<String>>();
 	Element rootNode = extFileRootElement;
 	NodeList projectList =  rootNode.getElementsByTagName(ExtXMLHelper.EXTENSION);
@@ -259,10 +259,10 @@
 
 	    if(projectGroupMap.containsKey(group)){
-		ArrayList alist = (ArrayList)projectGroupMap.get(group);
+		ArrayList<String> alist = projectGroupMap.get(group);
 		alist.add(name);
 		projectGroupMap.put(group, alist);
 	    }
 	    else{
-		ArrayList alist = new ArrayList();
+		ArrayList<String> alist = new ArrayList<String>();
 		alist.add(name);
 		projectGroupMap.put(group, alist);
@@ -286,5 +286,5 @@
 	    }
 
-	    ExtensionInformation info = (ExtensionInformation)extensions.get(option);
+	    ExtensionInformation info = extensions.get(option);
 
 	    if(info != null){
@@ -488,5 +488,5 @@
     	JPanel buttonPane = new JPanel();
 
-	ExtensionInformation extension = (ExtensionInformation)extensions.get(projectName);
+	ExtensionInformation extension = extensions.get(projectName);
 
 	String gsdl3ExtHome = GAI.getGSDL3ExtensionHome();
Index: /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/ExtensionInformation.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/ExtensionInformation.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/ExtensionInformation.java	(revision 25635)
@@ -78,5 +78,5 @@
 	//Load the dynamic jar loader
 	URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader();
-	Class sysclass = URLClassLoader.class;
+	Class<URLClassLoader> sysclass = URLClassLoader.class;
 	final Class[] parameters = new Class[]{URL.class};
 	Method method = null;
Index: /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/PropertiesStep.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/PropertiesStep.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/PropertiesStep.java	(revision 25635)
@@ -60,5 +60,5 @@
     OptionList[] _modifiedOptionLists = null;
     
-    HashMap _optionListTableMap = new HashMap();
+    HashMap<OptionList, PropertyTable> _optionListTableMap = new HashMap<OptionList, PropertyTable>();
 
     public PropertiesStep(Element propertiesStepElement, SequenceList parent)
@@ -106,5 +106,5 @@
     public JTable getTableFromOptionList(OptionList list)
     {
-	return ((JTable)_optionListTableMap.get(list));
+	return _optionListTableMap.get(list);
     }
 
@@ -565,5 +565,5 @@
 
 
-        public Class getColumnClass(int c) {
+        public Class<? extends Object> getColumnClass(int c) {
             return getValueAt(0, c).getClass();
         }
Index: /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/SequenceList.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/SequenceList.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/SequenceList.java	(revision 25635)
@@ -16,5 +16,5 @@
 public class SequenceList
 {
-    protected ArrayList _steps = new ArrayList();
+    protected ArrayList<Step> _steps = new ArrayList<Step>();
     protected ExtensionInformation _parent = null;
     protected Properties _dependencies = null;
@@ -77,5 +77,5 @@
     public Step[] getSteps()
     {
-	return (Step[])(_steps.toArray(new Step[0]));
+	return (_steps.toArray(new Step[0]));
     }
 
@@ -89,5 +89,5 @@
 	JButton[] buttons = new JButton[_steps.size()];
 	for(int i = 0; i < _steps.size(); i++){
-	    buttons[i] = ((Step)_steps.get(i)).getButton();
+	    buttons[i] = _steps.get(i).getButton();
 	}
 	
@@ -152,15 +152,15 @@
     {
 	Step rollbackStep = null;
-	ArrayList dependsSteps = new ArrayList();
-	for(int i = 0; i < _steps.size(); i++){
-	    if(((Step)(_steps.get(i))).getId().equals(id)){
-		rollbackStep = (Step)_steps.get(i);
+	ArrayList<String> dependsSteps = new ArrayList<String>();
+	for(int i = 0; i < _steps.size(); i++){
+	    if((_steps.get(i)).getId().equals(id)){
+		rollbackStep = _steps.get(i);
 	    }
 	    
-	    String[] depends = ((Step)_steps.get(i)).getDependsOn().split(",");
+	    String[] depends = _steps.get(i).getDependsOn().split(",");
 
 	    for(int j = 0; j < depends.length; j++){
 		if(depends[j].equals(id)){
-		    dependsSteps.add(((Step)_steps.get(i)).getId());
+		    dependsSteps.add(_steps.get(i).getId());
 		}
 	    }
@@ -170,5 +170,5 @@
 
 	for(int i = 0; i < dependsSteps.size(); i++){
-	    rollbackToRecursive((String)dependsSteps.get(i));
+	    rollbackToRecursive(dependsSteps.get(i));
 	}
     }
@@ -177,5 +177,5 @@
     {
 	for(int i = 0; i < _steps.size(); i++){
-	    Step currentStep = (Step)_steps.get(i);
+	    Step currentStep = _steps.get(i);
 	    if(currentStep instanceof PropertiesStep){
 		((PropertiesStep)currentStep).setPropertiesToDefaults();
@@ -211,5 +211,5 @@
 	
 	for(int i = 0; i < _steps.size(); i++){
-	    Step currentStep = (Step)_steps.get(i);
+	    Step currentStep = _steps.get(i);
 	    JButton currentButton = currentStep.getButton();
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/applet/phind/ResultCanvas.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/applet/phind/ResultCanvas.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/applet/phind/ResultCanvas.java	(revision 25635)
@@ -76,5 +76,5 @@
     int firstItemDisplayed;
     int itemSelected;
-    Vector items;
+    Vector<ResultItem> items;
     
     // the background image
@@ -95,5 +95,5 @@
 	lineSpacing = phind.fontSize + 2;
 
-	items = new Vector();
+	items = new Vector<ResultItem>();
 	numberOfItems = 0;
 	firstItemDisplayed = 0;
@@ -132,7 +132,7 @@
 	int index = 0;
 	while ((index < numberOfItems) &&
-	       ((item.sort < ((ResultItem) items.elementAt(index)).sort) ||
-		((item.sort == ((ResultItem) items.elementAt(index)).sort) &&
-		 (item.frequency <= ((ResultItem) items.elementAt(index)).frequency)))) {
+	       ((item.sort < items.elementAt(index).sort) ||
+		((item.sort == items.elementAt(index).sort) &&
+		 (item.frequency <= items.elementAt(index).frequency)))) {
 	    index++;
 	}
@@ -160,5 +160,5 @@
 	int index = 0;
 	while (!found && (index < numberOfItems)) {
-	    if (((ResultItem) items.elementAt(index)).isMorePhrases()) {
+	    if (items.elementAt(index).isMorePhrases()) {
 		found = true;
 	    } else {
@@ -192,5 +192,5 @@
 	int index = 0;
 	while (!found && (index < numberOfItems)) {
-	    if (((ResultItem) items.elementAt(index)).isMoreDocuments()) {
+	    if (items.elementAt(index).isMoreDocuments()) {
 		found = true;
 	    } else {
@@ -225,5 +225,5 @@
 	int index = 0;
 	while (!found && (index < numberOfItems)) {
-	    if (((ResultItem) items.elementAt(index)).isMoreLinks()) {
+	    if (items.elementAt(index).isMoreLinks()) {
 		found = true;
 	    } else {
@@ -332,5 +332,5 @@
 
 	    // Get the resultItem to output
-	    result = (ResultItem) items.elementAt(i);
+	    result = items.elementAt(i);
 	    
 	    // Graphics settings for drawing this line
@@ -436,5 +436,5 @@
 	    
 	    // Get the resultItem to output
-	    result = (ResultItem) items.elementAt(i);
+	    result = items.elementAt(i);
 	    docsText = result.docsText();
 	    freqText = result.freqText();
@@ -495,5 +495,5 @@
 	int rowSelected = event.getY() / lineSpacing;
 	itemSelected = rowSelected + firstItemDisplayed;
-	ResultItem item = (ResultItem) items.elementAt(itemSelected);
+	ResultItem item = items.elementAt(itemSelected);
 
 	if (itemSelected <= numberOfItems) {
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/Library2.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/Library2.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/Library2.java	(revision 25635)
@@ -47,5 +47,5 @@
 	protected Document doc = null;
 
-	protected HashMap saved_args = null;
+	protected HashMap<String, String> saved_args = null;
 	protected GSParams params = null;
 	protected DefaultReceptionist recept = null;
@@ -55,5 +55,5 @@
 		this.converter = new XMLConverter();
 		this.doc = converter.newDOM();
-		this.saved_args = new HashMap();
+		this.saved_args = new HashMap<String, String>();
 		this.params = new GSParams();
 		this.recept = new DefaultReceptionist();
@@ -63,5 +63,5 @@
 	{
 
-		HashMap config_params = new HashMap();
+		HashMap<String, Comparable> config_params = new HashMap<String, Comparable>();
 		//config_params.put(GSConstants.GSDL3_HOME, gsdl_home);
 		config_params.put(GSConstants.SITE_NAME, site_name);
@@ -140,5 +140,5 @@
 		String action = "p";
 		String subaction = "home";
-		String lang = (String) saved_args.get(GSParams.LANGUAGE);
+		String lang = saved_args.get(GSParams.LANGUAGE);
 		if (lang == null)
 		{
@@ -193,14 +193,14 @@
 
 		// put in all the params from the session cache
-		Set params = saved_args.keySet();
-		Iterator i = params.iterator();
+		Set<String> params = saved_args.keySet();
+		Iterator<String> i = params.iterator();
 		while (i.hasNext())
 		{
-			String name = (String) i.next();
+			String name = i.next();
 			if (name.equals(GSParams.LANGUAGE))
 				continue;
 			Element param = this.doc.createElement(GSXML.PARAM_ELEM);
 			param.setAttribute(GSXML.NAME_ATT, name);
-			param.setAttribute(GSXML.VALUE_ATT, GSXML.xmlSafe((String) saved_args.get(name)));
+			param.setAttribute(GSXML.VALUE_ATT, GSXML.xmlSafe(saved_args.get(name)));
 			xml_param_list.appendChild(param);
 		}
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java	(revision 25635)
@@ -11,4 +11,5 @@
 import org.w3c.dom.NodeList;
 import java.io.*;
+
 import javax.servlet.*;
 import javax.servlet.http.*;
@@ -90,5 +91,5 @@
 	 * form: sid -> (UserSessionCache object)
 	 */
-	protected Hashtable session_ids_table = new Hashtable();
+	protected Hashtable<String, UserSessionCache> session_ids_table = new Hashtable<String, UserSessionCache>();
 
 	/**
@@ -156,5 +157,5 @@
 		}
 
-		HashMap config_params = new HashMap();
+		HashMap<String, Comparable> config_params = new HashMap<String, Comparable>();
 
 		config_params.put(GSConstants.LIBRARY_NAME, library_name);
@@ -310,7 +311,7 @@
 		 * param_value)
 		 */
-		protected Hashtable coll_name_params_table = null;
-
-		public UserSessionCache(String id, Hashtable table)
+		protected Hashtable<String, Hashtable<String, String>> coll_name_params_table = null;
+
+		public UserSessionCache(String id, Hashtable<String, Hashtable<String, String>> table)
 		{
 			session_id = id;
@@ -326,5 +327,5 @@
 		}
 
-		protected Hashtable getParamsTable()
+		protected Hashtable<String, Hashtable<String, String>> getParamsTable()
 		{
 			return coll_name_params_table;
@@ -517,5 +518,5 @@
 			if (clean_all)
 			{
-				session_ids_table = new Hashtable();
+				session_ids_table = new Hashtable<String, UserSessionCache>();
 				session.removeAttribute(GSXML.USER_SESSION_CACHE_ATT);
 			}
@@ -523,8 +524,8 @@
 			{
 				// just clean up info for clean_collection
-				ArrayList cache_list = new ArrayList(session_ids_table.values());
+				ArrayList<UserSessionCache> cache_list = new ArrayList<UserSessionCache>(session_ids_table.values());
 				for (int i = 0; i < cache_list.size(); i++)
 				{
-					UserSessionCache cache = (UserSessionCache) cache_list.get(i);
+					UserSessionCache cache = cache_list.get(i);
 					cache.cleanupCache(clean_collection);
 				}
@@ -555,6 +556,6 @@
 
 		UserSessionCache session_cache = null;
-		Hashtable param_table = null;
-		Hashtable table = null;
+		Hashtable<String, Hashtable<String, String>> param_table = null;
+		Hashtable<String, String> table = null;
 		String sid = session.getId();
 		if (should_cache == true && cache_key != null && !cache_key.equals(""))
@@ -562,5 +563,5 @@
 			if (session_ids_table.containsKey(sid))
 			{
-				session_cache = (UserSessionCache) session_ids_table.get(sid);
+				session_cache = session_ids_table.get(sid);
 				param_table = session_cache.getParamsTable();
 				logger.info("collections in table: " + tableToString(param_table));
@@ -568,9 +569,9 @@
 				{
 					//logger.info("existing table: " + collection);
-					table = (Hashtable) param_table.get(cache_key);
+					table = param_table.get(cache_key);
 				}
 				else
 				{
-					table = new Hashtable();
+					table = new Hashtable<String, String>();
 					param_table.put(cache_key, table);
 					//logger.info("new table: " + collection);
@@ -579,6 +580,6 @@
 			else
 			{
-				param_table = new Hashtable();
-				table = new Hashtable();
+				param_table = new Hashtable<String, Hashtable<String, String>>();
+				table = new Hashtable<String, String>();
 				param_table.put(cache_key, table);
 				session_cache = new UserSessionCache(sid, param_table);
@@ -642,9 +643,9 @@
 			if (table != null)
 			{
-				Enumeration keys = table.keys();
+				Enumeration<String> keys = table.keys();
 				while (keys.hasMoreElements())
 				{
-					String name = (String) keys.nextElement();
-					session.setAttribute(name, (String) table.get(name));
+					String name = keys.nextElement();
+					session.setAttribute(name, table.get(name));
 				}
 			}
@@ -691,5 +692,5 @@
 				for (int j = 0; j < httpHeaders.size(); j++)
 				{
-					Map nameValueMap = (Map) httpHeaders.get(j);
+					Map nameValueMap = httpHeaders.get(j);
 					String name = (String) nameValueMap.get("name");
 					String value = (String) nameValueMap.get("value");
@@ -825,5 +826,5 @@
 			else
 			{
-				HashMap responseParams = GSXML.extractParams(responseParamList, true);
+				HashMap<String, Serializable> responseParams = GSXML.extractParams(responseParamList, true);
 				String groups = (String) responseParams.get(GSXML.GROUPS_ATT);
 
@@ -910,5 +911,5 @@
 
 	//a debugging method
-	private void displaySize(Hashtable table)
+	private void displaySize(Hashtable<String, UserSessionCache> table)
 	{
 		if (table == null)
@@ -923,8 +924,8 @@
 		}
 		int num_cached_coll = 0;
-		ArrayList cache_list = new ArrayList(table.values());
+		ArrayList<UserSessionCache> cache_list = new ArrayList<UserSessionCache>(table.values());
 		for (int i = 0; i < cache_list.size(); i++)
 		{
-			num_cached_coll += ((UserSessionCache) cache_list.get(i)).tableSize();
+			num_cached_coll += cache_list.get(i).tableSize();
 		}
 		logger.info("Number of sessions : total number of cached collection info = " + table.size() + " : " + num_cached_coll);
@@ -932,11 +933,11 @@
 
 	/** merely a debugging method! */
-	private String tableToString(Hashtable table)
+	private String tableToString(Hashtable<String, Hashtable<String, String>> table)
 	{
 		String str = "";
-		Enumeration keys = table.keys();
+		Enumeration<String> keys = table.keys();
 		while (keys.hasMoreElements())
 		{
-			String name = (String) keys.nextElement();
+			String name = keys.nextElement();
 			str += name + ", ";
 		}
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/OAIServer.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/OAIServer.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/OAIServer.java	(revision 25635)
@@ -71,7 +71,7 @@
   
   /** A HashSet which contains all the legal verbs. */
-  protected HashSet verb_set = null;
+  protected HashSet<String> verb_set = null;
   /** A HashSet which contains all the legal oai keys in the key/value argument pair. */
-  protected HashSet param_set = null;
+  protected HashSet<String> param_set = null;
   /** The name of the site with which we will finally be dealing, whether it is a local site or a remote site through a communicator.*/
   protected String site = "";
@@ -209,5 +209,5 @@
   }
   private void initVerbs() {
-    verb_set = new HashSet();
+    verb_set = new HashSet<String>();
     verb_set.add(OAIXML.GET_RECORD);
     verb_set.add(OAIXML.LIST_RECORDS);
@@ -219,5 +219,5 @@
   
   private void initParams() {
-    param_set = new HashSet();
+    param_set = new HashSet<String>();
     param_set.add(OAIXML.METADATA_PREFIX);
     param_set.add(OAIXML.FROM);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java	(revision 25635)
@@ -23,5 +23,5 @@
 
 	/** the system set up variables */
-	protected HashMap config_params = null;
+	protected HashMap<String, Comparable> config_params = null;
 	/** container Document to create XML Nodes */
 	protected Document doc = null;
@@ -43,5 +43,5 @@
 
 	/** the config variables must be set before configure is called */
-	public void setConfigParams(HashMap params)
+	public void setConfigParams(HashMap<String, Comparable> params)
 	{
 		this.config_params = params;
@@ -92,5 +92,5 @@
 	}
 
-	protected void getRequiredMetadataNames(Element format, HashSet meta_names)
+	protected void getRequiredMetadataNames(Element format, HashSet<String> meta_names)
 	{
 		extractMetadataNames(format, meta_names);
@@ -98,5 +98,5 @@
 	}
 
-	protected void extractMetadataNames(Element format, HashSet meta_names)
+	protected void extractMetadataNames(Element format, HashSet<String> meta_names)
 	{
 		//NodeList nodes = format.getElementsByTagNameNS("metadata", "http://www.greenstone.org/configformat");
@@ -133,5 +133,5 @@
 	}
 
-	protected void addLinkMetadataNames(Element format, HashSet meta_names)
+	protected void addLinkMetadataNames(Element format, HashSet<String> meta_names)
 	{
 		// The XSL tranform for
@@ -187,13 +187,13 @@
 	}
 
-	protected Element createMetadataParamList(HashSet metadata_names)
+	protected Element createMetadataParamList(HashSet<String> metadata_names)
 	{
 		Element param_list = this.doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
 
 		Element param = null;
-		Iterator i = metadata_names.iterator();
+		Iterator<String> i = metadata_names.iterator();
 		while (i.hasNext())
 		{
-			String name = (String) i.next();
+			String name = i.next();
 			param = this.doc.createElement(GSXML.PARAM_ELEM);
 			param_list.appendChild(param);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/AppletAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/AppletAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/AppletAction.java	(revision 25635)
@@ -11,4 +11,5 @@
 import java.util.HashMap;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -32,5 +33,5 @@
 		// get the collection and service params
 		Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 
 		// request_type is display (d) or request (r)
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/BrowseAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/BrowseAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/BrowseAction.java	(revision 25635)
@@ -13,4 +13,5 @@
 import java.util.Vector;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -47,5 +48,5 @@
 	// extract the params from the cgi-request, and check that we have a coll specified
 	Element cgi_paramList = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
-	HashMap params = GSXML.extractParams(cgi_paramList, false);
+	HashMap<String, Serializable> params = GSXML.extractParams(cgi_paramList, false);
 
 	String service_name = (String)params.get(GSParams.SERVICE);
@@ -112,5 +113,5 @@
 	String top_id = OID.getTop(classifier_node);
 	
-	HashSet metadata_names = new HashSet();
+	HashSet<String> metadata_names = new HashSet<String>();
 
 	// add the format info into the response
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java	(revision 25635)
@@ -35,4 +35,5 @@
 import java.util.HashSet;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -90,5 +91,5 @@
 		Element request = (Element) GSXML.getChildByTagName(message, GSXML.REQUEST_ELEM);
 		Element cgi_paramList = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_paramList, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_paramList, false);
 
 		// just in case there are some that need to get passed to the services
@@ -360,5 +361,5 @@
 		// Create a parameter list to specify the required metadata information
 
-		HashSet meta_names = new HashSet();
+		HashSet<String> meta_names = new HashSet<String>();
 		meta_names.add("Title"); // the default
 		if (format_elem != null)
@@ -722,5 +723,5 @@
 		// do the query again to get term info 
 		Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 
 		HashMap previous_params = (HashMap) params.get("p");
@@ -767,5 +768,5 @@
 		Element metadata_list = (Element) GSXML.getNodeByPath(mr_query_response, metadata_path);
 
-		HashSet query_term_variants = new HashSet();
+		HashSet<String> query_term_variants = new HashSet<String>();
 		NodeList equivalent_terms_nodelist = query_term_list_element.getElementsByTagName("equivTermList");
 		if (equivalent_terms_nodelist == null || equivalent_terms_nodelist.getLength() == 0)
@@ -809,10 +810,10 @@
 		}
 
-		ArrayList phrase_query_term_variants_hierarchy = new ArrayList();
+		ArrayList<ArrayList<HashSet<String>>> phrase_query_term_variants_hierarchy = new ArrayList<ArrayList<HashSet<String>>>();
 
 		Element query_element = GSXML.getNamedElement(metadata_list, GSXML.METADATA_ELEM, GSXML.NAME_ATT, "query");
 		String performed_query = GSXML.getNodeText(query_element) + " ";
 
-		ArrayList phrase_query_p_term_variants_list = new ArrayList();
+		ArrayList<HashSet<String>> phrase_query_p_term_variants_list = new ArrayList<HashSet<String>>();
 		int term_start = 0;
 		boolean in_term = false;
@@ -840,5 +841,5 @@
 				{
 
-					HashSet phrase_query_p_term_x_variants = new HashSet();
+					HashSet<String> phrase_query_p_term_x_variants = new HashSet<String>();
 
 					NodeList term_equivalent_terms_nodelist = term_element.getElementsByTagName("equivTermList");
@@ -879,5 +880,5 @@
 					{
 						phrase_query_term_variants_hierarchy.add(phrase_query_p_term_variants_list);
-						phrase_query_p_term_variants_list = new ArrayList();
+						phrase_query_p_term_variants_list = new ArrayList<HashSet<String>>();
 					}
 				}
@@ -898,5 +899,5 @@
 				}
 
-				phrase_query_p_term_variants_list = new ArrayList();
+				phrase_query_p_term_variants_list = new ArrayList<HashSet<String>>();
 			}
 		}
@@ -908,5 +909,5 @@
 	 * Highlights query terms in a piece of text.
 	 */
-	private Element highlightQueryTermsInternal(String content, HashSet query_term_variants, ArrayList phrase_query_term_variants_hierarchy)
+	private Element highlightQueryTermsInternal(String content, HashSet<String> query_term_variants, ArrayList<ArrayList<HashSet<String>>> phrase_query_term_variants_hierarchy)
 	{
 		// Convert the content string to an array of characters for speed
@@ -915,5 +916,5 @@
 
 		// Now skim through the content, identifying word matches
-		ArrayList word_matches = new ArrayList();
+		ArrayList<WordMatch> word_matches = new ArrayList<WordMatch>();
 		int word_start = 0;
 		boolean in_word = false;
@@ -978,12 +979,12 @@
 		}
 
-		ArrayList highlight_start_positions = new ArrayList();
-		ArrayList highlight_end_positions = new ArrayList();
+		ArrayList<Integer> highlight_start_positions = new ArrayList<Integer>();
+		ArrayList<Integer> highlight_end_positions = new ArrayList<Integer>();
 
 		// Deal with phrases now
-		ArrayList partial_phrase_matches = new ArrayList();
+		ArrayList<PartialPhraseMatch> partial_phrase_matches = new ArrayList<PartialPhraseMatch>();
 		for (int i = 0; i < word_matches.size(); i++)
 		{
-			WordMatch word_match = (WordMatch) word_matches.get(i);
+			WordMatch word_match = word_matches.get(i);
 
 			// See if any partial phrase matches are extended by this word
@@ -992,6 +993,6 @@
 				for (int j = partial_phrase_matches.size() - 1; j >= 0; j--)
 				{
-					PartialPhraseMatch partial_phrase_match = (PartialPhraseMatch) partial_phrase_matches.remove(j);
-					ArrayList phrase_query_p_term_variants_list = (ArrayList) phrase_query_term_variants_hierarchy.get(partial_phrase_match.query_phrase_number);
+					PartialPhraseMatch partial_phrase_match = partial_phrase_matches.remove(j);
+					ArrayList phrase_query_p_term_variants_list = phrase_query_term_variants_hierarchy.get(partial_phrase_match.query_phrase_number);
 					HashSet phrase_query_p_term_x_variants = (HashSet) phrase_query_p_term_variants_list.get(partial_phrase_match.num_words_matched);
 					if (phrase_query_p_term_x_variants.contains(word_match.word))
@@ -1006,9 +1007,9 @@
 							{
 								int last_highlight_index = highlight_end_positions.size() - 1;
-								int last_highlight_end = ((Integer) highlight_end_positions.get(last_highlight_index)).intValue();
+								int last_highlight_end = highlight_end_positions.get(last_highlight_index).intValue();
 								if (last_highlight_end > partial_phrase_match.start_position)
 								{
 									// There is an overlap, so remove the previous phrase match
-									int last_highlight_start = ((Integer) highlight_start_positions.remove(last_highlight_index)).intValue();
+									int last_highlight_start = highlight_start_positions.remove(last_highlight_index).intValue();
 									highlight_end_positions.remove(last_highlight_index);
 									partial_phrase_match.start_position = last_highlight_start;
@@ -1035,5 +1036,5 @@
 			for (int p = 0; p < phrase_query_term_variants_hierarchy.size(); p++)
 			{
-				ArrayList phrase_query_p_term_variants_list = (ArrayList) phrase_query_term_variants_hierarchy.get(p);
+				ArrayList phrase_query_p_term_variants_list = phrase_query_term_variants_hierarchy.get(p);
 				HashSet phrase_query_p_term_1_variants = (HashSet) phrase_query_p_term_variants_list.get(0);
 				if (phrase_query_p_term_1_variants.contains(word_match.word))
@@ -1060,6 +1061,6 @@
 		for (int i = 0; i < highlight_start_positions.size(); i++)
 		{
-			int highlight_start = ((Integer) highlight_start_positions.get(i)).intValue();
-			int highlight_end = ((Integer) highlight_end_positions.get(i)).intValue();
+			int highlight_start = highlight_start_positions.get(i).intValue();
+			int highlight_end = highlight_end_positions.get(i).intValue();
 
 			// Print anything before the highlight range
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java	(revision 25635)
@@ -25,4 +25,5 @@
 
 import java.io.PrintWriter;
+import java.io.Serializable;
 import java.io.StringWriter;
 
@@ -48,5 +49,5 @@
 	    // get the param list
     	Element cgi_param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
-	    HashMap params = GSXML.extractParams(cgi_param_list, false);
+	    HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 
     	Element result = this.doc.createElement(GSXML.MESSAGE_ELEM);
@@ -75,5 +76,5 @@
         Element page_response = this.doc.createElement(GSXML.RESPONSE_ELEM);
 
-        Iterator it = params.keySet().iterator();
+        Iterator<String> it = params.keySet().iterator();
 
         if(subaction.equals("saveDocument"))
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java	(revision 25635)
@@ -13,4 +13,5 @@
 import java.util.Vector;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -47,5 +48,5 @@
 		// extract the params from the cgi-request, and check that we have a coll specified
 		Element cgi_paramList = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_paramList, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_paramList, false);
 
 		String service_name = (String) params.get(GSParams.SERVICE);
@@ -107,6 +108,6 @@
 		// the id of the classifier is the top id of the selected node
 		String top_id = OID.getTop(classifier_node);
-		HashSet doc_meta_names = new HashSet();
-		HashSet class_meta_names = new HashSet();
+		HashSet<String> doc_meta_names = new HashSet<String>();
+		HashSet<String> class_meta_names = new HashSet<String>();
 		// add in the defaults
 		doc_meta_names.add("Title");
@@ -358,5 +359,5 @@
 	}
 
-	protected void extractMetadataNames(Element new_format, HashSet doc_meta_names, HashSet class_meta_names)
+	protected void extractMetadataNames(Element new_format, HashSet<String> doc_meta_names, HashSet<String> class_meta_names)
 	{
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GeneralAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GeneralAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GeneralAction.java	(revision 25635)
@@ -10,4 +10,5 @@
 
 import java.io.File;
+import java.io.Serializable;
 import java.util.HashMap;
 
@@ -41,5 +42,5 @@
 		// get the param list
 		Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 
 		if (params.get("configChangeName") != null && params.get("configChangeValue") != null)
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/NoCollQueryAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/NoCollQueryAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/NoCollQueryAction.java	(revision 25635)
@@ -16,4 +16,5 @@
 import java.util.Iterator;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -62,5 +63,5 @@
 		// extract the params from the cgi-request, and check that we have a coll specified
 		Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 
 		String request_type = (String) params.get(GSParams.REQUEST_TYPE);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/PageAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/PageAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/PageAction.java	(revision 25635)
@@ -12,4 +12,5 @@
 import java.util.HashMap;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -130,5 +131,5 @@
 		// extract the params from the cgi-request, 
 		Element cgi_paramList = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_paramList, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_paramList, false);
 
 		String coll_name = (String) params.get(GSParams.COLLECTION);
@@ -214,5 +215,5 @@
 		// extract the params from the cgi-request, 
 		Element cgi_paramList = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_paramList, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_paramList, false);
 
 		String coll_name = (String) params.get(GSParams.COLLECTION);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/ProcessAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/ProcessAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/ProcessAction.java	(revision 25635)
@@ -13,4 +13,5 @@
 import java.util.Iterator;
 import java.io.File;
+import java.io.Serializable;
 
 public class ProcessAction extends Action
@@ -33,5 +34,5 @@
 		// get the param list
 		Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 		String service_name = (String) params.get(GSParams.SERVICE);
 		String cluster_name = (String) params.get(GSParams.CLUSTER);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/QueryAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/QueryAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/QueryAction.java	(revision 25635)
@@ -16,4 +16,5 @@
 import java.util.Iterator;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -56,5 +57,5 @@
 		// extract the params from the cgi-request, and check that we have a coll specified
 		Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 
 		String request_type = (String) params.get(GSParams.REQUEST_TYPE);
@@ -189,5 +190,5 @@
 
 		// get the metadata elements needed from the format statement if any
-		HashSet metadata_names = new HashSet();
+		HashSet<String> metadata_names = new HashSet<String>();
 		metadata_names.add("Title");
 		// add in the format info to the stylesheet if there is any
@@ -246,5 +247,5 @@
 
 	/** this filters out some of the doc results for result paging */
-	protected Element filterDocList(HashMap params, HashMap service_params, Element orig_doc_list)
+	protected Element filterDocList(HashMap<String, Serializable> params, HashMap service_params, Element orig_doc_list)
 	{
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java	(revision 25635)
@@ -24,4 +24,5 @@
 
 import java.io.PrintWriter;
+import java.io.Serializable;
 import java.io.StringWriter;
 
@@ -48,5 +49,5 @@
 		// get the param list
 		Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 
 		Element result = this.doc.createElement(GSXML.MESSAGE_ELEM);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/XMLDocumentAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/XMLDocumentAction.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/XMLDocumentAction.java	(revision 25635)
@@ -17,4 +17,5 @@
 import java.util.Iterator;
 import java.io.File;
+import java.io.Serializable;
 
 /** action class for retrieving parts of XML documents */
@@ -44,5 +45,5 @@
 		// extract the params from the cgi-request, and check that we have a coll specified
 		Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(cgi_param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 
 		String collection = (String) params.get(GSParams.COLLECTION);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/build/GS2PerlConstructor.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/build/GS2PerlConstructor.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/build/GS2PerlConstructor.java	(revision 25635)
@@ -124,5 +124,5 @@
 	{
 		sendMessage(new ConstructionEvent(this, GSStatus.INFO, "Collection construction: new collection."));
-		Vector command = new Vector();
+		Vector<String> command = new Vector<String>();
 		command.add("gs2_mkcol.pl");
 		command.add("-site");
@@ -133,5 +133,5 @@
 		command.add(this.collection_name);
 		String[] command_str = {};
-		command_str = (String[]) command.toArray(command_str);
+		command_str = command.toArray(command_str);
 		if (runPerlCommand(command_str))
 		{
@@ -162,5 +162,5 @@
 		command.add(this.collection_name);
 		String[] command_str = {};
-		command_str = (String[]) command.toArray(command_str);
+		command_str = command.toArray(command_str);
 
 		if (runPerlCommand(command_str))
@@ -186,5 +186,5 @@
 
 		String[] command_str = {};
-		command_str = (String[]) command.toArray(command_str);
+		command_str = command.toArray(command_str);
 
 		if (runPerlCommand(command_str))
@@ -231,8 +231,8 @@
 
 	/** extracts all the args from the xml and returns them in a Vector */
-	protected Vector extractParameters(Element param_list)
-	{
-
-		Vector args = new Vector();
+	protected Vector<String> extractParameters(Element param_list)
+	{
+
+		Vector<String> args = new Vector<String>();
 		if (param_list == null)
 		{
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java	(revision 25635)
@@ -32,6 +32,4 @@
 
 import java.io.*;
-import java.io.File;
-import java.io.RandomAccessFile;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -76,10 +74,10 @@
 	 * 
 	 */
-	protected HashMap service_map = null;
+	protected HashMap<String, ServiceRack> service_map = null;
 	/**
 	 * maps pseudo service names to real service names - needed if we have two
 	 * services with the same name for one collection
 	 */
-	protected HashMap service_name_map = null;
+	protected HashMap<String, String> service_name_map = null;
 
 	/** XML converter for String to DOM and vice versa */
@@ -113,8 +111,8 @@
 	public void cleanUp()
 	{
-		Iterator i = this.service_map.values().iterator();
+		Iterator<ServiceRack> i = this.service_map.values().iterator();
 		while (i.hasNext())
 		{
-			ServiceRack s = (ServiceRack) i.next();
+			ServiceRack s = i.next();
 			s.cleanUp();
 		}
@@ -134,6 +132,6 @@
 	public ServiceCluster()
 	{
-		this.service_map = new HashMap();
-		this.service_name_map = new HashMap();
+		this.service_map = new HashMap<String, ServiceRack>();
+		this.service_name_map = new HashMap<String, String>();
 		this.converter = new XMLConverter();
 		this.doc = this.converter.newDOM();
@@ -491,5 +489,5 @@
 				if (this.service_name_map.containsKey(service))
 				{
-					real_service = (String) this.service_name_map.get(service);
+					real_service = this.service_name_map.get(service);
 					// need to change the to att in the request - give the real service name
 					to = request.getAttribute(GSXML.TO_ATT);
@@ -501,5 +499,5 @@
 				Element single_message = mess_doc.createElement(GSXML.MESSAGE_ELEM);
 				single_message.appendChild(request);
-				Node response_message = ((ModuleInterface) this.service_map.get(service)).process(single_message);
+				Node response_message = this.service_map.get(service).process(single_message);
 				if (response_message != null)
 				{
@@ -884,5 +882,5 @@
 	}
 
-	public HashMap getServiceMap()
+	public HashMap<String, ServiceRack> getServiceMap()
 	{
 		return service_map;
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java	(revision 25635)
@@ -84,5 +84,5 @@
 
   /** map of names to Module objects */
-  protected HashMap module_map=null;
+  protected HashMap<String, ModuleInterface> module_map=null;
   
   /** container Document to create XML Nodes */
@@ -193,5 +193,5 @@
     }
     
-    this.module_map = new HashMap();
+    this.module_map = new HashMap<String, ModuleInterface>();
     
     // This stuff may be done at a reconfigure also
@@ -291,5 +291,5 @@
           if (this.module_map.containsKey(obj)) {
             copied_request.setAttribute(GSXML.TO_ATT, this_mod);
-            result = ((ModuleInterface)this.module_map.get(obj)).process(mess);
+            result = this.module_map.get(obj).process(mess);
             if (result !=null ) {
               // append the contents of the message to the mainResult - there will only be one response at this stage
@@ -326,5 +326,5 @@
 	return private_collection_list;
   }
-  public HashMap getModuleMap() {
+  public HashMap<String, ModuleInterface> getModuleMap() {
     return module_map;
   }
@@ -337,7 +337,7 @@
   protected void cleanUpModuleMapEntire() {
     if (this.module_map != null) {
-      Iterator i = this.module_map.values().iterator();
+      Iterator<ModuleInterface> i = this.module_map.values().iterator();
       while (i.hasNext()) {
-        ((ModuleInterface)i.next()).cleanUp();
+        i.next().cleanUp();
         i.remove();
       }
@@ -364,5 +364,5 @@
         if (name.equals(potential_site_name)) {// there was no site
           list.removeChild(item);
-          ModuleInterface m = (ModuleInterface)this.module_map.remove(name);
+          ModuleInterface m = this.module_map.remove(name);
           m.cleanUp(); // clean up any open files/connections etc 
           m=null;
@@ -851,5 +851,5 @@
       
       logger.info("found the module");
-      ModuleInterface m = (ModuleInterface)this.module_map.remove(name);
+      ModuleInterface m = this.module_map.remove(name);
       // also remove the xml bit from description list
       if (type.equals(GSXML.COLLECTION_ELEM)) {
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java	(revision 25635)
@@ -321,8 +321,8 @@
    *  otherwise true.
    */
-  private boolean isValidParam(HashMap param_map, HashSet valid_strs) {
-    ArrayList param_list = new ArrayList(param_map.keySet());
+  private boolean isValidParam(HashMap<String, String> param_map, HashSet<String> valid_strs) {
+    ArrayList<String> param_list = new ArrayList<String>(param_map.keySet());
     for(int i=0; i<param_list.size(); i++) {
-      if (valid_strs.contains((String)param_list.get(i)) == false) {
+      if (valid_strs.contains(param_list.get(i)) == false) {
         return false;
       }
@@ -333,5 +333,5 @@
     // option: from, until, set, metadataPrefix, resumptionToken
     // exceptions: badArgument, badResumptionToken, cannotDisseminateFormat, noRecordMatch, and noSetHierarchy
-    HashSet valid_strs = new HashSet();
+    HashSet<String> valid_strs = new HashSet<String>();
     valid_strs.add(OAIXML.FROM);
     valid_strs.add(OAIXML.UNTIL);
@@ -347,5 +347,5 @@
     String token = "";
     
-    HashMap param_map = OAIXML.getParamMap(params);    
+    HashMap<String, String> param_map = OAIXML.getParamMap(params);    
     if (!isValidParam(param_map, valid_strs)) {
 	logger.error("One of the params is invalid");
@@ -353,5 +353,5 @@
     } 
     // param keys are valid, but if there are any date params, check they're of the right format
-    String from = (String)param_map.get(OAIXML.FROM);
+    String from = param_map.get(OAIXML.FROM);
     if(from != null) {	
 	Date from_date = OAIXML.getDate(from);
@@ -361,5 +361,5 @@
 	}
     }
-    String until = (String)param_map.get(OAIXML.UNTIL);
+    String until = param_map.get(OAIXML.UNTIL);
     if(until != null) {	
 	Date until_date = OAIXML.getDate(until);
@@ -389,5 +389,5 @@
     if(request_set == true) {
       boolean set_supported = false;
-      String set_spec_str = (String)param_map.get(OAIXML.SET);
+      String set_spec_str = param_map.get(OAIXML.SET);
       // get the collection name
       //if setSpec is supported by this repository, it must be in the form: site_name:coll_name
@@ -409,5 +409,5 @@
     if(param_map.containsKey(OAIXML.RESUMPTION_TOKEN)) {
         // validate resumptionToken
-      token = (String)param_map.get(OAIXML.RESUMPTION_TOKEN);
+      token = param_map.get(OAIXML.RESUMPTION_TOKEN);
       logger.info("has resumptionToken" + token);
       if(OAIXML.containsToken(token) == false) {
@@ -424,5 +424,5 @@
     
     //Now that we got a prefix, check and see if it's supported by this repository
-    String prefix_value = (String)param_map.get(OAIXML.METADATA_PREFIX);
+    String prefix_value = param_map.get(OAIXML.METADATA_PREFIX);
     if (containsMetadataPrefix(prefix_value) == false) {
       logger.error("requested prefix is not found in OAIConfig.xml");
@@ -434,5 +434,5 @@
     String verb = req.getAttribute(OAIXML.TO); 
     NodeList param_list = req.getElementsByTagName(OAIXML.PARAM);
-    ArrayList retain_param_list = new ArrayList();
+    ArrayList<Element> retain_param_list = new ArrayList<Element>();
     for (int j=0; j<param_list.getLength(); j++) {
       Element e = OAIXML.duplicateElement(msg.getOwnerDocument(), (Element)param_list.item(j), true);
@@ -449,5 +449,5 @@
           msg.appendChild(req);
           for (int j=0; j<retain_param_list.size(); j++) {
-            req.appendChild((Element)retain_param_list.get(j));
+            req.appendChild(retain_param_list.get(j));
           }
         }
@@ -538,5 +538,5 @@
     // option: from, until, set, metadataPrefix, and resumptionToken
     // exceptions: badArgument, badResumptionToken, cannotDisseminateFormat, noRecordMatch, and noSetHierarchy
-    HashSet valid_strs = new HashSet();
+    HashSet<String> valid_strs = new HashSet<String>();
     valid_strs.add(OAIXML.FROM);
     valid_strs.add(OAIXML.UNTIL);
@@ -558,5 +558,5 @@
     }
     
-    HashMap param_map = OAIXML.getParamMap(params);    
+    HashMap<String, String> param_map = OAIXML.getParamMap(params);    
     if (!isValidParam(param_map, valid_strs)) {
 	logger.error("One of the params is invalid");
@@ -564,5 +564,5 @@
     }
     // param keys are valid, but if there are any date params, check they're of the right format
-    String from = (String)param_map.get(OAIXML.FROM);
+    String from = param_map.get(OAIXML.FROM);
     if(from != null) {	
 	Date from_date = OAIXML.getDate(from);
@@ -572,5 +572,5 @@
 	}
     }
-    String until = (String)param_map.get(OAIXML.UNTIL);
+    String until = param_map.get(OAIXML.UNTIL);
     Date until_date = null;
     if(until != null) {	
@@ -601,5 +601,5 @@
     if(request_set == true) {
       boolean set_supported = false;
-      String set_spec_str = (String)param_map.get(OAIXML.SET);
+      String set_spec_str = param_map.get(OAIXML.SET);
       // get the collection name
       //if setSpec is supported by this repository, it must be in the form: site_name:coll_name
@@ -630,5 +630,5 @@
       //    store a new token if necessary.
         //}      
-      token = (String)param_map.get(OAIXML.RESUMPTION_TOKEN);
+      token = param_map.get(OAIXML.RESUMPTION_TOKEN);
       logger.info("has resumptionToken: " + token);
       if(OAIXML.containsToken(token) == false) {
@@ -671,5 +671,5 @@
     
     //Now that we got a prefix, check and see if it's supported by this repository
-    String prefix_value = (String)param_map.get(OAIXML.METADATA_PREFIX);
+    String prefix_value = param_map.get(OAIXML.METADATA_PREFIX);
     if (containsMetadataPrefix(prefix_value) == false) {
 	logger.error("requested prefix is not found in OAIConfig.xml");
@@ -682,5 +682,5 @@
     String verb = req.getAttribute(OAIXML.TO); 
     NodeList param_list = req.getElementsByTagName(OAIXML.PARAM);
-    ArrayList retain_param_list = new ArrayList();
+    ArrayList<Element> retain_param_list = new ArrayList<Element>();
     for (int j=0; j<param_list.getLength(); j++) {
       Element e = OAIXML.duplicateElement(msg.getOwnerDocument(), (Element)param_list.item(j), true);
@@ -698,5 +698,5 @@
           msg.appendChild(req);
           for (int j=0; j<retain_param_list.size(); j++) {
-            req.appendChild((Element)retain_param_list.get(j));
+            req.appendChild(retain_param_list.get(j));
           }
         }
@@ -747,5 +747,5 @@
       getRecords(list_records, record_list, 0, resume_after);
       //An incomplete list is sent; append a resumptionToken element
-      Element token_elem = createResumptionTokenElement(num_records, 0, resume_after, true, (String)param_map.get(OAIXML.METADATA_PREFIX));
+      Element token_elem = createResumptionTokenElement(num_records, 0, resume_after, true, param_map.get(OAIXML.METADATA_PREFIX));
       //store this token
       OAIXML.addToken(token_elem);
@@ -768,5 +768,5 @@
         getRecords(list_records, record_list, cursor, num_records);
         //An incomplete list is sent; append a resumptionToken element
-	token_elem = createResumptionTokenElement(num_records, cursor, -1, false, (String)param_map.get(OAIXML.METADATA_PREFIX));
+	token_elem = createResumptionTokenElement(num_records, cursor, -1, false, param_map.get(OAIXML.METADATA_PREFIX));
 	list_records.appendChild(token_elem);
 
@@ -775,5 +775,5 @@
         //append required records to list_records (list is incomplete)
         getRecords(list_records, record_list, cursor, cursor + resume_after);
-        token_elem = createResumptionTokenElement(num_records, cursor, cursor + resume_after, true, (String)param_map.get(OAIXML.METADATA_PREFIX));
+        token_elem = createResumptionTokenElement(num_records, cursor, cursor + resume_after, true, param_map.get(OAIXML.METADATA_PREFIX));
         //store this token
         OAIXML.addToken(token_elem);
@@ -1013,5 +1013,5 @@
     Element get_record = OAIXML.createElement(OAIXML.GET_RECORD);
 
-    HashSet valid_strs = new HashSet();
+    HashSet<String> valid_strs = new HashSet<String>();
     valid_strs.add(OAIXML.IDENTIFIER);
     valid_strs.add(OAIXML.METADATA_PREFIX);
@@ -1019,5 +1019,5 @@
     Element req = (Element)GSXML.getChildByTagName(msg, GSXML.REQUEST_ELEM);
     NodeList params = GSXML.getChildrenByTagName(req, OAIXML.PARAM);
-    HashMap param_map = OAIXML.getParamMap(params);    
+    HashMap<String, String> param_map = OAIXML.getParamMap(params);    
     
     if(!isValidParam(param_map, valid_strs) ||
@@ -1029,6 +1029,6 @@
     }
     
-    String prefix = (String)param_map.get(OAIXML.METADATA_PREFIX);
-    String identifier = (String)param_map.get(OAIXML.IDENTIFIER);
+    String prefix = param_map.get(OAIXML.METADATA_PREFIX);
+    String identifier = param_map.get(OAIXML.IDENTIFIER);
     
     // verify the metadata prefix
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Page.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Page.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Page.java	(revision 25635)
@@ -2,4 +2,5 @@
 
 import java.io.File;
+import java.io.Serializable;
 import java.util.HashMap;
 
@@ -127,5 +128,5 @@
 		Element cgi_param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
 		if (cgi_param_list != null) {
-			HashMap params = GSXML.extractParams(cgi_param_list, false);
+			HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 			collection = (String)params.get(GSParams.COLLECTION);
 			if (collection == null) collection = "";
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java	(revision 25635)
@@ -31,5 +31,5 @@
 
 	/** the set up variables */
-	protected HashMap config_params = null;
+	protected HashMap<String, Comparable> config_params = null;
 	/** container Document to create XML Nodes */
 	protected Document doc = null;
@@ -42,5 +42,5 @@
 
 	/** the list of actions */
-	protected HashMap action_map = null;
+	protected HashMap<String, Action> action_map = null;
 
 	/** the list of params */
@@ -49,5 +49,5 @@
 
 	/** the list of interfaces this is based on */
-	protected ArrayList base_interfaces = null;
+	protected ArrayList<String> base_interfaces = null;
 
 	public Receptionist()
@@ -55,5 +55,5 @@
 		this.converter = new XMLConverter();
 		this.doc = this.converter.newDOM();
-		this.action_map = new HashMap();
+		this.action_map = new HashMap<String, Action>();
 	}
 
@@ -67,10 +67,10 @@
 	}
 
-	public void setConfigParams(HashMap params)
+	public void setConfigParams(HashMap<String, Comparable> params)
 	{
 		this.config_params = params;
 	}
 
-	public HashMap getConfigParams()
+	public HashMap<String, Comparable> getConfigParams()
 	{
 		return this.config_params;
@@ -211,5 +211,5 @@
 
 		// find the  appropriate action	
-		Action a = (Action) this.action_map.get(action);
+		Action a = this.action_map.get(action);
 
 		String action_name = null;
@@ -313,5 +313,5 @@
 			if (base_interfaces == null)
 			{
-				base_interfaces = new ArrayList();
+				base_interfaces = new ArrayList<String>();
 			}
 			base_interfaces.add(base_interface);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java	(revision 25635)
@@ -17,4 +17,5 @@
 import java.io.ByteArrayInputStream;
 import java.io.File;
+import java.io.Serializable;
 import java.io.StringReader;
 import java.io.StringWriter;
@@ -53,5 +54,5 @@
 
 	/** the list of xslt to use for actions */
-	protected HashMap xslt_map = null;
+	protected HashMap<String, String> xslt_map = null;
 
 	/** a transformer class to transform xml using xslt */
@@ -64,5 +65,5 @@
 	{
 		super();
-		this.xslt_map = new HashMap();
+		this.xslt_map = new HashMap<String, String>();
 		this.transformer = new XMLTransformer();
 		try
@@ -197,5 +198,5 @@
 		if (cgi_param_list != null)
 		{
-			HashMap params = GSXML.extractParams(cgi_param_list, false);
+			HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 			if ((excerptID = (String) params.get(GSParams.EXCERPT_ID)) != null)
 			{
@@ -461,5 +462,5 @@
 		{
 			// Don't waste time getting all the parameters
-			HashMap params = GSXML.extractParams(cgi_param_list, false);
+			HashMap<String, Serializable> params = GSXML.extractParams(cgi_param_list, false);
 			collection = (String) params.get(GSParams.COLLECTION);
 			if (collection == null)
@@ -883,10 +884,10 @@
 		{
 			String key = action + ":" + subaction;
-			name = (String) this.xslt_map.get(key);
+			name = this.xslt_map.get(key);
 		}
 		// try the action by itself
 		if (name == null)
 		{
-			name = (String) this.xslt_map.get(action);
+			name = this.xslt_map.get(action);
 		}
 		// now find the absolute path
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/selfContained/FilesDocumentStream.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/selfContained/FilesDocumentStream.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/selfContained/FilesDocumentStream.java	(revision 25635)
@@ -54,7 +54,7 @@
   implements DocumentStream {
   /** the files we've found so far */
-  Vector files = new Vector();
+  Vector<String> files = new Vector<String>();
   /** the directories we've found so far */
-  Vector directories = new Vector();
+  Vector<String> directories = new Vector<String>();
 
   /**
@@ -111,5 +111,5 @@
   protected void expandIfNecessary() {
     while (directories.size() > 0) {
-      String dirname = (String) directories.elementAt(0);
+      String dirname = directories.elementAt(0);
       directories.removeElement(dirname);
       File dir = new File(dirname);
@@ -144,5 +144,5 @@
     if (!hasNextDocument()) throw new Error("Doesn't have another Document");
 
-    String filename = (String) files.elementAt(files.size() - 1);
+    String filename = files.elementAt(files.size() - 1);
     files.removeElementAt(files.size() - 1);
     File file = new File(filename);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractBrowse.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractBrowse.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractBrowse.java	(revision 25635)
@@ -340,5 +340,5 @@
 	boolean want_info = false;
 
-	ArrayList info_types=new ArrayList();
+	ArrayList<String> info_types=new ArrayList<String>();
 	// The document structure information desired
 	boolean want_ancestors = false;
@@ -416,5 +416,5 @@
 		
 		for (int j=0; j<info_types.size(); j++) {
-		    String info_type = (String)info_types.get(j);
+		    String info_type = info_types.get(j);
 		    String info_value = getStructureInfo(node_id, info_type);
 		    if (info_value != null) {
@@ -511,5 +511,5 @@
 
 	// The metadata information required
-	ArrayList metadata_names_list = new ArrayList();
+	ArrayList<String> metadata_names_list = new ArrayList<String>();
 	boolean all_metadata = false;
 	// Process the request parameters
@@ -619,8 +619,8 @@
 				  boolean recursive)
     {
-	ArrayList child_ids = getChildrenIds(node_id);
+	ArrayList<String> child_ids = getChildrenIds(node_id);
 	if (child_ids==null) return;
 	for (int i=0; i< child_ids.size(); i++) {
-	    String child_id = (String)child_ids.get(i);
+	    String child_id = child_ids.get(i);
 	    Element child_elem;
 	    if (isDocumentId(child_id)) {
@@ -675,5 +675,5 @@
 
     /** returns the list of sibling ids, including the specified node_id */
-    protected ArrayList getSiblingIds(String node_id) {
+    protected ArrayList<String> getSiblingIds(String node_id) {
 	String parent_id = getParentId(node_id);
 	if (parent_id == null) {
@@ -698,5 +698,5 @@
     abstract protected String getRootId(String node_id);
     /** returns a list of the child ids in order, null if no children */
-    abstract protected ArrayList getChildrenIds(String node_id);
+    abstract protected ArrayList<String> getChildrenIds(String node_id);
     /** returns the node id of the parent node, null if no parent */
     abstract protected String getParentId(String node_id);
@@ -715,5 +715,5 @@
     abstract protected Element getMetadataList(String node_id,
 					       boolean all_metadata,
-					       ArrayList metadata_names);
+					       ArrayList<String> metadata_names);
 
     /** get the particular metadata (identified by the metadata name) for the classifier node node_id
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractDocumentRetrieve.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractDocumentRetrieve.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractDocumentRetrieve.java	(revision 25635)
@@ -205,5 +205,5 @@
 
 		// The metadata information required
-		ArrayList metadata_names_list = new ArrayList();
+		ArrayList<String> metadata_names_list = new ArrayList<String>();
 		boolean all_metadata = false;
 		// Process the request parameters
@@ -353,5 +353,5 @@
 		boolean want_info = false;
 
-		ArrayList info_types = new ArrayList();
+		ArrayList<String> info_types = new ArrayList<String>();
 		// The document structure information desired
 		boolean want_ancestors = false;
@@ -440,5 +440,5 @@
 				for (int j = 0; j < info_types.size(); j++)
 				{
-					String info_type = (String) info_types.get(j);
+					String info_type = info_types.get(j);
 					String info_value = getStructureInfo(doc_id, info_type);
 					if (info_value != null)
@@ -654,10 +654,10 @@
 	protected void addDescendants(Element doc, String doc_id, boolean recursive)
 	{
-		ArrayList child_ids = getChildrenIds(doc_id);
+		ArrayList<String> child_ids = getChildrenIds(doc_id);
 		if (child_ids == null)
 			return;
 		for (int i = 0; i < child_ids.size(); i++)
 		{
-			String child_id = (String) child_ids.get(i);
+			String child_id = child_ids.get(i);
 			Element child_elem = createDocNode(child_id);
 			doc.appendChild(child_elem);
@@ -707,5 +707,5 @@
 
 	/** returns the list of sibling ids, including the specified node_id */
-	protected ArrayList getSiblingIds(String node_id)
+	protected ArrayList<String> getSiblingIds(String node_id)
 	{
 		String parent_id = getParentId(node_id);
@@ -803,5 +803,5 @@
 	 * implementation: return null
 	 */
-	protected ArrayList getChildrenIds(String node_id)
+	protected ArrayList<String> getChildrenIds(String node_id)
 	{
 		return null;
@@ -821,5 +821,5 @@
 	 * <metadataList><metadata name="xxx">value</metadata></metadataList>
 	 */
-	abstract protected Element getMetadataList(String doc_id, boolean all_metadata, ArrayList metadata_names) throws GSException;
+	abstract protected Element getMetadataList(String doc_id, boolean all_metadata, ArrayList<String> metadata_names) throws GSException;
 
 	/**
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java	(revision 25635)
@@ -157,5 +157,5 @@
 
 	/** returns a list of the child ids in order, null if no children */
-	protected ArrayList getChildrenIds(String node_id)
+	protected ArrayList<String> getChildrenIds(String node_id)
 	{
 		DBInfo info = this.coll_db.getInfo(node_id);
@@ -170,5 +170,5 @@
 			return null;
 		}
-		ArrayList children = new ArrayList();
+		ArrayList<String> children = new ArrayList<String>();
 		StringTokenizer st = new StringTokenizer(contains, ";");
 		while (st.hasMoreTokens())
@@ -198,5 +198,5 @@
 	 */
 	// assumes only one value per metadata
-	protected Element getMetadataList(String node_id, boolean all_metadata, ArrayList metadata_names) throws GSException
+	protected Element getMetadataList(String node_id, boolean all_metadata, ArrayList<String> metadata_names) throws GSException
 	{
 		Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER);
@@ -210,14 +210,14 @@
 		{
 			// return everything out of the database
-			Set keys = info.getKeys();
-			Iterator it = keys.iterator();
+			Set<String> keys = info.getKeys();
+			Iterator<String> it = keys.iterator();
 			while (it.hasNext())
 			{
-				String key = (String) it.next();
+				String key = it.next();
 				//String value = info.getInfo(key);
-				Vector values = info.getMultiInfo(key);
+				Vector<String> values = info.getMultiInfo(key);
 				for (int i = 0; i < values.size(); i++)
 				{
-					GSXML.addMetadata(this.doc, metadata_list, key, this.macro_resolver.resolve((String) values.elementAt(i), lang, MacroResolver.SCOPE_META, node_id));
+					GSXML.addMetadata(this.doc, metadata_list, key, this.macro_resolver.resolve(values.elementAt(i), lang, MacroResolver.SCOPE_META, node_id));
 				}
 			}
@@ -228,5 +228,5 @@
 			for (int i = 0; i < metadata_names.size(); i++)
 			{
-				String meta_name = (String) metadata_names.get(i);
+				String meta_name = metadata_names.get(i);
 				String value = getMetadata(node_id, info, meta_name, lang);
 				GSXML.addMetadata(this.doc, metadata_list, meta_name, value);
@@ -375,5 +375,5 @@
 		if (pos == -1)
 		{
-			Vector values = info.getMultiInfo(metadata);
+			Vector<String> values = info.getMultiInfo(metadata);
 			if (values != null)
 			{
@@ -391,5 +391,5 @@
 						result.append(separator);
 					}
-					result.append(this.macro_resolver.resolve((String) values.elementAt(i), lang, MacroResolver.SCOPE_META, node_id));
+					result.append(this.macro_resolver.resolve(values.elementAt(i), lang, MacroResolver.SCOPE_META, node_id));
 				}
 				return result.toString();
@@ -482,5 +482,5 @@
 		{
 			// we have multiple meta
-			Vector values = relation_info.getMultiInfo(metadata);
+			Vector<String> values = relation_info.getMultiInfo(metadata);
 			if (values != null)
 			{
@@ -496,5 +496,5 @@
 						result.append(separator);
 					}
-					result.append(this.macro_resolver.resolve((String) values.elementAt(i), lang, MacroResolver.SCOPE_META, relation_id));
+					result.append(this.macro_resolver.resolve(values.elementAt(i), lang, MacroResolver.SCOPE_META, relation_id));
 				}
 			}
@@ -522,5 +522,5 @@
 			else
 			{
-				Vector values = relation_info.getMultiInfo(metadata);
+				Vector<String> values = relation_info.getMultiInfo(metadata);
 				if (values != null)
 				{
@@ -528,5 +528,5 @@
 					{
 						result.insert(0, separator);
-						result.insert(0, this.macro_resolver.resolve((String) values.elementAt(i), lang, MacroResolver.SCOPE_META, relation_id));
+						result.insert(0, this.macro_resolver.resolve(values.elementAt(i), lang, MacroResolver.SCOPE_META, relation_id));
 					}
 				}
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java	(revision 25635)
@@ -34,4 +34,5 @@
 import java.util.Vector;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -391,6 +392,6 @@
 		if (name.equals(LEVEL_PARAM))
 		{
-			ArrayList level_ids = new ArrayList();
-			ArrayList level_names = new ArrayList();
+			ArrayList<String> level_ids = new ArrayList<String>();
+			ArrayList<String> level_names = new ArrayList<String>();
 			getLevelData(level_ids, level_names, lang);
 			if (level_ids.size() > 1)
@@ -429,6 +430,6 @@
 		else if (name.equals(FIELD_FIELD_PARAM))
 		{
-			ArrayList fields = new ArrayList();
-			ArrayList field_names = new ArrayList();
+			ArrayList<String> fields = new ArrayList<String>();
+			ArrayList<String> field_names = new ArrayList<String>();
 			getIndexData(fields, field_names, lang);
 			// the field list -  read from config file
@@ -438,5 +439,5 @@
 			// Changed from:
 			// param = GSXML.createParameterDescription2(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, (String)fields.get(0), fields, field_names );
-			String default_value = (fields.size() > 0) ? (String) fields.get(0) : null;
+			String default_value = (fields.size() > 0) ? fields.get(0) : null;
 			// don't want to access element 0 if fields.size()==0, and
 			// GSXML.createParameterDescription2 checks for default_value==null condition
@@ -465,5 +466,5 @@
 
 	// should cache some of this
-	protected void getLevelData(ArrayList level_ids, ArrayList level_names, String lang)
+	protected void getLevelData(ArrayList<String> level_ids, ArrayList<String> level_names, String lang)
 	{
 		Element level_list = (Element) GSXML.getChildByTagName(this.config_info, LEVEL_ELEM + GSXML.LIST_MODIFIER);
@@ -565,5 +566,5 @@
 
 		// Process the request parameters
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		// Make sure a query has been specified
@@ -658,5 +659,5 @@
 	/** methods to handle actually doing the query */
 	/** do any initialisation of the query object */
-	abstract protected boolean setUpQueryer(HashMap params);
+	abstract protected boolean setUpQueryer(HashMap<String, Serializable> params);
 
 	/** do the query */
@@ -673,5 +674,5 @@
 
 	/** add in term info if available */
-	abstract protected boolean addTermInfo(Element term_list, HashMap params, Object query_result);
+	abstract protected boolean addTermInfo(Element term_list, HashMap<String, Serializable> params, Object query_result);
 
 	/**
@@ -680,5 +681,5 @@
 	 */
 	/** We assume the combination (AND/OR) is done by the match param */
-	protected String parseFieldQueryParams(HashMap params)
+	protected String parseFieldQueryParams(HashMap<String, Serializable> params)
 	{
 
@@ -707,5 +708,5 @@
 	 * query
 	 */
-	protected String parseAdvancedFieldQueryParams(HashMap params)
+	protected String parseAdvancedFieldQueryParams(HashMap<String, Serializable> params)
 	{
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2TextSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2TextSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2TextSearch.java	(revision 25635)
@@ -227,5 +227,5 @@
 	}
 
-	protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang)
+	protected void getIndexData(ArrayList<String> index_ids, ArrayList<String> index_names, String lang)
 	{
 		// the index info -
@@ -256,5 +256,5 @@
 	}
 
-	protected void getIndexSubcollectionData(ArrayList index_sub_ids, ArrayList index_sub_names, String lang)
+	protected void getIndexSubcollectionData(ArrayList<String> index_sub_ids, ArrayList<String> index_sub_names, String lang)
 	{
 		// the index info -
@@ -285,5 +285,5 @@
 	}
 
-	protected void getIndexLanguageData(ArrayList index_lang_ids, ArrayList index_lang_names, String lang)
+	protected void getIndexLanguageData(ArrayList<String> index_lang_ids, ArrayList<String> index_lang_names, String lang)
 	{
 		// the index info -
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java	(revision 25635)
@@ -288,6 +288,6 @@
 		{
 			// should we make these class fields?
-			ArrayList index_ids = new ArrayList();
-			ArrayList index_names = new ArrayList();
+			ArrayList<String> index_ids = new ArrayList<String>();
+			ArrayList<String> index_names = new ArrayList<String>();
 			getIndexData(index_ids, index_names, lang);
 			String param_type = GSXML.PARAM_TYPE_ENUM_SINGLE;
@@ -389,5 +389,5 @@
 	 * subclass there must be at least one index
 	 */
-	abstract protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang);
+	abstract protected void getIndexData(ArrayList<String> index_ids, ArrayList<String> index_names, String lang);
 
 }
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractTextSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractTextSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractTextSearch.java	(revision 25635)
@@ -105,6 +105,6 @@
 	    Element index_sub_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_SUBCOLLECTION_ELEM+GSXML.LIST_MODIFIER);
 	    if (index_sub_list == null) return true; // processed, just not a very interesting result
-	    ArrayList index_sub_ids = new ArrayList();
-	    ArrayList index_sub_names = new ArrayList();
+	    ArrayList<String> index_sub_ids = new ArrayList<String>();
+	    ArrayList<String> index_sub_names = new ArrayList<String>();
 	    getIndexSubcollectionData(index_sub_ids, index_sub_names, lang);
 	    String param_type = GSXML.PARAM_TYPE_ENUM_SINGLE;
@@ -122,6 +122,6 @@
 	    Element index_lang_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_LANGUAGE_ELEM+GSXML.LIST_MODIFIER);
             if (index_lang_list == null) return true; // processed, just not a very interesting result
-	    ArrayList index_lang_ids = new ArrayList();
-	    ArrayList index_lang_names = new ArrayList();
+	    ArrayList<String> index_lang_ids = new ArrayList<String>();
+	    ArrayList<String> index_lang_names = new ArrayList<String>();
 	    getIndexLanguageData(index_lang_ids, index_lang_names, lang);
 	    String param_type = GSXML.PARAM_TYPE_ENUM_SINGLE;
@@ -150,10 +150,10 @@
      * might be implemented by subclass
      */
-    protected void getIndexSubcollectionData(ArrayList index_ids, ArrayList index_names, String lang){}
+    protected void getIndexSubcollectionData(ArrayList<String> index_ids, ArrayList<String> index_names, String lang){}
     
     /** get the details about the indexes available
      * might be implemented by subclass
      */
-    protected void getIndexLanguageData(ArrayList index_ids, ArrayList index_names, String lang){}
+    protected void getIndexLanguageData(ArrayList<String> index_ids, ArrayList<String> index_names, String lang){}
   
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ArchiveIO.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ArchiveIO.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ArchiveIO.java	(revision 25635)
@@ -36,4 +36,5 @@
 
 import java.io.File;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -118,5 +119,5 @@
 			return result;
 		}
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String oid = (String) params.get(GSXML.NODE_ID_ATT);
@@ -148,5 +149,5 @@
 			return result;
 		}
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String srcFile = (String) params.get("sourcefile"); //TODO: Replace with a constant
@@ -182,5 +183,5 @@
 			return result;
 		}
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String oid = (String) params.get(GSXML.NODE_ID_ATT);
@@ -317,5 +318,5 @@
 			return result;
 		}
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String oid = (String) params.get(GSXML.NODE_ID_ATT);
@@ -333,5 +334,5 @@
 		for (int i = 1; i < assocFiles.size(); i++)
 		{
-			metadataList.appendChild(GSXML.createMetadataElement(this.doc, "assocfile", (String) assocFiles.get(i)));
+			metadataList.appendChild(GSXML.createMetadataElement(this.doc, "assocfile", assocFiles.get(i)));
 		}
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ArchiveRetrieve.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ArchiveRetrieve.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ArchiveRetrieve.java	(revision 25635)
@@ -32,4 +32,5 @@
 
 import java.io.File;
+import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Vector;
@@ -115,5 +116,5 @@
 			return result;  
 		}
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 		
 		String oid = (String) params.get("oid");
@@ -152,5 +153,5 @@
 			return result;  
 		}
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 		
 		String srcFile = (String) params.get("srcfile");
@@ -223,5 +224,5 @@
 			return result;  
 		}
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 		
 		String oid = (String) params.get("oid");
@@ -269,5 +270,5 @@
 		
 		String srcFile = info.getInfo("src-file");
-		Vector data = info.getMultiInfo("assoc-file");
+		Vector<String> data = info.getMultiInfo("assoc-file");
 		
 		Element metadataList = this.doc.createElement(GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER);
@@ -276,5 +277,5 @@
 		for (int i = 0; i < data.size(); i++)
 		{
-			metadataList.appendChild(createMetadataElement("assocfile", (String)data.get(i)));
+			metadataList.appendChild(createMetadataElement("assocfile", data.get(i)));
 		}
 		
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/Authentication.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/Authentication.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/Authentication.java	(revision 25635)
@@ -18,4 +18,5 @@
 import java.util.regex.Pattern;
 import java.io.File;
+import java.io.Serializable;
 
 import net.tanesha.recaptcha.ReCaptchaImpl;
@@ -230,5 +231,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(paramList, true);
+		HashMap<String, Serializable> params = GSXML.extractParams(paramList, true);
 
 		String username = (String) params.get("username");
@@ -308,5 +309,5 @@
 			return result; // Return the empty result
 		}
-		HashMap paramMap = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> paramMap = GSXML.extractParams(param_list, false);
 		String op = (String) paramMap.get("authpage");
 		serviceNode.setAttribute("operation", op);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java	(revision 25635)
@@ -35,4 +35,5 @@
 import org.greenstone.gsdl3.util.UserContext;
 
+import java.io.Serializable;
 import java.net.InetAddress;
 import java.util.Properties;
@@ -66,6 +67,6 @@
 	protected static final int delay = 1800000;
 
-	protected Hashtable userMap = null;
-	protected Hashtable timerMap = null;
+	protected Hashtable<String, Hashtable<String, Hashtable<String, Item>>> userMap = null;
+	protected Hashtable<String, UserTimer> timerMap = null;
 	protected String username = "";
 	protected String password = "";
@@ -74,9 +75,9 @@
 	public BerryBasket()
 	{
-		userMap = new Hashtable();
-		timerMap = new Hashtable();
-	}
-
-	private Hashtable updateDocMap(Element request)
+		userMap = new Hashtable<String, Hashtable<String, Hashtable<String, Item>>>();
+		timerMap = new Hashtable<String, UserTimer>();
+	}
+
+	private Hashtable<String, Hashtable<String, Item>> updateDocMap(Element request)
 	{
 
@@ -87,8 +88,8 @@
 			if (timerMap.containsKey(id))
 			{
-				UserTimer timer = (UserTimer) timerMap.get(id);
+				UserTimer timer = timerMap.get(id);
 				timer.restart();
 			}
-			return (Hashtable) userMap.get(id);
+			return userMap.get(id);
 		}
 		else
@@ -97,5 +98,5 @@
 			timerMap.put(id, timer);
 			timer.start();
-			Hashtable newDocs = new Hashtable();
+			Hashtable<String, Hashtable<String, Item>> newDocs = new Hashtable<String, Hashtable<String, Item>>();
 			userMap.put(id, newDocs);
 			return newDocs;
@@ -210,5 +211,5 @@
 	protected Element processAddItem(Element request)
 	{
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 
 		// Create a new (empty) result message
@@ -223,5 +224,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String item = (String) params.get("item");
@@ -236,5 +237,5 @@
 		if (docsMap.containsKey(collection))
 		{
-			Hashtable items = (Hashtable) docsMap.get(collection);
+			Hashtable<String, Item> items = docsMap.get(collection);
 			if (!items.containsKey(item))
 			{
@@ -246,5 +247,5 @@
 		else
 		{
-			Hashtable items = new Hashtable();
+			Hashtable<String, Item> items = new Hashtable<String, Item>();
 			Item newItem = generateItem(collection, item);
 			items.put(item, newItem);
@@ -261,5 +262,5 @@
 		Item item = new Item(collection, id);
 		String to = GSPath.appendLink(collection, "DocumentMetadataRetrieve");
-		ArrayList tmp = new ArrayList();
+		ArrayList<String> tmp = new ArrayList<String>();
 		tmp.add(id);
 		
@@ -303,5 +304,5 @@
 	protected Element processDeleteItems(Element request)
 	{
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 
 		// Create a new (empty) result message
@@ -317,5 +318,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String param = (String) params.get("items");
@@ -341,5 +342,5 @@
 			if (docsMap.containsKey(collection))
 			{
-				Hashtable itemMap = (Hashtable) docsMap.get(collection);
+				Hashtable itemMap = docsMap.get(collection);
 				if (itemMap.containsKey(item))
 				{
@@ -359,5 +360,5 @@
 	protected Element processDeleteItem(Element request)
 	{
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 
 		// Create a new (empty) result message
@@ -373,5 +374,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String param = (String) params.get("item");
@@ -393,5 +394,5 @@
 		if (docsMap.containsKey(collection))
 		{
-			Hashtable itemMap = (Hashtable) docsMap.get(collection);
+			Hashtable itemMap = docsMap.get(collection);
 			if (itemMap.containsKey(item))
 			{
@@ -409,5 +410,5 @@
 	protected Element processItemNum(Element request)
 	{
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 
 		// Create a new (empty) result message
@@ -416,9 +417,9 @@
 		int size = 0;
 		String ids = "";
-		Iterator keys = docsMap.keySet().iterator();
+		Iterator<String> keys = docsMap.keySet().iterator();
 
 		while (keys.hasNext())
 		{
-			Hashtable items = (Hashtable) docsMap.get((String) keys.next());
+			Hashtable items = docsMap.get(keys.next());
 			size += items.size();
 			Iterator values = items.values().iterator();
@@ -437,5 +438,5 @@
 	}
 
-	private Element getDocumentMetadata(String to, UserContext userContext, Iterator ids)
+	private Element getDocumentMetadata(String to, UserContext userContext, Iterator<String> ids)
 	{
 
@@ -446,5 +447,5 @@
 
 		// Create a parameter list to specify the required metadata information
-		HashSet meta_names = new HashSet();
+		HashSet<String> meta_names = new HashSet<String>();
 		meta_names.add("Title"); // the default
 		meta_names.add("root_Title");
@@ -454,8 +455,8 @@
 
 		Element param = null;
-		Iterator i = meta_names.iterator();
+		Iterator<String> i = meta_names.iterator();
 		while (i.hasNext())
 		{
-			String name = (String) i.next();
+			String name = i.next();
 			param = this.doc.createElement(GSXML.PARAM_ELEM);
 			param_list.appendChild(param);
@@ -476,5 +477,5 @@
 			Element dm_doc_node = this.doc.createElement(GSXML.DOC_NODE_ELEM);
 			dm_doc_list.appendChild(dm_doc_node);
-			dm_doc_node.setAttribute(GSXML.NODE_ID_ATT, (String) ids.next());
+			dm_doc_node.setAttribute(GSXML.NODE_ID_ATT, ids.next());
 		}
 
@@ -485,15 +486,15 @@
 	protected Element processDisplayList(Element request)
 	{
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 
 		// Create a new (empty) result message
 		Element result = this.doc.createElement(GSXML.RESPONSE_ELEM);
 
-		Iterator keys = docsMap.keySet().iterator();
+		Iterator<String> keys = docsMap.keySet().iterator();
 
 		while (keys.hasNext())
 		{
-			String collection = (String) keys.next();
-			Hashtable items = (Hashtable) docsMap.get(collection);
+			String collection = keys.next();
+			Hashtable items = docsMap.get(collection);
 			Iterator itemItr = items.values().iterator();
 
@@ -534,5 +535,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String to = (String) params.get("address");
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CoverageMetadataRetrieve.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CoverageMetadataRetrieve.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CoverageMetadataRetrieve.java	(revision 25635)
@@ -198,14 +198,14 @@
     DBInfo collection_info = this.coll_db.getInfo("collection");
     
-    Set keys = collection_info.getKeys();
-
-    Vector valid_keys = new Vector();
+    Set<String> keys = collection_info.getKeys();
+
+    Vector<String> valid_keys = new Vector<String>();
 
     // Iterate over keys and add valid ones to the valid_keys vector
     String current_key = null;
-    Iterator iter = keys.iterator();
+    Iterator<String> iter = keys.iterator();
 
     while (iter.hasNext()) {
-        current_key = (String) iter.next();
+        current_key = iter.next();
         if(current_key.matches("^metadatalist-([a-zA-Z][^-])*$"))
         {
@@ -232,5 +232,5 @@
 
     while (iter.hasNext()) {
-        current_key = (String) iter.next();
+        current_key = iter.next();
 
         // Create metadataSet using the current key and add to metadataSetList
@@ -244,8 +244,8 @@
 
         // Create a metadata element for each value and add to metadataSet
-        Vector sub_info = collection_info.getMultiInfo(current_key);
-        Iterator iter2 = sub_info.iterator();
+        Vector<String> sub_info = collection_info.getMultiInfo(current_key);
+        Iterator<String> iter2 = sub_info.iterator();
         while (iter2.hasNext()) {
-            value = (String) iter2.next();     
+            value = iter2.next();     
             metadata = this.doc.createElement("metadata");
             metadata.setAttribute(GSXML.NAME_ATT, value);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java	(revision 25635)
@@ -292,6 +292,6 @@
 		logger.debug("metadata response = " + this.converter.getPrettyString(metadata_response));
 		NodeList coll_responses = metadata_response.getElementsByTagName(GSXML.RESPONSE_ELEM);
-		ArrayList valid_colls = new ArrayList();
-		ArrayList valid_coll_names = new ArrayList();
+		ArrayList<String> valid_colls = new ArrayList<String>();
+		ArrayList<String> valid_coll_names = new ArrayList<String>();
 		for (int i = 0; i < coll_responses.getLength(); i++)
 		{
@@ -317,5 +317,5 @@
 		// ids no all has the list without 'all' option.
 		this.coll_ids_list_no_all = new String[1];
-		this.coll_ids_list_no_all = (String[]) valid_colls.toArray(coll_ids_list_no_all);
+		this.coll_ids_list_no_all = valid_colls.toArray(coll_ids_list_no_all);
 
 		valid_colls.add(0, "all");
@@ -323,6 +323,6 @@
 		this.coll_ids_list = new String[1];
 		this.coll_names_list = new String[1];
-		this.coll_ids_list = (String[]) valid_colls.toArray(coll_ids_list);
-		this.coll_names_list = (String[]) valid_coll_names.toArray(coll_names_list);
+		this.coll_ids_list = valid_colls.toArray(coll_ids_list);
+		this.coll_names_list = valid_coll_names.toArray(coll_names_list);
 		return true;
 	}
@@ -361,5 +361,5 @@
 
 		// organise the nodes into collection lists
-		HashMap coll_map = new HashMap();
+		HashMap<String, Node> coll_map = new HashMap<String, Node>();
 
 		for (int i = 0; i < query_doc_list.getLength(); i++)
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/DocumentBasket.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/DocumentBasket.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/DocumentBasket.java	(revision 25635)
@@ -72,6 +72,6 @@
 	protected static final String BASKET_BOOK = "documentBasketBook";
 
-	protected Hashtable userMap = null;
-	protected Hashtable timerMap = null;
+	protected Hashtable<String, Hashtable<String, Hashtable<String, Item>>> userMap = null;
+	protected Hashtable<String, UserTimer> timerMap = null;
 	protected String username = "";
 	protected String password = "";
@@ -80,9 +80,9 @@
 	public DocumentBasket()
 	{
-		userMap = new Hashtable();
-		timerMap = new Hashtable();
-	}
-
-	private Hashtable updateDocMap(Element request)
+		userMap = new Hashtable<String, Hashtable<String, Hashtable<String, Item>>>();
+		timerMap = new Hashtable<String, UserTimer>();
+	}
+
+	private Hashtable<String, Hashtable<String, Item>> updateDocMap(Element request)
 	{
 		String id = request.getAttribute("uid");
@@ -92,8 +92,8 @@
 			if (timerMap.containsKey(id))
 			{
-				UserTimer timer = (UserTimer) timerMap.get(id);
+				UserTimer timer = timerMap.get(id);
 				timer.restart();
 			}
-			return (Hashtable) userMap.get(id);
+			return userMap.get(id);
 		}
 		else
@@ -102,5 +102,5 @@
 			timerMap.put(id, timer);
 			timer.start();
-			Hashtable newDocs = new Hashtable();
+			Hashtable<String, Hashtable<String, Item>> newDocs = new Hashtable<String, Hashtable<String, Item>>();
 			userMap.put(id, newDocs);
 			return newDocs;
@@ -226,5 +226,5 @@
 	{
 		//System.err.println("REQUEST = " + GSXML.xmlNodeToString(request));
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 		//System.err.println("DOCSMAP = " + docsMap);
 		// Create a new (empty) result message
@@ -239,5 +239,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 		//System.err.println("PARAMS = " + params);
 		String item = (String) params.get("item");
@@ -256,5 +256,5 @@
 		if (docsMap.containsKey(collection))
 		{
-			Hashtable items = (Hashtable) docsMap.get(collection);
+			Hashtable<String, Item> items = docsMap.get(collection);
 			if (!items.containsKey(item))
 			{
@@ -266,5 +266,5 @@
 		else
 		{
-			Hashtable items = new Hashtable();
+			Hashtable<String, Item> items = new Hashtable<String, Item>();
 			Item newItem = generateItem(collection, item);
 			items.put(item, newItem);
@@ -286,5 +286,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String docString = (String) params.get("docs");
@@ -379,5 +379,5 @@
 		Item item = new Item(collection, id);
 		String to = GSPath.appendLink(collection, "DocumentMetadataRetrieve");
-		ArrayList tmp = new ArrayList();
+		ArrayList<String> tmp = new ArrayList<String>();
 		tmp.add(id);
 		
@@ -422,5 +422,5 @@
 	protected Element processClearDocuments(Element request)
 	{
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 		
 		Element result = this.doc.createElement(GSXML.RESPONSE_ELEM);
@@ -435,5 +435,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 		String collection = (String) params.get(GSParams.COLLECTION);
 
@@ -441,5 +441,5 @@
 			return result;
 		
-		docsMap.put(collection, new Hashtable());
+		docsMap.put(collection, new Hashtable<String, Item>());
 		
 		return result;
@@ -448,5 +448,5 @@
 	protected Element processDeleteDocuments(Element request)
 	{
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 
 		// Create a new (empty) result message
@@ -464,5 +464,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String param = (String) params.get("items");
@@ -489,5 +489,5 @@
 			if (docsMap.containsKey(collection))
 			{
-				Hashtable itemMap = (Hashtable) docsMap.get(collection);
+				Hashtable itemMap = docsMap.get(collection);
 				if (itemMap.containsKey(item))
 				{
@@ -506,5 +506,5 @@
 	protected Element processDeleteDocument(Element request)
 	{
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 
 		// Create a new (empty) result message
@@ -522,5 +522,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		String item = (String) params.get("item");
@@ -540,5 +540,5 @@
 		if (docsMap.containsKey(collection))
 		{
-			Hashtable itemMap = (Hashtable) docsMap.get(collection);
+			Hashtable itemMap = docsMap.get(collection);
 			if (itemMap.containsKey(item))
 			{
@@ -557,5 +557,5 @@
 	{
 		// GSXML.printXMLNode(request);
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 
 		// Create a new (empty) result message
@@ -564,9 +564,9 @@
 		int size = 0;
 		String ids = "";
-		Iterator keys = docsMap.keySet().iterator();
+		Iterator<String> keys = docsMap.keySet().iterator();
 
 		while (keys.hasNext())
 		{
-			Hashtable items = (Hashtable) docsMap.get((String) keys.next());
+			Hashtable items = docsMap.get(keys.next());
 			size += items.size();
 			Iterator values = items.values().iterator();
@@ -585,5 +585,5 @@
 	}
 
-	private Element getDocumentMetadata(String to, UserContext userContext, Iterator ids)
+	private Element getDocumentMetadata(String to, UserContext userContext, Iterator<String> ids)
 	{
 
@@ -594,5 +594,5 @@
 
 		// Create a parameter list to specify the required metadata information
-		HashSet meta_names = new HashSet();
+		HashSet<String> meta_names = new HashSet<String>();
 		meta_names.add("Title"); // the default
 		meta_names.add("root_Title");
@@ -602,8 +602,8 @@
 
 		Element param = null;
-		Iterator i = meta_names.iterator();
+		Iterator<String> i = meta_names.iterator();
 		while (i.hasNext())
 		{
-			String name = (String) i.next();
+			String name = i.next();
 			param = this.doc.createElement(GSXML.PARAM_ELEM);
 			param_list.appendChild(param);
@@ -623,5 +623,5 @@
 			Element dm_doc_node = this.doc.createElement(GSXML.DOC_NODE_ELEM);
 			dm_doc_list.appendChild(dm_doc_node);
-			dm_doc_node.setAttribute(GSXML.NODE_ID_ATT, (String) ids.next());
+			dm_doc_node.setAttribute(GSXML.NODE_ID_ATT, ids.next());
 		}
 
@@ -631,15 +631,15 @@
 	protected Element processDisplayDocumentList(Element request)
 	{
-		Hashtable docsMap = updateDocMap(request);
+		Hashtable<String, Hashtable<String, Item>> docsMap = updateDocMap(request);
 
 		// Create a new (empty) result message
 		Element result = this.doc.createElement(GSXML.RESPONSE_ELEM);
 
-		Iterator keys = docsMap.keySet().iterator();
+		Iterator<String> keys = docsMap.keySet().iterator();
 
 		while (keys.hasNext())
 		{
-			String collection = (String) keys.next();
-			Hashtable items = (Hashtable) docsMap.get(collection);
+			String collection = keys.next();
+			Hashtable items = docsMap.get(collection);
 			Iterator itemItr = items.values().iterator();
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/DocumentMaker.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/DocumentMaker.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/DocumentMaker.java	(revision 25635)
@@ -25,4 +25,5 @@
 import java.io.InputStreamReader;
 import java.io.OutputStream;
+import java.io.Serializable;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
@@ -370,5 +371,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 		String transactionString = (String) params.get("transactions");
 		transactionString = transactionString.replace("%26", "&");
@@ -393,5 +394,5 @@
 			for (int j = 0; j < transactions.size(); j++)
 			{
-				Map keyValueMap = (Map) transactions.get(j);
+				Map keyValueMap = transactions.get(j);
 				String operation = (String) keyValueMap.get("operation");
 				if (operation.equals("move") || operation.equals("duplicate"))
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraServiceProxy.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraServiceProxy.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraServiceProxy.java	(revision 25635)
@@ -81,5 +81,5 @@
 	this.doc = this.converter.newDOM();
 	this.short_service_info = this.doc.createElement(GSXML.SERVICE_ELEM+GSXML.LIST_MODIFIER);
-	this.format_info_map = new HashMap();
+	this.format_info_map = new HashMap<String, Node>();
 
     }
@@ -407,5 +407,5 @@
 	NodeList paramNodes = request.getElementsByTagName(GSXML.PARAM_ELEM);
 	if(paramNodes.getLength() > 0) {
-	    HashMap params = new HashMap(paramNodes.getLength());
+	    HashMap<String, String> params = new HashMap<String, String>(paramNodes.getLength());
 	    for(int i = 0; i < paramNodes.getLength(); i++) {
 		Element param = (Element)paramNodes.item(i);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Browse.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Browse.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Browse.java	(revision 25635)
@@ -158,5 +158,5 @@
     }
     /** returns a list of the child ids in order, null if no children */
-    protected ArrayList getChildrenIds(String node_id) {
+    protected ArrayList<String> getChildrenIds(String node_id) {
 	DBInfo info = this.coll_db.getInfo(node_id);
 	if (info == null) {
@@ -164,5 +164,5 @@
 	}
 
-	ArrayList children = new ArrayList();
+	ArrayList<String> children = new ArrayList<String>();
 	
 	String contains = info.getInfo("contains");
@@ -190,8 +190,8 @@
 	}
 
-	Set keys = info.getKeys();
-	Iterator it = keys.iterator();
+	Set<String> keys = info.getKeys();
+	Iterator<String> it = keys.iterator();
 	while(it.hasNext()) {
-	    String key_in = (String)it.next();
+	    String key_in = it.next();
 	    String value = info.getInfo(key);
 	    if (key_in.equals(key)){
@@ -212,5 +212,5 @@
     // assumes only one value per metadata
     protected Element getMetadataList(String node_id, boolean all_metadata, 
-				      ArrayList metadata_names) {
+				      ArrayList<String> metadata_names) {
 	String lang = "en";
 	Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
@@ -221,8 +221,8 @@
 	if (all_metadata) {
 	    // return everything out of the database
-	    Set keys = info.getKeys();
-	    Iterator it = keys.iterator();
+	    Set<String> keys = info.getKeys();
+	    Iterator<String> it = keys.iterator();
 	    while(it.hasNext()) {
-		String key = (String)it.next();
+		String key = it.next();
 		String value = info.getInfo(key);
 		GSXML.addMetadata(this.doc, metadata_list, key, this.macro_resolver.resolve(value, lang, GS2MacroResolver.SCOPE_META, node_id));
@@ -231,5 +231,5 @@
 	} else {
 	    for (int i=0; i<metadata_names.size(); i++) {
-		String meta_name = (String) metadata_names.get(i);
+		String meta_name = metadata_names.get(i);
 		String value = (String)info.getInfo(meta_name);
 		GSXML.addMetadata(this.doc, metadata_list, meta_name, value);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java	(revision 25635)
@@ -37,4 +37,5 @@
 import java.io.File;
 import java.io.FileWriter;
+import java.io.Serializable;
 import java.lang.Thread.State;
 import java.util.Locale;
@@ -82,10 +83,10 @@
 
 	// set of listeners for any construction commands
-	protected Map listeners = null;
+	protected Map<String, GS2PerlListener> listeners = null;
 	protected HashMap<String, Boolean> collectionOperationMap = new HashMap<String, Boolean>(); 
 
 	public GS2Construct()
 	{
-		this.listeners = Collections.synchronizedMap(new HashMap());
+		this.listeners = Collections.synchronizedMap(new HashMap<String, GS2PerlListener>());
 	}
 
@@ -175,5 +176,5 @@
 		String id = statusElem.getAttribute("pid");
 
-		GS2PerlListener currentListener = (GS2PerlListener) this.listeners.get(id);
+		GS2PerlListener currentListener = this.listeners.get(id);
 		int statusCode = currentListener.getStatus();
 		while (!GSStatus.isCompleted(statusCode))
@@ -199,5 +200,5 @@
 	{
 		Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		//If we have been requested to only build certain documents then we need to create a manifest file
@@ -264,5 +265,5 @@
 		// the MR about it. but we have to wait until the process is finished.
 		Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 		String coll_name = (String) params.get(COL_PARAM);
 		String lang = request.getAttribute(GSXML.LANG_ATT);
@@ -288,5 +289,5 @@
 		}
 		String id = status.getAttribute(GSXML.STATUS_PROCESS_ID_ATT);
-		GS2PerlListener listener = (GS2PerlListener) this.listeners.get(id);
+		GS2PerlListener listener = this.listeners.get(id);
 		if (listener == null)
 		{
@@ -342,5 +343,5 @@
 
 		Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		boolean get_status_only = false;
@@ -400,5 +401,5 @@
 
 		Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		boolean get_status_only = false;
@@ -551,5 +552,5 @@
 
 		Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 		boolean get_status_only = false;
@@ -564,5 +565,5 @@
 			String id = (String) params.get(PROCESS_ID_PARAM);
 			status.setAttribute(GSXML.STATUS_PROCESS_ID_ATT, id);
-			GS2PerlListener listener = (GS2PerlListener) this.listeners.get(id);
+			GS2PerlListener listener = this.listeners.get(id);
 			if (listener == null)
 			{
@@ -725,5 +726,5 @@
 	 * element
 	 */
-	protected Element extractOtherParams(HashMap params, int type)
+	protected Element extractOtherParams(HashMap<String, Serializable> params, int type)
 	{
 
@@ -758,5 +759,5 @@
 	{
 		Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 		
 		String collection = (String)params.get(COL_PARAM);
@@ -783,5 +784,5 @@
 	{
 		Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 		
 		String collection = (String)params.get(COL_PARAM);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java	(revision 25635)
@@ -30,4 +30,5 @@
 import java.util.HashMap;
 import java.io.File;
+import java.io.Serializable;
 import java.util.Iterator;
 import java.util.Set;
@@ -62,5 +63,5 @@
 
     /** do any initialisation of the query object */
-    protected boolean setUpQueryer(HashMap params) {
+    protected boolean setUpQueryer(HashMap<String, Serializable> params) {
 	String indexdir = GSFile.collectionBaseDir(this.site_home, this.cluster_name) + File.separatorChar + "index"+File.separatorChar;
 	
@@ -173,5 +174,5 @@
 
     /** add in term info if available */
-    protected boolean addTermInfo(Element term_list, HashMap params,
+    protected boolean addTermInfo(Element term_list, HashMap<String, Serializable> params,
 				  Object query_result) {
 	String query_level = (String)params.get(LEVEL_PARAM); // the current query level
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java	(revision 25635)
@@ -42,4 +42,5 @@
 import java.util.Vector;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -93,5 +94,5 @@
   }
   
-  protected boolean setUpQueryer(HashMap params) {
+  protected boolean setUpQueryer(HashMap<String, Serializable> params) {
     
     // set up the defaults that may be changed by query params
@@ -189,5 +190,5 @@
   }
   
-  protected boolean addTermInfo(Element term_list, HashMap params,
+  protected boolean addTermInfo(Element term_list, HashMap<String, Serializable> params,
     Object query_result) {
     
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java	(revision 25635)
@@ -36,4 +36,5 @@
 import java.util.Iterator;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -92,5 +93,5 @@
         
         // Process the request parameters
-        HashMap params = GSXML.extractParams (param_list, false);
+        HashMap<String, Serializable> params = GSXML.extractParams (param_list, false);
         
         // Make sure a query has been specified
@@ -213,5 +214,5 @@
     
     // should probably use a list rather than map
-    protected boolean setStandardQueryParams(HashMap params)
+    protected boolean setStandardQueryParams(HashMap<String, Serializable> params)
     {
 	// set the default settings that gs uses
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java	(revision 25635)
@@ -64,5 +64,5 @@
 	  //ArrayList docList_present = new ArrayList();
 	  
-	 ArrayList docList = new ArrayList();
+	 ArrayList<DocWrapper> docList = new ArrayList<DocWrapper>();
 
 	  for (int d = 0; d < docs.size(); d++) {
@@ -133,5 +133,5 @@
 // 	    interval = 10;
 
-	      doc_nums[d] = ((DocWrapper)docList.get(d)).num;
+	      doc_nums[d] = docList.get(d).num;
 	    
 	  }
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/IViaProxy.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/IViaProxy.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/IViaProxy.java	(revision 25635)
@@ -15,4 +15,5 @@
 import java.io.InputStreamReader;
 import java.io.IOException;
+import java.io.Serializable;
 import java.net.HttpURLConnection;
 import java.net.URLConnection;
@@ -176,5 +177,5 @@
 
 	// Process the request parameters
-	HashMap params = GSXML.extractParams(param_list, false);
+	HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 	// Make sure a query has been specified
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/IViaRetrieve.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/IViaRetrieve.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/IViaRetrieve.java	(revision 25635)
@@ -205,5 +205,5 @@
     }
 
-    protected ArrayList getChildrenIds(String node_id){
+    protected ArrayList<String> getChildrenIds(String node_id){
 	return null; 
     }
@@ -215,5 +215,5 @@
     protected Element getMetadataList (String doc_id,
 				       boolean all_metadata,
-				       ArrayList metadata_names) 
+				       ArrayList<String> metadata_names) 
 	throws GSException {
 	
@@ -225,7 +225,7 @@
 
 	for (int i=0; i<metadata_names.size();i++){
-	    if (isAcceptableMetadata((String)metadata_names.get(i))){
+	    if (isAcceptableMetadata(metadata_names.get(i))){
 		metadata_found = true;
-		field_list.append((String)metadata_names.get(i));
+		field_list.append(metadata_names.get(i));
 		field_list.append(",");
 	    }
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/IViaSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/IViaSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/IViaSearch.java	(revision 25635)
@@ -15,4 +15,5 @@
 import java.io.File;
 import java.io.BufferedReader;
+import java.io.Serializable;
 import java.net.Authenticator;
 
@@ -37,5 +38,5 @@
 
     protected String ivia_server_url = null;
-    protected ArrayList index_ids = null;
+    protected ArrayList<String> index_ids = null;
     public IViaSearch()
     {
@@ -62,5 +63,5 @@
 	does_multi_index_search = true;
 	this.default_index = ",kw,au,su,ti,de,fu,"; // all of them
-	index_ids = new ArrayList();
+	index_ids = new ArrayList<String>();
 	index_ids.add("kw");
 	index_ids.add("au");	
@@ -88,5 +89,5 @@
 
 	// Process the request parameters
-	HashMap params = GSXML.extractParams(param_list, false);
+	HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 	// Make sure a query has been specified
@@ -195,5 +196,5 @@
        An IVia server has a fixed list of fields to search (I think) so we can hard code them here rather than reading them in from a config file
     */
-    protected void getIndexData(ArrayList index_ids, ArrayList index_names,String lang){
+    protected void getIndexData(ArrayList<String> index_ids, ArrayList<String> index_names,String lang){
 	index_ids.addAll(this.index_ids);
 	index_names.add(getTextString("param."+INDEX_PARAM+".kw", lang)); 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/LuceneSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/LuceneSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/LuceneSearch.java	(revision 25635)
@@ -29,4 +29,5 @@
 import org.greenstone.LuceneWrapper3.GS2Analyzer;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -43,9 +44,9 @@
     protected static final String INDEX_ELEM = "index";
 
-    protected ArrayList index_ids;
+    protected ArrayList<String> index_ids;
 
     public LuceneSearch()
     {
-	index_ids = new ArrayList();
+	index_ids = new ArrayList<String>();
     }
     
@@ -77,5 +78,5 @@
     }
     
-    protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang) 
+    protected void getIndexData(ArrayList<String> index_ids, ArrayList<String> index_names, String lang) 
     {
 	// copying exercise for index_ids, 
@@ -133,5 +134,5 @@
 
 	// Process the request parameters to make sure a query has been specified
-	HashMap params = GSXML.extractParams(param_list, false);
+	HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 	String query_string = (String) params.get(QUERY_PARAM);
 
@@ -164,5 +165,5 @@
 	}
 
-	HashMap params = GSXML.extractParams(param_list, false);
+	HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 	String query_string = (String) params.get(QUERY_PARAM);
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/MapRetrieve.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/MapRetrieve.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/MapRetrieve.java	(revision 25635)
@@ -10,5 +10,4 @@
 
 // General Java classes
-import java.io.File;
 import java.io.*;
 import java.util.StringTokenizer;
@@ -36,6 +35,6 @@
     protected static final int DOCUMENT=1;
 
-    protected ArrayList index_name_list = null;
-    protected ArrayList index_display_list = null;
+    protected ArrayList<String> index_name_list = null;
+    protected ArrayList<String> index_display_list = null;
     protected String files_home_dir = null; 
     protected String temp_files_dir = null;
@@ -45,5 +44,5 @@
     protected String http_image_dir = null;
     protected String http_temp_image_dir = null;
-    private LinkedList namesInList = new LinkedList();
+    private LinkedList<String> namesInList = new LinkedList<String>();
 
     private DefaultMutableTreeNode tree;
@@ -91,6 +90,6 @@
 	this.http_temp_image_dir = this.site_http_address + "/collect/"+this.cluster_name+"/temp/";
 
-	this.index_name_list = new ArrayList();
-	this.index_display_list = new ArrayList();
+	this.index_name_list = new ArrayList<String>();
+	this.index_display_list = new ArrayList<String>();
 	Element index_list = (Element)GSXML.getChildByTagName(this.config_info, GSXML.INDEX_ELEM+GSXML.LIST_MODIFIER);
 	Element display_index_list = (Element)GSXML.getChildByTagName(extra_info, "search");
@@ -200,5 +199,5 @@
 
 	// The metadata information required
-	Vector metadata_list = new Vector();
+	Vector<String> metadata_list = new Vector<String>();
 	boolean all_metadata = false;
 	// Process the request parameters
@@ -292,5 +291,5 @@
 		// create the navigation thumbnails.  This doesn't seem to work most of the time ???????
 		for (int m = 0; m < metadata_list.size(); m++) {
-		    String metadata = (String) metadata_list.get(m);
+		    String metadata = metadata_list.get(m);
 		    thumb = "";
 		    String value = "";
@@ -448,5 +447,5 @@
 		    //put the names in an array
 		    for(int ri=0; namesInList.size()>0; ri++){
-			returnNames[ri]=(String)namesInList.getFirst();
+			returnNames[ri]=namesInList.getFirst();
 			returnNames[ri] = returnNames[ri].substring(0,returnNames[ri].indexOf('`'));
 			namesInList.removeFirst();
@@ -825,9 +824,9 @@
 
 	for (int i=0; i<this.index_name_list.size(); i++) {
-	    String name = (String)this.index_name_list.get(i);
+	    String name = this.index_name_list.get(i);
 	    dropDownBox.append("<option value=\"");
 	    dropDownBox.append(name);
 	    dropDownBox.append("\">");
-	    String display = (String)this.index_display_list.get(i);
+	    String display = this.index_display_list.get(i);
 	    dropDownBox.append(display);
 	    dropDownBox.append("\n");
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/MapSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/MapSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/MapSearch.java	(revision 25635)
@@ -41,4 +41,5 @@
 import java.io.ObjectInputStream;
 import java.io.FileInputStream;
+import java.io.Serializable;
 import java.lang.ClassNotFoundException;
 
@@ -140,5 +141,5 @@
     }
 
-    protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang) 
+    protected void getIndexData(ArrayList<String> index_ids, ArrayList<String> index_names, String lang) 
     {
 	// for now, we just have one dummy index
@@ -174,5 +175,5 @@
 
 	// Process the request parameters
-	HashMap params = GSXML.extractParams(param_list, false);
+	HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
 	// Make sure a query has been specified
@@ -241,5 +242,5 @@
 	String nameData;
 	double xco, yco;
-	LinkedList mapList = new LinkedList();
+	LinkedList<Object> mapList = new LinkedList<Object>();
 	LinkedList placeList = new LinkedList();
 	String readString = "";
@@ -304,5 +305,5 @@
 
 	//for each map, create a list of the query matches on that map
-	LinkedList tempList = new LinkedList();
+	LinkedList<Object> tempList = new LinkedList<Object>();
 	String mapNumber = "";
 	String currentMap[] = {"",""};
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java	(revision 25635)
@@ -227,7 +227,7 @@
      */ 
     NodeList params = GSXML.getChildrenByTagName(req, OAIXML.PARAM);
-    HashMap param_map = OAIXML.getParamMap(params);    
-    
-    String prefix = (String)param_map.get(OAIXML.METADATA_PREFIX);
+    HashMap<String, String> param_map = OAIXML.getParamMap(params);    
+    
+    String prefix = param_map.get(OAIXML.METADATA_PREFIX);
     if (prefix == null || prefix.equals("")) {
       //Just a double-check
@@ -242,5 +242,5 @@
     }
     
-    String oid = (String)param_map.get(OAIXML.OID);
+    String oid = param_map.get(OAIXML.OID);
 
     //get a DBInfo object of the identifier; if this identifier is not present in the database,
@@ -252,5 +252,5 @@
     }
 
-    ArrayList keys = new ArrayList(info.getKeys());
+    ArrayList<String> keys = new ArrayList<String>(info.getKeys());
     String oailastmodified = "";
     if(keys.contains(OAIXML.OAI_LASTMODIFIED)) {
@@ -285,5 +285,5 @@
     }
     
-    HashMap param_map = OAIXML.getParamMap(params);  
+    HashMap<String, String> param_map = OAIXML.getParamMap(params);  
     
     String prefix = "";
@@ -296,5 +296,5 @@
       return OAIXML.getResponse(OAIXML.createErrorElement(OAIXML.CANNOT_DISSEMINATE_FORMAT, ""));
     }
-    prefix = (String)param_map.get(OAIXML.METADATA_PREFIX);
+    prefix = param_map.get(OAIXML.METADATA_PREFIX);
     if (prefix == null || prefix.equals("")) {
       //Just a double-check
@@ -304,9 +304,9 @@
     
     if(param_map.containsKey(OAIXML.FROM)) {
-      String from = (String)param_map.get(OAIXML.FROM);
+      String from = param_map.get(OAIXML.FROM);
       from_date = OAIXML.getDate(from);
     }    
     if(param_map.containsKey(OAIXML.UNTIL)) {
-      String until = (String)param_map.get(OAIXML.UNTIL);
+      String until = param_map.get(OAIXML.UNTIL);
       until_date = OAIXML.getDate(until);
     }    
@@ -317,5 +317,5 @@
       return OAIXML.getResponse(OAIXML.createErrorElement(OAIXML.CANNOT_DISSEMINATE_FORMAT, ""));
     }
-    ArrayList oid_list = getChildrenIds(OAIXML.BROWSELIST);
+    ArrayList<String> oid_list = getChildrenIds(OAIXML.BROWSELIST);
     if (oid_list == null) {
       logger.error("No matched records found in collection: browselist is empty");
@@ -325,5 +325,5 @@
     Element list_identifiers = OAIXML.createElement(OAIXML.LIST_IDENTIFIERS);
     for(int i=0; i<oid_list.size(); i++) {
-      String oid = (String)oid_list.get(i);
+      String oid = oid_list.get(i);
       DBInfo info = this.coll_db.getInfo(oid);
       if (info == null) {
@@ -331,5 +331,5 @@
         continue;
       }
-      ArrayList keys = new ArrayList(info.getKeys());
+      ArrayList<String> keys = new ArrayList<String>(info.getKeys());
       String oailastmodified = "";
       if(keys.contains(OAIXML.OAI_LASTMODIFIED)) {
@@ -370,5 +370,5 @@
     }
     
-    HashMap param_map = OAIXML.getParamMap(params);    
+    HashMap<String, String> param_map = OAIXML.getParamMap(params);    
 
     String prefix = "";
@@ -381,5 +381,5 @@
       return OAIXML.getResponse(OAIXML.createErrorElement(OAIXML.CANNOT_DISSEMINATE_FORMAT, ""));
     }
-    prefix = (String)param_map.get(OAIXML.METADATA_PREFIX);
+    prefix = param_map.get(OAIXML.METADATA_PREFIX);
     if (prefix == null || prefix.equals("")) {
       //Just a double-check
@@ -389,9 +389,9 @@
     
     if(param_map.containsKey(OAIXML.FROM)) {
-      String from = (String)param_map.get(OAIXML.FROM);
+      String from = param_map.get(OAIXML.FROM);
       from_date = OAIXML.getDate(from);
     }    
     if(param_map.containsKey(OAIXML.UNTIL)) {
-      String until = (String)param_map.get(OAIXML.UNTIL);
+      String until = param_map.get(OAIXML.UNTIL);
       until_date = OAIXML.getDate(until);
     }    
@@ -403,5 +403,5 @@
     
     //get a list of identifiers (it contains a list of strings)
-    ArrayList oid_list = getChildrenIds(OAIXML.BROWSELIST);
+    ArrayList<String> oid_list = getChildrenIds(OAIXML.BROWSELIST);
     if (oid_list == null) {
       logger.error("No matched records found in collection: browselist is empty");
@@ -411,5 +411,5 @@
     Element list_records = OAIXML.createElement(OAIXML.LIST_RECORDS);
     for(int i=0; i<oid_list.size(); i++) {
-      String oid = (String)oid_list.get(i);
+      String oid = oid_list.get(i);
       DBInfo info = this.coll_db.getInfo(oid);
       if (info == null) {
@@ -417,5 +417,5 @@
         continue;
       }
-      ArrayList keys = new ArrayList(info.getKeys());
+      ArrayList<String> keys = new ArrayList<String>(info.getKeys());
       String oailastmodified = "";
       if(keys.contains(OAIXML.OAI_LASTMODIFIED)) {
@@ -527,5 +527,5 @@
       return OAIXML.getResponse(OAIXML.createErrorElement(OAIXML.ID_DOES_NOT_EXIST, ""));
     }
-    ArrayList oid_list = getChildrenIds(OAIXML.BROWSELIST);
+    ArrayList<String> oid_list = getChildrenIds(OAIXML.BROWSELIST);
     if (oid_list == null || oid_list.contains(oid) == false) {
       logger.error("OID: " + oid + " is not present in the database.");
@@ -591,5 +591,5 @@
 
   /** returns a list of the child ids in order, null if no children */
-  protected ArrayList getChildrenIds(String node_id) {
+  protected ArrayList<String> getChildrenIds(String node_id) {
     DBInfo info = this.coll_db.getInfo(node_id);
     if (info == null) {
@@ -601,5 +601,5 @@
       return null;
     }
-    ArrayList children = new ArrayList();
+    ArrayList<String> children = new ArrayList<String>();
     StringTokenizer st = new StringTokenizer(contains, ";");
     while (st.hasMoreTokens()) {
@@ -663,7 +663,7 @@
   public String[] getMetadata(DBInfo info, String names) {
     String[] name_value = new String[2];
-    ArrayList keys = new ArrayList(info.getKeys());
+    ArrayList<String> keys = new ArrayList<String>(info.getKeys());
     for (int i=0; i<keys.size(); i++) {
-      String key = (String)keys.get(i);
+      String key = keys.get(i);
       String first_name = "";
       String second_name = "";
@@ -689,5 +689,5 @@
       return null;
     }
-    HashMap map = new HashMap();
+    HashMap<String, String> map = new HashMap<String, String>();
     boolean empty_map = true;
     
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/PhindPhraseBrowse.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/PhindPhraseBrowse.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/PhindPhraseBrowse.java	(revision 25635)
@@ -30,4 +30,5 @@
 import java.util.HashMap;
 import java.io.File;
+import java.io.Serializable;
 
 import org.apache.log4j.*;
@@ -133,5 +134,5 @@
     
     Element param_elem = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
-    HashMap params = GSXML.extractParams(param_elem, false);
+    HashMap<String, Serializable> params = GSXML.extractParams(param_elem, false);
     
     long first_e = Long.parseLong((String)params.get("pfe"));
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceRack.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceRack.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceRack.java	(revision 25635)
@@ -92,5 +92,5 @@
 	 * XML element for stylesheet requests - map of service name to format elem
 	 */
-	protected HashMap format_info_map = null;
+	protected HashMap<String, Node> format_info_map = null;
 
 	/**
@@ -151,5 +151,5 @@
 		this.doc = this.converter.newDOM();
 		this.short_service_info = this.doc.createElement(GSXML.SERVICE_ELEM + GSXML.LIST_MODIFIER);
-		this.format_info_map = new HashMap();
+		this.format_info_map = new HashMap<String, Node>();
 	}
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceUtil.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceUtil.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceUtil.java	(revision 25635)
@@ -2,4 +2,5 @@
 
 import java.io.File;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -79,5 +80,5 @@
 		}
 
-		HashMap params = GSXML.extractParams(param_list, false);
+		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 		
 		String regex = (String)params.get("extregex");
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/SharedSoleneGS2FieldSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/SharedSoleneGS2FieldSearch.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/SharedSoleneGS2FieldSearch.java	(revision 25635)
@@ -93,11 +93,11 @@
 		if (name.equals(RANK_PARAM)) {
 			// get the fields
-			ArrayList fields = new ArrayList();
+			ArrayList<String> fields = new ArrayList<String>();
 			fields.add(RANK_PARAM_RANK_VALUE);
-			ArrayList field_names = new ArrayList();
+			ArrayList<String> field_names = new ArrayList<String>();
 			field_names.add(getTextString("param.sortBy.rank", lang)); 
 			getSortByIndexData(fields, field_names, lang);
 			
-			param = GSXML.createParameterDescription2(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, (String)fields.get(0), fields, field_names );
+			param = GSXML.createParameterDescription2(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, fields.get(0), fields, field_names );
 		}
 		if (param != null) {
@@ -108,5 +108,5 @@
 	}
 	
-	protected void getSortByIndexData(ArrayList index_ids, ArrayList index_names, String lang) {
+	protected void getSortByIndexData(ArrayList<String> index_ids, ArrayList<String> index_names, String lang) {
 		// the index info -
 		Element index_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_ELEM+GSXML.LIST_MODIFIER);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/XMLRetrieve.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/XMLRetrieve.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/XMLRetrieve.java	(revision 25635)
@@ -16,4 +16,5 @@
 // General Java classes
 import java.io.File;
+import java.io.Serializable;
 import java.util.Vector;
 import java.util.HashMap;
@@ -46,5 +47,5 @@
 	// look for the parameters
 	Element param_list = (Element)GSXML.getChildByTagName(info, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
-	HashMap params;
+	HashMap<String, Serializable> params;
 	String services_to_provide = "";
 	if (param_list != null) {
@@ -242,5 +243,5 @@
 	}
 	
-	Vector meta_name_list = new Vector();
+	Vector<String> meta_name_list = new Vector<String>();
 	boolean all_metadata = false;
 	// Process the request parameters
@@ -345,5 +346,5 @@
     }
 
-    protected Element getMetadata(String node_id, boolean all, Vector meta_name_list) {
+    protected Element getMetadata(String node_id, boolean all, Vector<String> meta_name_list) {
 
 	// our default strategy here is to only return Title and root:Title
@@ -373,5 +374,5 @@
 	    // have to process metadata one by one
 	    for (int i=0; i<meta_name_list.size(); i++) {
-		String meta_name = (String) meta_name_list.elementAt(i);
+		String meta_name = meta_name_list.elementAt(i);
 		String actual_meta_name = meta_name;
 		if (meta_name.startsWith("root_")) {
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/XSLTServices.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/XSLTServices.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/XSLTServices.java	(revision 25635)
@@ -216,5 +216,5 @@
 
     // extract the only parameter we care about
-    HashMap params = GSXML.extractParams(param_list, false);
+    HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
     String query = (String)params.get(QUERY_PARAM);
     
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/DatabaseFactory.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/DatabaseFactory.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/DatabaseFactory.java	(revision 25635)
@@ -11,5 +11,5 @@
 
 public class DatabaseFactory{
-    private static HashMap serverMap = new HashMap();
+    private static HashMap<String, SQLServer> serverMap = new HashMap<String, SQLServer>();
     private static Logger logger = Logger.getLogger(org.greenstone.gsdl3.sql.DatabaseFactory.class.getName());
 
@@ -29,5 +29,5 @@
     public static final SQLServer getDatabaseServer(String dbname){
 	dbname = properDBName(dbname);
-	if (serverMap.containsKey(dbname)) return (SQLServer) serverMap.get(dbname);
+	if (serverMap.containsKey(dbname)) return serverMap.get(dbname);
 	String fullName = "org.greenstone.gsdl3.sql." + dbname.toLowerCase()+ "." + dbname +"SQLServer";
 	try {
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/MetadataDBWrapper.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/MetadataDBWrapper.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/MetadataDBWrapper.java	(revision 25635)
@@ -2,4 +2,5 @@
 
 import java.util.ArrayList;
+import java.util.HashMap;
 
 import java.sql.ResultSet;
@@ -22,5 +23,5 @@
 
      //return a list of rows
-    public ArrayList executeQuery(String query_statement);
+    public ArrayList<HashMap<String, Object>> executeQuery(String query_statement);
 
     public ResultSet queryResultSet(String query_statement);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/derby/DerbyDBWrapper.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/derby/DerbyDBWrapper.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/derby/DerbyDBWrapper.java	(revision 25635)
@@ -30,9 +30,9 @@
 	if(sqlState == null) return null;
         String dbInfoState = sqlState.getDBInfoStatement(id);
-        ArrayList result = executeQuery(dbInfoState);
+        ArrayList<HashMap<String, Object>> result = executeQuery(dbInfoState);
 	if (result.size() == 0) return null;
 	DBInfo info = new DBInfo();
 	for(int i=0;  i<result.size();i++){
-	    HashMap arow = (HashMap)result.get(i);
+	    HashMap arow = result.get(i);
 	    Iterator ite = arow.keySet().iterator();
 	    while(ite.hasNext()){
@@ -90,7 +90,7 @@
     }
 
-    public synchronized ArrayList executeQuery(String query_statement){
+    public synchronized ArrayList<HashMap<String, Object>> executeQuery(String query_statement){
 	//the database hasn't been correct yet
-    	ArrayList results = new ArrayList();
+    	ArrayList<HashMap<String, Object>> results = new ArrayList<HashMap<String, Object>>();
 	ResultSet rs = null;
 	try{	
@@ -101,5 +101,5 @@
 	    int numOfColumns = rsmd.getColumnCount();
 	    while(rs.next()){
-		HashMap arow = new HashMap();
+		HashMap<String, Object> arow = new HashMap<String, Object>();
 		for(int i = 1; i <= numOfColumns ; i++){
 		    arow.put(rsmd.getColumnName(i).toLowerCase(), rs.getObject(i));
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/DBInfo.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/DBInfo.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/DBInfo.java	(revision 25635)
@@ -30,9 +30,9 @@
 public class DBInfo
 {
-	protected HashMap info_map_;
+	protected HashMap<String, Vector<String>> info_map_;
 
 	public DBInfo()
 	{
-		info_map_ = new HashMap();
+		info_map_ = new HashMap<String, Vector<String>>();
 	}
 
@@ -42,5 +42,5 @@
 	public void setInfo(String key, String value)
 	{
-		Vector v = new Vector();
+		Vector<String> v = new Vector<String>();
 		v.add(value);
 		info_map_.put(key, v);
@@ -53,5 +53,5 @@
 	public String getInfo(String key)
 	{
-		Vector items = (Vector) info_map_.get(key);
+		Vector items = info_map_.get(key);
 		if (items == null)
 		{
@@ -66,8 +66,8 @@
 	public void addInfo(String key, String value)
 	{
-		Vector v = (Vector) info_map_.get(key);
+		Vector<String> v = info_map_.get(key);
 		if (v == null)
 		{
-			v = new Vector();
+			v = new Vector<String>();
 		}
 		v.add(value);
@@ -80,11 +80,11 @@
 	 * @return Vector of Strings
 	 */
-	public Vector getMultiInfo(String key)
+	public Vector<String> getMultiInfo(String key)
 	{
-		return (Vector) info_map_.get(key);
+		return info_map_.get(key);
 	}
 
 	/** returns a list of all the keys in the info */
-	public Set getKeys()
+	public Set<String> getKeys()
 	{
 		return info_map_.keySet();
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GS2MacroResolver.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GS2MacroResolver.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GS2MacroResolver.java	(revision 25635)
@@ -26,4 +26,5 @@
 // Apache Commons
 import org.apache.commons.lang3.*;
+import org.greenstone.gsdl3.util.MacroResolver.Macro;
 
 import java.util.Stack;
@@ -65,5 +66,5 @@
 	} 
 
-	Stack macros = new Stack();//ArrayList macros;
+	Stack<Macro> macros = new Stack<Macro>();//ArrayList macros;
 	if (scope.equals(SCOPE_TEXT)) {
 	    macros.addAll(text_macros);
@@ -74,5 +75,5 @@
 	while(!macros.empty()) {
 	    String new_text = null;
-	    Macro m = (Macro)macros.pop();//.get(i);
+	    Macro m = macros.pop();//.get(i);
 	    switch (m.type) {
 	    case TYPE_DICT:
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSDocumentModel.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSDocumentModel.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSDocumentModel.java	(revision 25635)
@@ -1681,5 +1681,5 @@
 
 		String srcFile = info.getInfo("src-file");
-		Vector data = info.getMultiInfo("assoc-file");
+		Vector<String> data = info.getMultiInfo("assoc-file");
 
 		ArrayList<String> assocFiles = new ArrayList<String>();
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSFile.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSFile.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSFile.java	(revision 25635)
@@ -243,5 +243,5 @@
 	 * this is not so good because sites may be on a different computer
 	 */
-	static public String stylesheetFile(String gsdl3_home, String site_name, String collection, String interface_name, ArrayList base_interfaces, String filename)
+	static public String stylesheetFile(String gsdl3_home, String site_name, String collection, String interface_name, ArrayList<String> base_interfaces, String filename)
 	{
 
@@ -281,5 +281,5 @@
 		for (int i = 0; i < base_interfaces.size(); i++)
 		{
-			interface_home = interfaceHome(gsdl3_home, (String) base_interfaces.get(i));
+			interface_home = interfaceHome(gsdl3_home, base_interfaces.get(i));
 			stylesheet = new File(interface_home + File.separatorChar + "transform" + File.separatorChar + filename);
 			if (stylesheet.exists())
@@ -293,5 +293,5 @@
 	}
 
-	static public ArrayList<File> getStylesheetFiles(String gsdl3_home, String site_name, String collection, String interface_name, ArrayList base_interfaces, String filename)
+	static public ArrayList<File> getStylesheetFiles(String gsdl3_home, String site_name, String collection, String interface_name, ArrayList<String> base_interfaces, String filename)
 	{
 		ArrayList<File> stylesheets = new ArrayList<File>();
@@ -328,5 +328,5 @@
 			for (int i = 0; i < base_interfaces.size(); i++)
 			{
-				interface_home = interfaceHome(gsdl3_home, (String) base_interfaces.get(i));
+				interface_home = interfaceHome(gsdl3_home, base_interfaces.get(i));
 				stylesheet = new File(interface_home + File.separatorChar + "transform" + File.separatorChar + filename);
 				if (stylesheet.exists())
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java	(revision 25635)
@@ -75,9 +75,9 @@
 	public static final String EXTERNAL_LINK_TYPE_FRAMED = "frame";
 
-	protected HashMap param_map = null;
+	protected HashMap<String, Param> param_map = null;
 
 	public GSParams()
 	{
-		this.param_map = new HashMap(30);
+		this.param_map = new HashMap<String, Param>(30);
 
 		// add in all the standard params
@@ -135,5 +135,5 @@
 	public boolean setParamDefault(String name, String default_value)
 	{
-		Param p = (Param) this.param_map.get(name);
+		Param p = this.param_map.get(name);
 		if (p == null)
 			return false;
@@ -147,5 +147,5 @@
 		if (name.startsWith("p."))
 			return false;
-		Param p = (Param) this.param_map.get(name);
+		Param p = this.param_map.get(name);
 		if (p == null)
 			return true; // if things are not in here, always save.
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 25635)
@@ -28,4 +28,6 @@
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.Transformer;
+
+import java.io.Serializable;
 import java.io.StringWriter;
 import javax.xml.transform.stream.StreamResult;
@@ -299,5 +301,5 @@
 	}
 
-	public static HashMap extractParams(Element xml, boolean deep)
+	public static HashMap<String, Serializable> extractParams(Element xml, boolean deep)
 	{
 		return extractParams(xml, deep, null);
@@ -308,5 +310,5 @@
 	 * deep=true, extracts embedded params, otherwise just top level params
 	 */
-	public static HashMap extractParams(Element xml, boolean deep, String toFind)
+	public static HashMap<String, Serializable> extractParams(Element xml, boolean deep, String toFind)
 	{
 
@@ -326,5 +328,5 @@
 			params = xml.getChildNodes();
 		}
-		HashMap param_map = new HashMap();
+		HashMap<String, Serializable> param_map = new HashMap<String, Serializable>();
 		for (int i = 0; i < params.getLength(); i++)
 		{
@@ -354,8 +356,8 @@
 					String namespace = name.substring(0, pos);
 					name = name.substring(pos + 1);
-					HashMap map = (HashMap) param_map.get(namespace);
+					HashMap<String, String> map = (HashMap<String, String>) param_map.get(namespace);
 					if (map == null)
 					{
-						map = new HashMap();
+						map = new HashMap<String, String>();
 						param_map.put(namespace, map);
 					}
@@ -669,8 +671,8 @@
 	}
 
-	public static HashMap getChildrenMap(Node n)
-	{
-
-		HashMap map = new HashMap();
+	public static HashMap<String, Node> getChildrenMap(Node n)
+	{
+
+		HashMap<String, Node> map = new HashMap<String, Node>();
 		Node child = n.getFirstChild();
 		while (child != null)
@@ -856,5 +858,5 @@
 	}
 
-	public static Element createParameterDescription2(Document owner, String id, String display_name, String type, String default_value, ArrayList option_ids, ArrayList option_names)
+	public static Element createParameterDescription2(Document owner, String id, String display_name, String type, String default_value, ArrayList<String> option_ids, ArrayList<String> option_names)
 	{
 
@@ -872,6 +874,6 @@
 			{
 				Element e = owner.createElement(PARAM_OPTION_ELEM);
-				e.setAttribute(NAME_ATT, (String) option_ids.get(i));
-				e.appendChild(createDisplayTextElement(owner, GSXML.DISPLAY_TEXT_NAME, (String) option_names.get(i)));
+				e.setAttribute(NAME_ATT, option_ids.get(i));
+				e.appendChild(createDisplayTextElement(owner, GSXML.DISPLAY_TEXT_NAME, option_names.get(i)));
 				p.appendChild(e);
 			}
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXSLT.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXSLT.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXSLT.java	(revision 25635)
@@ -124,5 +124,5 @@
 	 * the files
 	 */
-	public static void absoluteIncludePaths(Document stylesheet, String gsdl3_home, String site_name, String collection, String interface_name, ArrayList base_interfaces)
+	public static void absoluteIncludePaths(Document stylesheet, String gsdl3_home, String site_name, String collection, String interface_name, ArrayList<String> base_interfaces)
 	{
 
@@ -151,8 +151,8 @@
 	 * metadata names into a Vector
 	 */
-	public static Vector extractWantedMetadata(Document stylesheet, String template_name)
+	public static Vector<String> extractWantedMetadata(Document stylesheet, String template_name)
 	{
 
-		Vector metadata = new Vector();
+		Vector<String> metadata = new Vector<String>();
 		Element base_node = stylesheet.getDocumentElement();
 		NodeList templates = base_node.getElementsByTagNameNS("*", "template");
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/MacroResolver.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/MacroResolver.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/MacroResolver.java	(revision 25635)
@@ -35,12 +35,12 @@
     public static final int TYPE_DICT = 2;
     
-    protected ArrayList text_macros = null;
-    protected ArrayList metadata_macros = null;
+    protected ArrayList<Macro> text_macros = null;
+    protected ArrayList<Macro> metadata_macros = null;
 
     String lang = null;
 
     public MacroResolver() {
-    	this.text_macros = new ArrayList();
-	this.metadata_macros = new ArrayList();
+    	this.text_macros = new ArrayList<Macro>();
+	this.metadata_macros = new ArrayList<Macro>();
     }
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/MyNodeList.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/MyNodeList.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/MyNodeList.java	(revision 25635)
@@ -27,8 +27,8 @@
 
 public class MyNodeList implements NodeList {
-    private ArrayList node_list = null;
+    private ArrayList<Node> node_list = null;
     
     public MyNodeList() {
-	node_list = new ArrayList();
+	node_list = new ArrayList<Node>();
     }
     public int getLength() {
@@ -38,5 +38,5 @@
     public Node item(int i) {
 	if (i<0 || i >= node_list.size()) return null;
-	return (Node)node_list.get(i);
+	return node_list.get(i);
     }
     
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java	(revision 25635)
@@ -22,4 +22,5 @@
 
 import org.w3c.dom.*;
+
 import java.io.*;
 import java.net.*;
@@ -561,7 +562,7 @@
       return oai;
     }
-    public static HashMap getChildrenMapByTagName(Node n, String tag_name) {
+    public static HashMap<String, Node> getChildrenMapByTagName(Node n, String tag_name) {
 	
-	HashMap map= new HashMap();
+	HashMap<String, Node> map= new HashMap<String, Node>();
 	Node child = n.getFirstChild();
 	while (child!=null) {
@@ -622,6 +623,6 @@
       }
     }
-    public static HashMap getParamMap(NodeList params) {
-      HashMap map = new HashMap();
+    public static HashMap<String, String> getParamMap(NodeList params) {
+      HashMap<String, String> map = new HashMap<String, String>();
       for(int i=0; i<params.getLength(); i++) {
         Element param = (Element)params.item(i);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/SimpleCollectionDatabase.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/SimpleCollectionDatabase.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/SimpleCollectionDatabase.java	(revision 25635)
@@ -154,9 +154,9 @@
 	{
 		StringBuilder valueToAdd = new StringBuilder();
-		Iterator i = info.getKeys().iterator();
+		Iterator<String> i = info.getKeys().iterator();
 		while (i.hasNext())
 		{
-			String currentKey = (String)i.next();
-			Vector currentValues = (Vector)info.getMultiInfo(currentKey);
+			String currentKey = i.next();
+			Vector<String> currentValues = (Vector<String>)info.getMultiInfo(currentKey);
 			
 			if(currentValues.size() == 0)
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/UserQueryResult.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/UserQueryResult.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/UserQueryResult.java	(revision 25635)
@@ -59,5 +59,5 @@
 		for (int i = 0; i < users.size(); i++)
 		{
-			result += ((UserTermInfo) users.elementAt(i)).toString() + ", ";
+			result += users.elementAt(i).toString() + ", ";
 		}
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XMLTransformer.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XMLTransformer.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XMLTransformer.java	(revision 25635)
@@ -216,15 +216,15 @@
 	}
 
-	public Node transform(Document stylesheet, Document source, HashMap parameters)
+	public Node transform(Document stylesheet, Document source, HashMap<String, Comparable> parameters)
 	{
 		return transform(stylesheet, source, parameters, null, null);
 	}
 
-	public Node transform(Document stylesheet, Document source, HashMap parameters, Document docDocType)
+	public Node transform(Document stylesheet, Document source, HashMap<String, Comparable> parameters, Document docDocType)
 	{
 		return transform(stylesheet, source, parameters, docDocType, null);
 	}
 
-	protected Node transform(Document stylesheet, Document source, HashMap parameters, Document docDocType, Document resultNode)
+	protected Node transform(Document stylesheet, Document source, HashMap<String, Comparable> parameters, Document docDocType, Document resultNode)
 	{
 		try
Index: /main/trunk/greenstone3/src/java/org/greenstone/server/BaseServerSettings.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/server/BaseServerSettings.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/server/BaseServerSettings.java	(revision 25635)
@@ -202,5 +202,5 @@
 	return returnValues;
     }
-    protected void save(ScriptReadWrite scriptReadWrite, ArrayList newFileLines) {}
+    protected void save(ScriptReadWrite scriptReadWrite, ArrayList<String> newFileLines) {}
     protected abstract JPanel createServletPanel();
 
@@ -278,6 +278,6 @@
 
 	    if (has_changed) {
-		ArrayList oldFileLines = null;
-		ArrayList newFileLines = null;
+		ArrayList<String> oldFileLines = null;
+		ArrayList<String> newFileLines = null;
 		
 		ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
Index: /main/trunk/greenstone3/src/java/org/greenstone/server/Server2.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/server/Server2.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/server/Server2.java	(revision 25635)
@@ -83,5 +83,5 @@
 				    config_properties.setProperty(url, URL_PENDING);
 				    ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
-				    ArrayList fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
+				    ArrayList<String> fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
 				    scriptReadWrite.replaceOrAddLine(fileLines, url, URL_PENDING, true);
 				    scriptReadWrite.writeOutFile(config_properties_file, fileLines);
@@ -160,5 +160,5 @@
 		String hosts = inetAddress.getHostName();
 		ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
-		ArrayList fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
+		ArrayList<String> fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
 		scriptReadWrite.replaceOrAddLine(fileLines, "hosts", hosts, true);
 		scriptReadWrite.writeOutFile(config_properties_file, fileLines);
@@ -175,5 +175,5 @@
 		config_properties.setProperty(url, URL_PENDING);
 		ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
-		ArrayList fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
+		ArrayList<String> fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
 		scriptReadWrite.replaceOrAddLine(fileLines, url, URL_PENDING, true);
 		scriptReadWrite.writeOutFile(config_properties_file, fileLines);
@@ -355,5 +355,5 @@
 		    // write this updated port to the config file, since the configure target uses the file to run
 		    ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
-		    ArrayList fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
+		    ArrayList<String> fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
 		    scriptReadWrite.replaceOrAddLine(fileLines, "portnumber", port, false); // write the correct port
 		    scriptReadWrite.writeOutFile(config_properties_file, fileLines);
@@ -377,10 +377,10 @@
     protected void preStop() {
 	ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
-	ArrayList fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
+	ArrayList<String> fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
 
 	// Remove the url=... line, start searching from the end
 	boolean done = false;
 	for (int i = fileLines.size()-1; i >= 0 && !done; i--) {
-	    String line = ((String) fileLines.get(i)).trim();
+	    String line = fileLines.get(i).trim();
 	    if(line.startsWith(property_prefix+"url=")) {
 		fileLines.remove(i);
@@ -437,5 +437,5 @@
 
 	ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
-	ArrayList fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
+	ArrayList<String> fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
 	scriptReadWrite.replaceOrAddLine(fileLines, property_prefix+"url", libraryURL, true);
 	scriptReadWrite.replaceOrAddLine(fileLines, "portnumber", port, false); // write the correct port
Index: /main/trunk/greenstone3/src/java/org/greenstone/server/Server2Settings.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/server/Server2Settings.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/server/Server2Settings.java	(revision 25635)
@@ -101,5 +101,5 @@
     }
 
-    public void save(ScriptReadWrite scriptReadWrite, ArrayList newFileLines) 
+    public void save(ScriptReadWrite scriptReadWrite, ArrayList<String> newFileLines) 
     {
 	// write only 1 or 0 (and not true or false) for Server2
Index: /main/trunk/greenstone3/src/java/org/greenstone/server/Server3Settings.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/server/Server3Settings.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/server/Server3Settings.java	(revision 25635)
@@ -22,5 +22,5 @@
     protected String servletDefault = null;
     protected JComboBox servlet_combobox;
-    protected HashMap url_mappings = null;
+    protected HashMap<String, String> url_mappings = null;
 
     public Server3Settings(BaseServer server) 
@@ -49,5 +49,5 @@
 	NodeList servlet_mappings = web_config.getElementsByTagName("servlet-mapping");
 	// make a little map class
-	url_mappings = new HashMap();
+	url_mappings = new HashMap<String, String>();
 	for (int i = 0; i < servlet_mappings.getLength(); i++) {
 	    Element map = (Element) servlet_mappings.item(i);
@@ -80,5 +80,5 @@
 	boolean hasChanged = false;
 	boolean requireRestart = false;
-	String urlMapping = (String)url_mappings.get(servlet_combobox.getSelectedItem());
+	String urlMapping = url_mappings.get(servlet_combobox.getSelectedItem());
 	if(urlMapping.endsWith("/*")) {	// urlmapping maybe something like "/library/*"
 	    urlMapping = urlMapping.substring(0, urlMapping.length()-2);
@@ -92,5 +92,5 @@
     }
 
-    public void save(ScriptReadWrite scriptReadWrite, ArrayList newFileLines) 
+    public void save(ScriptReadWrite scriptReadWrite, ArrayList<String> newFileLines) 
     {
 	String newAutoEnter = (new Boolean(autoEnter.isSelected())).toString();
@@ -101,5 +101,5 @@
 
 	String newServletDef = (String) servlet_combobox.getSelectedItem();
-	String servletDefName = (String) url_mappings.get(newServletDef);
+	String servletDefName = url_mappings.get(newServletDef);
 	if(servletDefName.endsWith("/*")) { // urlmapping maybe something like "/library/*"	    
 	  servletDefName = servletDefName.substring(0, servletDefName.length()-2);
Index: /main/trunk/greenstone3/src/java/org/greenstone/testing/ClassFinder.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/testing/ClassFinder.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/testing/ClassFinder.java	(revision 25635)
@@ -19,5 +19,5 @@
  */
 public class ClassFinder {
-    final private Vector classNameList = new Vector ();
+    final private Vector<String> classNameList = new Vector<String> ();
     final private int startPackageName;
 
@@ -78,5 +78,5 @@
      * Return the found classes.
      */
-    public Iterator getClasses () {
+    public Iterator<String> getClasses () {
         return classNameList.iterator ();
     }
Index: /main/trunk/greenstone3/src/java/org/greenstone/testing/TestCaseLoader.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/testing/TestCaseLoader.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/testing/TestCaseLoader.java	(revision 25635)
@@ -7,5 +7,5 @@
  */
 public class TestCaseLoader {
-    final private Vector classList = new Vector ();
+    final private Vector<Class> classList = new Vector<Class> ();
     final private String requiredType;
     
@@ -78,5 +78,5 @@
      * Obtain an iterator over the collection of test case classes loaded by <code>loadTestCases</code>
      */
-    public Iterator getClasses () {
+    public Iterator<Class> getClasses () {
         return classList.iterator ();
     }
Index: /main/trunk/greenstone3/src/java/org/greenstone/util/Configuration.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/util/Configuration.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/util/Configuration.java	(revision 25635)
@@ -42,5 +42,5 @@
 public class Configuration {
     
-    static private Hashtable hash = null;
+    static private Hashtable<String, String> hash = null;
 
     /** The first of three patterns used during tokenization, this pattern handles a comma separated list. */
@@ -53,5 +53,5 @@
     public Configuration() {
 	
-	hash = new Hashtable();
+	hash = new Hashtable<String, String>();
 	
 	
@@ -76,5 +76,5 @@
     /** Retrieve whether the named property is set or not */
     static public boolean get(String property) {
-	String value = (String)hash.get(property);
+	String value = hash.get(property);
 	return (value != null && value.equalsIgnoreCase("true"));
     }
@@ -82,5 +82,5 @@
     /** Retrieve the value of the named property as a String */
     static public String getString(String property) {
-	return (String)hash.get(property);
+	return hash.get(property);
     }
 
@@ -89,5 +89,5 @@
 	Locale result = Locale.getDefault();
 	try {
-	    String raw = (String) hash.get(property);
+	    String raw = hash.get(property);
 	    if (raw==null) {
 		return result;
@@ -113,5 +113,5 @@
     static public Color getColor(String property) {
 	Color result = Color.white; // Default
-	String raw = (String)hash.get(property);
+	String raw = hash.get(property);
 	if (raw == null || raw.equals("")) {
 	    return result;
Index: /main/trunk/greenstone3/src/java/org/greenstone/util/ScriptReadWrite.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/util/ScriptReadWrite.java	(revision 25634)
+++ /main/trunk/greenstone3/src/java/org/greenstone/util/ScriptReadWrite.java	(revision 25635)
@@ -15,7 +15,7 @@
     }
 
-    public ArrayList readInFile(File file) {
+    public ArrayList<String> readInFile(File file) {
 	try {
-	    ArrayList fileLines = new ArrayList();
+	    ArrayList<String> fileLines = new ArrayList<String>();
 	    String oneLine = null;
 	    BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
@@ -31,5 +31,5 @@
     }
 
-    public void writeOutFile(File file, ArrayList fileLines_in) {
+    public void writeOutFile(File file, ArrayList<String> fileLines_in) {
 	try {
 	    PrintWriter printWriter = new PrintWriter(new BufferedWriter(new FileWriter(file)));
@@ -44,5 +44,5 @@
     }
 
-    public ArrayList queryReplace(ArrayList fileLines_ex, String param,
+    public ArrayList<String> queryReplace(ArrayList<String> fileLines_ex, String param,
 				  String newValue) {
 	// only replace existing, don't append if param does not exist
@@ -52,5 +52,5 @@
     // if the parameter exists, then a replace is performed, else the parameter-value
     // is appended
-    public ArrayList replaceOrAddLine(ArrayList fileLines_ex, String param, String newValue, 
+    public ArrayList<String> replaceOrAddLine(ArrayList<String> fileLines_ex, String param, String newValue, 
 				      boolean replaceElseAdd) 
     {	
@@ -63,5 +63,5 @@
 
 	for (int i = 0; i < fileLines_ex.size(); i++) {
-	    oneLine = ((String) fileLines_ex.get(i)).trim();
+	    oneLine = fileLines_ex.get(i).trim();
 	    // oneLine_length = oneLine.length();
 	    StringTokenizer st = new StringTokenizer(oneLine, "=");
