diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/BulkEditChange.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/BulkEditChange.java index 52dc879237..8a4153cd97 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/BulkEditChange.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/BulkEditChange.java @@ -43,6 +43,7 @@ import org.dspace.content.DCValue; import org.dspace.content.Collection; import java.util.ArrayList; +import java.util.List; /** * Utility class to store changes to item that may occur during a batch edit. @@ -54,23 +55,23 @@ public class BulkEditChange /** The item these changes relate to */ private Item item; - /** The ArrayList of hashtables with the new elements */ - private ArrayList adds; + /** The List of hashtables with the new elements */ + private List adds; - /** The ArrayList of hashtables with the removed elements */ - private ArrayList removes; + /** The List of hashtables with the removed elements */ + private List removes; - /** The ArrayList of hashtables with the unchanged elements */ - private ArrayList constant; + /** The List of hashtables with the unchanged elements */ + private List constant; - /** The ArrayList of the complete set of new values (constant + adds) */ - private ArrayList complete; + /** The List of the complete set of new values (constant + adds) */ + private List complete; - /** The Arraylist of old collections the item used to be mapped to */ - private ArrayList oldMappedCollections; + /** The list of old collections the item used to be mapped to */ + private List oldMappedCollections; - /** The Arraylist of new collections the item has been mapped into */ - private ArrayList newMappedCollections; + /** The list of new collections the item has been mapped into */ + private List newMappedCollections; /** The old owning collection */ private Collection oldOwningCollection; @@ -262,7 +263,7 @@ public class BulkEditChange * * @return the list of elements and their values that have been added. */ - public ArrayList getAdds() + public List getAdds() { // Return the array return adds; @@ -273,7 +274,7 @@ public class BulkEditChange * * @return the list of elements and their values that have been removed. */ - public ArrayList getRemoves() + public List getRemoves() { // Return the array return removes; @@ -284,7 +285,7 @@ public class BulkEditChange * * @return the list of unchanged values */ - public ArrayList getConstant() + public List getConstant() { // Return the array return constant; @@ -295,7 +296,7 @@ public class BulkEditChange * * @return the list of all values */ - public ArrayList getComplete() + public List getComplete() { // Return the array return complete; @@ -306,7 +307,7 @@ public class BulkEditChange * * @return the list of new mapped collections */ - public ArrayList getNewMappedCollections() + public List getNewMappedCollections() { // Return the array return newMappedCollections; @@ -317,7 +318,7 @@ public class BulkEditChange * * @return the list of old mapped collections */ - public ArrayList getOldMappedCollections() + public List getOldMappedCollections() { // Return the array return oldMappedCollections; diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java index c42c8eaef4..e56b28e866 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java @@ -56,10 +56,10 @@ import java.io.*; public class DSpaceCSV { /** The headings of the CSV file */ - private ArrayList headings; + private List headings; /** An array list of CSV lines */ - private ArrayList lines; + private List lines; /** A counter of how many CSV lines this object holds */ private int counter; @@ -485,7 +485,7 @@ public class DSpaceCSV * * @return The lines */ - public ArrayList getCSVLines() + public List getCSVLines() { // Return the lines return lines; diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java index 624792321f..ca40007881 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java @@ -42,6 +42,7 @@ import java.util.ArrayList; import java.util.Hashtable; import java.util.Enumeration; import java.util.Iterator; +import java.util.List; /** * Utility class to store a line from a CSV file @@ -116,7 +117,7 @@ public class DSpaceCSVLine * @param key The metadata key * @return All the elements that match */ - public ArrayList get(String key) + public List get(String key) { // Return any relevant values return items.get(key); @@ -139,7 +140,7 @@ public class DSpaceCSVLine * @param headings The headings which define the order the elements must be presented in * @return The CSV formatted String */ - protected String toCSV(ArrayList headings) + protected String toCSV(List headings) { StringBuilder bits = new StringBuilder(); @@ -172,7 +173,7 @@ public class DSpaceCSVLine * @param values The values to create the string from * @return The line as a CSV formatted String */ - private String valueToCSV(ArrayList values) + private String valueToCSV(List values) { // Check there is some content if (values == null) diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataExport.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataExport.java index bc1119d7ab..70a936d1d1 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataExport.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataExport.java @@ -47,6 +47,7 @@ import org.dspace.handle.HandleManager; import java.util.ArrayList; import java.sql.SQLException; +import java.util.List; /** * Metadata exporter to allow the batch export of metadata into a file @@ -116,7 +117,7 @@ public class MetadataExport * @return The list of item ids * @throws SQLException */ - private ArrayList buildFromCommunity(Community community, ArrayList itemIDs, int indent) + private List buildFromCommunity(Community community, List itemIDs, int indent) throws SQLException { // Add all the collections diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java index 5f14a5fb67..4d6ad213c7 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java @@ -55,6 +55,7 @@ import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; import java.sql.SQLException; +import java.util.List; /** * Metadata importer to allow the batch import of metadata from a file @@ -67,7 +68,7 @@ public class MetadataImport Context c; /** The lines to import */ - ArrayList toImport; + List toImport; /** log4j logger */ private static Logger log = Logger.getLogger(MetadataImport.class); @@ -79,7 +80,7 @@ public class MetadataImport * @param c The context * @param toImport An array of CSV lines to examine */ - public MetadataImport(Context c, ArrayList toImport) + public MetadataImport(Context c, List toImport) { // Store the import settings this.c = c; @@ -98,7 +99,7 @@ public class MetadataImport * * @throws MetadataImportException if something goes wrong */ - public ArrayList runImport(boolean change, + public List runImport(boolean change, boolean useWorkflow, boolean workflowNotify, boolean useTemplate) throws MetadataImportException @@ -127,7 +128,7 @@ public class MetadataImport BulkEditChange whatHasChanged = new BulkEditChange(item); // Has it moved collection? - ArrayList collections = line.get("collection"); + List collections = line.get("collection"); if (collections != null) { // Sanity check we're not orphaning it @@ -189,7 +190,7 @@ public class MetadataImport } // Check it has an owning collection - ArrayList collections = line.get("collection"); + List collections = line.get("collection"); if (collections == null) { throw new MetadataImportException("New items must have a 'collection' assigned in the form of a handle"); @@ -412,8 +413,8 @@ public class MetadataImport ((changes.getAdds().size() > 0) || (changes.getRemoves().size() > 0))) { // Get the complete list of what values should now be in that element - ArrayList list = changes.getComplete(); - ArrayList values = new ArrayList(); + List list = changes.getComplete(); + List values = new ArrayList(); for (DCValue value : list) { if ((qualifier == null) && (language == null)) @@ -482,7 +483,7 @@ public class MetadataImport * @throws MetadataImportException If something goes wrong to be reported back to the user */ private void compare(Item item, - ArrayList collections, + List collections, Collection[] actualCollections, BulkEditChange bechange, boolean change) throws SQLException, AuthorizeException, IOException, MetadataImportException @@ -748,17 +749,17 @@ public class MetadataImport * @param changed Whether or not the changes have been made * @return The number of items that have changed */ - private static int displayChanges(ArrayList changes, boolean changed) + private static int displayChanges(List changes, boolean changed) { // Display the changes int changeCounter = 0; for (BulkEditChange change : changes) { // Get the changes - ArrayList adds = change.getAdds(); - ArrayList removes = change.getRemoves(); - ArrayList newCollections = change.getNewMappedCollections(); - ArrayList oldCollections = change.getOldMappedCollections(); + List adds = change.getAdds(); + List removes = change.getRemoves(); + List newCollections = change.getNewMappedCollections(); + List oldCollections = change.getOldMappedCollections(); if ((adds.size() > 0) || (removes.size() > 0) || (newCollections.size() > 0) || (oldCollections.size() > 0) || (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null)) @@ -1037,7 +1038,7 @@ public class MetadataImport // Perform the first import - just higlight differences MetadataImport importer = new MetadataImport(c, csv.getCSVLines()); - ArrayList changes; + List changes; if (!line.hasOption('s')) { diff --git a/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java b/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java index c18b3c3fd9..cb4f23e835 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java +++ b/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java @@ -99,24 +99,24 @@ public class DCInputsReader * Reference to the collections to forms map, computed from the forms * definition file */ - private HashMap whichForms = null; + private Map whichForms = null; /** * Reference to the forms definitions map, computed from the forms * definition file */ - private HashMap formDefns = null; + private Map formDefns = null; /** * Reference to the forms which allow, disallow or mandate files to be * uploaded. */ - private HashMap formFileUploadDefns = null; + private Map formFileUploadDefns = null; /** * Reference to the value-pairs map, computed from the forms definition file */ - private HashMap valuePairs = null; // Holds display/storage pairs + private Map valuePairs = null; // Holds display/storage pairs /** * Mini-cache of last DCInputSet requested. If submissions are not typically @@ -481,7 +481,7 @@ public class DCInputsReader * Check that this is the only field with the name dc-element.dc-qualifier * If there is a duplicate, return an error message, else return null; */ - private String checkForDups(String formName, HashMap field, List pages) + private String checkForDups(String formName, Map field, List pages) { int matches = 0; String err = null; diff --git a/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java b/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java index 0b55142b57..858a9b63a9 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java +++ b/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java @@ -97,7 +97,7 @@ public class SubmissionConfigReader * which collection, computed from the item submission config file * (specifically, the 'submission-map' tag) */ - private HashMap collectionToSubmissionConfig = null; + private Map collectionToSubmissionConfig = null; /** * Reference to the global submission step definitions defined in the @@ -396,7 +396,7 @@ public class SubmissionConfigReader "There are two step elements with the id '" + stepID + "' in 'item-submission.xml'"); } - HashMap stepInfo = processStepChildNodes("step-definition", nd); + Map stepInfo = processStepChildNodes("step-definition", nd); stepDefns.put(stepID, stepInfo); } // ignore any child that is not a 'step' @@ -489,7 +489,7 @@ public class SubmissionConfigReader // check for an 'id' attribute String stepID = getAttribute(nStep, "id"); - HashMap stepInfo; + Map stepInfo; // if this step has an id, load its information from the // step-definition section @@ -567,7 +567,7 @@ public class SubmissionConfigReader * and the value is the field value. * */ - private HashMap processStepChildNodes(String configSection, Node nStep) + private Map processStepChildNodes(String configSection, Node nStep) throws SAXException, ServletException { // initialize the HashMap of step Info diff --git a/dspace-api/src/main/java/org/dspace/app/util/SubmissionInfo.java b/dspace-api/src/main/java/org/dspace/app/util/SubmissionInfo.java index ef077ef51c..267d45fa5b 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/SubmissionInfo.java +++ b/dspace-api/src/main/java/org/dspace/app/util/SubmissionInfo.java @@ -86,7 +86,7 @@ public class SubmissionInfo * second page of Step 5) Values are the Headings to display for each step * (e.g. "Describe") **************************************************************************/ - private HashMap progressBar = null; + private Map progressBar = null; /** The element or element_qualifier to show more input boxes for */ private String moreBoxesFor; @@ -583,7 +583,7 @@ public class SubmissionInfo * */ private static void saveProgressBarToCache(HttpSession session, - HashMap progressBarInfo) + Map progressBarInfo) { // cache progress bar info to Session session.setAttribute("submission.progressbar", progressBarInfo); @@ -601,9 +601,9 @@ public class SubmissionInfo * @return progressBarInfo HashMap (if found), or null (if not) * */ - private static HashMap loadProgressBarFromCache(HttpSession session) + private static Map loadProgressBarFromCache(HttpSession session) { - return (HashMap) session.getAttribute("submission.progressbar"); + return (Map) session.getAttribute("submission.progressbar"); } /** diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseDAOOracle.java b/dspace-api/src/main/java/org/dspace/browse/BrowseDAOOracle.java index 258ba09908..c02aea9b3c 100644 --- a/dspace-api/src/main/java/org/dspace/browse/BrowseDAOOracle.java +++ b/dspace-api/src/main/java/org/dspace/browse/BrowseDAOOracle.java @@ -132,8 +132,8 @@ public class BrowseDAOOracle implements BrowseDAO // administrative attributes for this class /** a cache of the actual query to be executed */ - private String querySql = ""; - private ArrayList queryParams = new ArrayList(); + private String querySql = ""; + private List queryParams = new ArrayList(); private String whereClauseOperator = ""; diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseDAOPostgres.java b/dspace-api/src/main/java/org/dspace/browse/BrowseDAOPostgres.java index 00a03c966a..0c97ea7284 100644 --- a/dspace-api/src/main/java/org/dspace/browse/BrowseDAOPostgres.java +++ b/dspace-api/src/main/java/org/dspace/browse/BrowseDAOPostgres.java @@ -132,8 +132,8 @@ public class BrowseDAOPostgres implements BrowseDAO // administrative attributes for this class /** a cache of the actual query to be executed */ - private String querySql = ""; - private ArrayList queryParams = new ArrayList(); + private String querySql = ""; + private List queryParams = new ArrayList(); /** whether the query (above) needs to be regenerated */ private boolean rebuildQuery = true; diff --git a/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java b/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java index 61b080a475..e501b037bf 100644 --- a/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java +++ b/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java @@ -38,6 +38,7 @@ package org.dspace.browse; import java.util.HashMap; +import java.util.Map; import org.dspace.core.ConfigurationManager; @@ -52,7 +53,7 @@ import org.dspace.core.ConfigurationManager; public class CrossLinks { /** a map of the desired links */ - private HashMap links = new HashMap(); + private Map links = new HashMap(); /** * Construct a new object which will obtain the configuration for itself diff --git a/dspace-api/src/main/java/org/dspace/content/ItemIterator.java b/dspace-api/src/main/java/org/dspace/content/ItemIterator.java index 9ae1ccbe90..82651a0028 100644 --- a/dspace-api/src/main/java/org/dspace/content/ItemIterator.java +++ b/dspace-api/src/main/java/org/dspace/content/ItemIterator.java @@ -41,6 +41,7 @@ import java.sql.SQLException; import java.util.Iterator; import java.util.ArrayList; +import java.util.List; import org.dspace.core.Context; import org.dspace.storage.rdbms.TableRow; @@ -97,7 +98,7 @@ public class ItemIterator * @param iids * the array list to be iterated over */ - public ItemIterator(Context context, ArrayList iids) + public ItemIterator(Context context, List iids) { ourContext = context; iditr = iids.iterator(); diff --git a/dspace-api/src/main/java/org/dspace/content/MetadataField.java b/dspace-api/src/main/java/org/dspace/content/MetadataField.java index 5bbf2e70cc..0babe95ba9 100644 --- a/dspace-api/src/main/java/org/dspace/content/MetadataField.java +++ b/dspace-api/src/main/java/org/dspace/content/MetadataField.java @@ -45,6 +45,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.HashMap; +import java.util.Map; import org.apache.log4j.Logger; import org.dspace.authorize.AuthorizeException; @@ -80,7 +81,7 @@ public class MetadataField private TableRow row; // cache of field by ID (Integer) - private static HashMap id2field = null; + private static Map id2field = null; /** diff --git a/dspace-api/src/main/java/org/dspace/content/MetadataSchema.java b/dspace-api/src/main/java/org/dspace/content/MetadataSchema.java index 9e4d2f594a..65d8881bfe 100644 --- a/dspace-api/src/main/java/org/dspace/content/MetadataSchema.java +++ b/dspace-api/src/main/java/org/dspace/content/MetadataSchema.java @@ -45,6 +45,7 @@ import java.sql.SQLException; import java.util.HashMap; import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.apache.log4j.Logger; import org.dspace.authorize.AuthorizeException; @@ -87,10 +88,10 @@ public class MetadataSchema private String name; // cache of schema by ID (Integer) - private static HashMap id2schema = null; + private static Map id2schema = null; // cache of schema by short name - private static HashMap name2schema = null; + private static Map name2schema = null; /** diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java index a117b45362..a3a104ef10 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java @@ -48,6 +48,7 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Properties; import org.apache.log4j.Logger; @@ -159,7 +160,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin private static XMLOutputter outputUgly = new XMLOutputter(); private static SAXBuilder builder = new SAXBuilder(); - private HashMap modsMap = null; + private Map modsMap = null; /** * Container for crosswalk mapping: expressed as "triple" of: diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java index ad3a24f247..b953c830eb 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java @@ -48,6 +48,7 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Properties; import org.apache.log4j.Logger; @@ -128,10 +129,10 @@ public class QDCCrosswalk extends SelfNamedPlugin private static Logger log = Logger.getLogger(QDCCrosswalk.class); // map of qdc to JDOM Element - private HashMap qdc2element = new HashMap(); + private Map qdc2element = new HashMap(); // map of JDOM Element to qdc DCValue - private HashMap element2qdc = new HashMap(); + private Map element2qdc = new HashMap(); // the XML namespaces from config file for this name. private Namespace namespaces[] = null; diff --git a/dspace-api/src/main/java/org/dspace/core/PluginManager.java b/dspace-api/src/main/java/org/dspace/core/PluginManager.java index 0d85019d57..b3fedfbe6d 100755 --- a/dspace-api/src/main/java/org/dspace/core/PluginManager.java +++ b/dspace-api/src/main/java/org/dspace/core/PluginManager.java @@ -112,7 +112,7 @@ public class PluginManager // Map of plugin class to "reusable" metric (as Boolean, must be Object) // Key is Class, value is Boolean (true by default). - private static HashMap cacheMeCache = new HashMap(); + private static Map cacheMeCache = new HashMap(); // Predicate -- whether or not to cache this class. Ironically, // the cacheability information is itself cached. @@ -161,7 +161,7 @@ public class PluginManager // cache of config data for Sequence Plugins; format its // -> [ .. ] (value is Array) - private static HashMap sequenceConfig = new HashMap(); + private static Map sequenceConfig = new HashMap(); /** * Returns instances of all plugins that implement the interface @@ -206,7 +206,7 @@ public class PluginManager } // Map of cached (reusable) single plugin instances - class -> instance. - private static HashMap anonymousInstanceCache = new HashMap(); + private static Map anonymousInstanceCache = new HashMap(); // Get possibly-cached plugin instance for un-named plugin, // this is shared by Single and Sequence plugins. @@ -246,10 +246,10 @@ public class PluginManager // Map of named plugin classes, [intfc,name] -> class // Also contains intfc -> "marker" to mark when interface has been loaded. - private static HashMap namedPluginClasses = new HashMap(); + private static Map namedPluginClasses = new HashMap(); // Map of cached (reusable) named plugin instances, [class,name] -> instance - private static HashMap namedInstanceCache = new HashMap(); + private static Map namedInstanceCache = new HashMap(); // load and cache configuration data for the given interface. private static void configureNamedPlugin(String iname) diff --git a/dspace-api/src/main/java/org/dspace/event/EventManager.java b/dspace-api/src/main/java/org/dspace/event/EventManager.java index bb4c4ecf2c..dbf0ad62cd 100644 --- a/dspace-api/src/main/java/org/dspace/event/EventManager.java +++ b/dspace-api/src/main/java/org/dspace/event/EventManager.java @@ -75,7 +75,7 @@ public class EventManager // Keyed FIFO Pool of event dispatchers private static KeyedObjectPool dispatcherPool = null; - private static HashMap consumerIndicies = null; + private static Map consumerIndicies = null; private static final String CONSUMER_PFX = "event.consumer.";