mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 06:23:10 +00:00
[DS-707] Try to use cached instances of boxed primitives.
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5493 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -402,7 +402,7 @@ public class BrowseCreateDAOOracle implements BrowseCreateDAO
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(itemID) };
|
Object[] params = { Integer.valueOf(itemID) };
|
||||||
String dquery = "DELETE FROM " + table + " WHERE item_id=?";
|
String dquery = "DELETE FROM " + table + " WHERE item_id=?";
|
||||||
DatabaseManager.updateQuery(context, dquery, params);
|
DatabaseManager.updateQuery(context, dquery, params);
|
||||||
}
|
}
|
||||||
@@ -422,7 +422,7 @@ public class BrowseCreateDAOOracle implements BrowseCreateDAO
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(itemID) };
|
Object[] params = { Integer.valueOf(itemID) };
|
||||||
String dquery = "DELETE FROM Communities2Item WHERE item_id = ?";
|
String dquery = "DELETE FROM Communities2Item WHERE item_id = ?";
|
||||||
DatabaseManager.updateQuery(context, dquery, params);
|
DatabaseManager.updateQuery(context, dquery, params);
|
||||||
}
|
}
|
||||||
|
@@ -406,7 +406,7 @@ public class BrowseCreateDAOPostgres implements BrowseCreateDAO
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(itemID) };
|
Object[] params = { Integer.valueOf(itemID) };
|
||||||
String dquery = "DELETE FROM " + table + " WHERE item_id = ?";
|
String dquery = "DELETE FROM " + table + " WHERE item_id = ?";
|
||||||
DatabaseManager.updateQuery(context, dquery, params);
|
DatabaseManager.updateQuery(context, dquery, params);
|
||||||
}
|
}
|
||||||
@@ -425,7 +425,7 @@ public class BrowseCreateDAOPostgres implements BrowseCreateDAO
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(itemID) };
|
Object[] params = { Integer.valueOf(itemID) };
|
||||||
String dquery = "DELETE FROM Communities2Item WHERE item_id = ?";
|
String dquery = "DELETE FROM Communities2Item WHERE item_id = ?";
|
||||||
DatabaseManager.updateQuery(context, dquery, params);
|
DatabaseManager.updateQuery(context, dquery, params);
|
||||||
}
|
}
|
||||||
|
@@ -210,7 +210,7 @@ public class BrowseDAOOracle implements BrowseDAO
|
|||||||
{
|
{
|
||||||
String query = "SELECT MAX(" + column + ") AS max_value FROM " + table + " WHERE item_id=?";
|
String query = "SELECT MAX(" + column + ") AS max_value FROM " + table + " WHERE item_id=?";
|
||||||
|
|
||||||
Object[] params = { new Integer(itemID) };
|
Object[] params = { Integer.valueOf(itemID) };
|
||||||
tri = DatabaseManager.query(context, query, params);
|
tri = DatabaseManager.query(context, query, params);
|
||||||
|
|
||||||
TableRow row;
|
TableRow row;
|
||||||
@@ -886,16 +886,16 @@ public class BrowseDAOOracle implements BrowseDAO
|
|||||||
{
|
{
|
||||||
queryBuf.append("rec WHERE rownum<=? ");
|
queryBuf.append("rec WHERE rownum<=? ");
|
||||||
if (offset > 0)
|
if (offset > 0)
|
||||||
params.add(new Integer(limit + offset));
|
params.add(Integer.valueOf(limit + offset));
|
||||||
else
|
else
|
||||||
params.add(new Integer(limit));
|
params.add(Integer.valueOf(limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (offset > 0)
|
if (offset > 0)
|
||||||
{
|
{
|
||||||
queryBuf.insert(0, "SELECT * FROM (");
|
queryBuf.insert(0, "SELECT * FROM (");
|
||||||
queryBuf.append(") WHERE rnum>?");
|
queryBuf.append(") WHERE rnum>?");
|
||||||
params.add(new Integer(offset));
|
params.add(Integer.valueOf(offset));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -964,7 +964,7 @@ public class BrowseDAOOracle implements BrowseDAO
|
|||||||
queryBuf.append(containerTable).append(".").append(containerIDField);
|
queryBuf.append(containerTable).append(".").append(containerIDField);
|
||||||
queryBuf.append("=? ");
|
queryBuf.append("=? ");
|
||||||
|
|
||||||
params.add(new Integer(containerID));
|
params.add(Integer.valueOf(containerID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -216,7 +216,7 @@ public class BrowseDAOPostgres implements BrowseDAO
|
|||||||
{
|
{
|
||||||
String query = "SELECT max(" + column + ") FROM " + table + " WHERE item_id = ?";
|
String query = "SELECT max(" + column + ") FROM " + table + " WHERE item_id = ?";
|
||||||
|
|
||||||
Object[] params = { new Integer(itemID) };
|
Object[] params = { Integer.valueOf(itemID) };
|
||||||
tri = DatabaseManager.query(context, query, params);
|
tri = DatabaseManager.query(context, query, params);
|
||||||
|
|
||||||
TableRow row;
|
TableRow row;
|
||||||
@@ -890,7 +890,7 @@ public class BrowseDAOPostgres implements BrowseDAO
|
|||||||
{
|
{
|
||||||
queryBuf.append(" LIMIT ? ");
|
queryBuf.append(" LIMIT ? ");
|
||||||
|
|
||||||
params.add(new Integer(limit));
|
params.add(Integer.valueOf(limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare the OFFSET clause
|
// prepare the OFFSET clause
|
||||||
@@ -898,7 +898,7 @@ public class BrowseDAOPostgres implements BrowseDAO
|
|||||||
{
|
{
|
||||||
queryBuf.append(" OFFSET ? ");
|
queryBuf.append(" OFFSET ? ");
|
||||||
|
|
||||||
params.add(new Integer(offset));
|
params.add(Integer.valueOf(offset));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -968,7 +968,7 @@ public class BrowseDAOPostgres implements BrowseDAO
|
|||||||
queryBuf.append(containerTable).append(".").append(containerIDField);
|
queryBuf.append(containerTable).append(".").append(containerIDField);
|
||||||
queryBuf.append("=? ");
|
queryBuf.append("=? ");
|
||||||
|
|
||||||
params.add(new Integer(containerID));
|
params.add(Integer.valueOf(containerID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -124,17 +124,17 @@ public class BrowseItemDAOOracle implements BrowseItemDAO
|
|||||||
{
|
{
|
||||||
if (qualifier == null)
|
if (qualifier == null)
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(itemId), element, schema };
|
Object[] params = { Integer.valueOf(itemId), element, schema };
|
||||||
tri = DatabaseManager.query(context, getByMetadataElement, params);
|
tri = DatabaseManager.query(context, getByMetadataElement, params);
|
||||||
}
|
}
|
||||||
else if (Item.ANY.equals(qualifier))
|
else if (Item.ANY.equals(qualifier))
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(itemId), element, schema };
|
Object[] params = { Integer.valueOf(itemId), element, schema };
|
||||||
tri = DatabaseManager.query(context, getByMetadataAnyQualifier, params);
|
tri = DatabaseManager.query(context, getByMetadataAnyQualifier, params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(itemId), element, qualifier, schema };
|
Object[] params = { Integer.valueOf(itemId), element, qualifier, schema };
|
||||||
tri = DatabaseManager.query(context, getByMetadata, params);
|
tri = DatabaseManager.query(context, getByMetadata, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -123,17 +123,17 @@ public class BrowseItemDAOPostgres implements BrowseItemDAO
|
|||||||
{
|
{
|
||||||
if (qualifier == null)
|
if (qualifier == null)
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(itemId), element, schema };
|
Object[] params = { Integer.valueOf(itemId), element, schema };
|
||||||
tri = DatabaseManager.query(context, getByMetadataElement, params);
|
tri = DatabaseManager.query(context, getByMetadataElement, params);
|
||||||
}
|
}
|
||||||
else if (Item.ANY.equals(qualifier))
|
else if (Item.ANY.equals(qualifier))
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(itemId), element, schema };
|
Object[] params = { Integer.valueOf(itemId), element, schema };
|
||||||
tri = DatabaseManager.query(context, getByMetadataAnyQualifier, params);
|
tri = DatabaseManager.query(context, getByMetadataAnyQualifier, params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(itemId), element, qualifier, schema };
|
Object[] params = { Integer.valueOf(itemId), element, qualifier, schema };
|
||||||
tri = DatabaseManager.query(context, getByMetadata, params);
|
tri = DatabaseManager.query(context, getByMetadata, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -535,7 +535,7 @@ public class IndexBrowse
|
|||||||
Map<Integer, String> sortMap = new HashMap<Integer, String>();
|
Map<Integer, String> sortMap = new HashMap<Integer, String>();
|
||||||
for (SortOption so : SortOption.getSortOptions())
|
for (SortOption so : SortOption.getSortOptions())
|
||||||
{
|
{
|
||||||
Integer key = new Integer(so.getNumber());
|
Integer key = Integer.valueOf(so.getNumber());
|
||||||
String metadata = so.getMetadata();
|
String metadata = so.getMetadata();
|
||||||
|
|
||||||
// If we've already used the metadata for this Item
|
// If we've already used the metadata for this Item
|
||||||
@@ -958,7 +958,7 @@ public class IndexBrowse
|
|||||||
List<Integer> sortCols = new ArrayList<Integer>();
|
List<Integer> sortCols = new ArrayList<Integer>();
|
||||||
for (SortOption so : SortOption.getSortOptions())
|
for (SortOption so : SortOption.getSortOptions())
|
||||||
{
|
{
|
||||||
sortCols.add(new Integer(so.getNumber()));
|
sortCols.add(Integer.valueOf(so.getNumber()));
|
||||||
}
|
}
|
||||||
|
|
||||||
createItemTables(BrowseIndex.getItemBrowseIndex(), sortCols);
|
createItemTables(BrowseIndex.getItemBrowseIndex(), sortCols);
|
||||||
|
@@ -98,17 +98,17 @@ public class ItemCountDAOOracle implements ItemCountDAO
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// first find out if we have a record
|
// first find out if we have a record
|
||||||
Object[] sparams = { new Integer(collection.getID()) };
|
Object[] sparams = { Integer.valueOf(collection.getID()) };
|
||||||
tri = DatabaseManager.query(context, collectionSelect, sparams);
|
tri = DatabaseManager.query(context, collectionSelect, sparams);
|
||||||
|
|
||||||
if (tri.hasNext())
|
if (tri.hasNext())
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(count), new Integer(collection.getID()) };
|
Object[] params = { Integer.valueOf(count), Integer.valueOf(collection.getID()) };
|
||||||
DatabaseManager.updateQuery(context, collectionUpdate, params);
|
DatabaseManager.updateQuery(context, collectionUpdate, params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(collection.getID()), new Integer(count) };
|
Object[] params = { Integer.valueOf(collection.getID()), Integer.valueOf(count) };
|
||||||
DatabaseManager.updateQuery(context, collectionInsert, params);
|
DatabaseManager.updateQuery(context, collectionInsert, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,17 +138,17 @@ public class ItemCountDAOOracle implements ItemCountDAO
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// first find out if we have a record
|
// first find out if we have a record
|
||||||
Object[] sparams = { new Integer(community.getID()) };
|
Object[] sparams = { Integer.valueOf(community.getID()) };
|
||||||
tri = DatabaseManager.query(context, communitySelect, sparams);
|
tri = DatabaseManager.query(context, communitySelect, sparams);
|
||||||
|
|
||||||
if (tri.hasNext())
|
if (tri.hasNext())
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(count), new Integer(community.getID()) };
|
Object[] params = { Integer.valueOf(count), Integer.valueOf(community.getID()) };
|
||||||
DatabaseManager.updateQuery(context, communityUpdate, params);
|
DatabaseManager.updateQuery(context, communityUpdate, params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(community.getID()), new Integer(count) };
|
Object[] params = { Integer.valueOf(community.getID()), Integer.valueOf(count) };
|
||||||
DatabaseManager.updateQuery(context, communityInsert, params);
|
DatabaseManager.updateQuery(context, communityInsert, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,7 +233,7 @@ public class ItemCountDAOOracle implements ItemCountDAO
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(collection.getID()) };
|
Object[] params = { Integer.valueOf(collection.getID()) };
|
||||||
DatabaseManager.updateQuery(context, collectionRemove, params);
|
DatabaseManager.updateQuery(context, collectionRemove, params);
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
@@ -254,7 +254,7 @@ public class ItemCountDAOOracle implements ItemCountDAO
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(community.getID()) };
|
Object[] params = { Integer.valueOf(community.getID()) };
|
||||||
DatabaseManager.updateQuery(context, communityRemove, params);
|
DatabaseManager.updateQuery(context, communityRemove, params);
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
@@ -277,7 +277,7 @@ public class ItemCountDAOOracle implements ItemCountDAO
|
|||||||
TableRowIterator tri = null;
|
TableRowIterator tri = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(collection.getID()) };
|
Object[] params = { Integer.valueOf(collection.getID()) };
|
||||||
tri = DatabaseManager.query(context, collectionSelect, params);
|
tri = DatabaseManager.query(context, collectionSelect, params);
|
||||||
|
|
||||||
if (!tri.hasNext())
|
if (!tri.hasNext())
|
||||||
@@ -319,7 +319,7 @@ public class ItemCountDAOOracle implements ItemCountDAO
|
|||||||
TableRowIterator tri = null;
|
TableRowIterator tri = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(community.getID()) };
|
Object[] params = { Integer.valueOf(community.getID()) };
|
||||||
tri = DatabaseManager.query(context, communitySelect, params);
|
tri = DatabaseManager.query(context, communitySelect, params);
|
||||||
|
|
||||||
if (!tri.hasNext())
|
if (!tri.hasNext())
|
||||||
|
@@ -98,17 +98,17 @@ public class ItemCountDAOPostgres implements ItemCountDAO
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// first find out if we have a record
|
// first find out if we have a record
|
||||||
Object[] sparams = { new Integer(collection.getID()) };
|
Object[] sparams = { Integer.valueOf(collection.getID()) };
|
||||||
tri = DatabaseManager.query(context, collectionSelect, sparams);
|
tri = DatabaseManager.query(context, collectionSelect, sparams);
|
||||||
|
|
||||||
if (tri.hasNext())
|
if (tri.hasNext())
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(count), new Integer(collection.getID()) };
|
Object[] params = { Integer.valueOf(count), Integer.valueOf(collection.getID()) };
|
||||||
DatabaseManager.updateQuery(context, collectionUpdate, params);
|
DatabaseManager.updateQuery(context, collectionUpdate, params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(collection.getID()), new Integer(count) };
|
Object[] params = { Integer.valueOf(collection.getID()), Integer.valueOf(count) };
|
||||||
DatabaseManager.updateQuery(context, collectionInsert, params);
|
DatabaseManager.updateQuery(context, collectionInsert, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,17 +138,17 @@ public class ItemCountDAOPostgres implements ItemCountDAO
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// first find out if we have a record
|
// first find out if we have a record
|
||||||
Object[] sparams = { new Integer(community.getID()) };
|
Object[] sparams = { Integer.valueOf(community.getID()) };
|
||||||
tri = DatabaseManager.query(context, communitySelect, sparams);
|
tri = DatabaseManager.query(context, communitySelect, sparams);
|
||||||
|
|
||||||
if (tri.hasNext())
|
if (tri.hasNext())
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(count), new Integer(community.getID()) };
|
Object[] params = { Integer.valueOf(count), Integer.valueOf(community.getID()) };
|
||||||
DatabaseManager.updateQuery(context, communityUpdate, params);
|
DatabaseManager.updateQuery(context, communityUpdate, params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(community.getID()), new Integer(count) };
|
Object[] params = { Integer.valueOf(community.getID()), Integer.valueOf(count) };
|
||||||
DatabaseManager.updateQuery(context, communityInsert, params);
|
DatabaseManager.updateQuery(context, communityInsert, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,7 +233,7 @@ public class ItemCountDAOPostgres implements ItemCountDAO
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(collection.getID()) };
|
Object[] params = { Integer.valueOf(collection.getID()) };
|
||||||
DatabaseManager.updateQuery(context, collectionRemove, params);
|
DatabaseManager.updateQuery(context, collectionRemove, params);
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
@@ -254,7 +254,7 @@ public class ItemCountDAOPostgres implements ItemCountDAO
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(community.getID()) };
|
Object[] params = { Integer.valueOf(community.getID()) };
|
||||||
DatabaseManager.updateQuery(context, communityRemove, params);
|
DatabaseManager.updateQuery(context, communityRemove, params);
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
@@ -277,7 +277,7 @@ public class ItemCountDAOPostgres implements ItemCountDAO
|
|||||||
TableRowIterator tri = null;
|
TableRowIterator tri = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(collection.getID()) };
|
Object[] params = { Integer.valueOf(collection.getID()) };
|
||||||
tri = DatabaseManager.query(context, collectionSelect, params);
|
tri = DatabaseManager.query(context, collectionSelect, params);
|
||||||
|
|
||||||
if (!tri.hasNext())
|
if (!tri.hasNext())
|
||||||
@@ -319,7 +319,7 @@ public class ItemCountDAOPostgres implements ItemCountDAO
|
|||||||
TableRowIterator tri = null;
|
TableRowIterator tri = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object[] params = { new Integer(community.getID()) };
|
Object[] params = { Integer.valueOf(community.getID()) };
|
||||||
tri = DatabaseManager.query(context, communitySelect, params);
|
tri = DatabaseManager.query(context, communitySelect, params);
|
||||||
|
|
||||||
if (!tri.hasNext())
|
if (!tri.hasNext())
|
||||||
|
@@ -83,18 +83,18 @@ public class ItemListConfig
|
|||||||
int i = 1;
|
int i = 1;
|
||||||
while (st.hasMoreTokens())
|
while (st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
Integer key = new Integer(i);
|
Integer key = Integer.valueOf(i);
|
||||||
String token = st.nextToken();
|
String token = st.nextToken();
|
||||||
|
|
||||||
// find out if the field is a date
|
// find out if the field is a date
|
||||||
if (token.indexOf("(date)") > 0)
|
if (token.indexOf("(date)") > 0)
|
||||||
{
|
{
|
||||||
token = token.replaceAll("\\(date\\)", "");
|
token = token.replaceAll("\\(date\\)", "");
|
||||||
types.put(key, new Integer(ItemListConfig.DATE));
|
types.put(key, Integer.valueOf(ItemListConfig.DATE));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
types.put(key, new Integer(ItemListConfig.TEXT));
|
types.put(key, Integer.valueOf(ItemListConfig.TEXT));
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] mdBits = interpretField(token.trim(), null);
|
String[] mdBits = interpretField(token.trim(), null);
|
||||||
@@ -128,7 +128,7 @@ public class ItemListConfig
|
|||||||
*/
|
*/
|
||||||
public String[] getMetadata(int col)
|
public String[] getMetadata(int col)
|
||||||
{
|
{
|
||||||
return (String[]) metadata.get(new Integer(col));
|
return (String[]) metadata.get(Integer.valueOf(col));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user