mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
[DS-707] Generify List usage
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5600 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -57,17 +57,17 @@ public class DCInputSet
|
||||
private DCInput[][] inputPages = null;
|
||||
|
||||
/** constructor */
|
||||
public DCInputSet(String formName, List pages, Map listMap)
|
||||
public DCInputSet(String formName, List<List<Map<String, String>>> pages, Map<String, List<String>> listMap)
|
||||
{
|
||||
this.formName = formName;
|
||||
inputPages = new DCInput[pages.size()][];
|
||||
for ( int i = 0; i < inputPages.length; i++ )
|
||||
{
|
||||
List page = (List)pages.get(i);
|
||||
List<Map<String, String>> page = pages.get(i);
|
||||
inputPages[i] = new DCInput[page.size()];
|
||||
for ( int j = 0; j < inputPages[i].length; j++ )
|
||||
{
|
||||
inputPages[i][j] = new DCInput((Map)page.get(j), listMap);
|
||||
inputPages[i][j] = new DCInput(page.get(j), listMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public class DCInputSet
|
||||
public DCInput[] getPageRows(int pageNum, boolean addTitleAlternative,
|
||||
boolean addPublishedBefore)
|
||||
{
|
||||
List filteredInputs = new ArrayList();
|
||||
List<DCInput> filteredInputs = new ArrayList<DCInput>();
|
||||
if ( pageNum < inputPages.length )
|
||||
{
|
||||
for (int i = 0; i < inputPages[pageNum].length; i++ )
|
||||
@@ -118,7 +118,7 @@ public class DCInputSet
|
||||
|
||||
// Convert list into an array
|
||||
DCInput[] inputArray = new DCInput[filteredInputs.size()];
|
||||
return (DCInput[])filteredInputs.toArray(inputArray);
|
||||
return filteredInputs.toArray(inputArray);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -42,6 +42,7 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.core.Context;
|
||||
@@ -303,7 +304,7 @@ public class AuthenticationManager
|
||||
HttpServletRequest request)
|
||||
throws SQLException
|
||||
{
|
||||
ArrayList gll = new ArrayList();
|
||||
List<int[]> gll = new ArrayList<int[]>();
|
||||
int totalLen = 0;
|
||||
|
||||
for (int i = 0; i < methodStack.length; ++i)
|
||||
@@ -325,7 +326,7 @@ public class AuthenticationManager
|
||||
}
|
||||
else if (gll.size() == 1)
|
||||
{
|
||||
return (int[]) gll.get(0);
|
||||
return gll.get(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -335,7 +336,7 @@ public class AuthenticationManager
|
||||
int k = 0;
|
||||
for (int i = 0; i < gll.size(); ++i)
|
||||
{
|
||||
int gl[] = (int [])gll.get(i);
|
||||
int gl[] = gll.get(i);
|
||||
for (int aGl : gl)
|
||||
{
|
||||
result[k++] = aGl;
|
||||
@@ -352,7 +353,7 @@ public class AuthenticationManager
|
||||
*
|
||||
* @return Iterator object.
|
||||
*/
|
||||
public static Iterator authenticationMethodIterator()
|
||||
public static Iterator<AuthenticationMethod> authenticationMethodIterator()
|
||||
{
|
||||
return Arrays.asList(methodStack).iterator();
|
||||
}
|
||||
|
@@ -542,7 +542,7 @@ public class AuthorizeManager
|
||||
"SELECT * FROM resourcepolicy WHERE resource_type_id= ? AND resource_id= ? ",
|
||||
o.getType(),o.getID());
|
||||
|
||||
List<ResourcePolicy> policies = new ArrayList();
|
||||
List<ResourcePolicy> policies = new ArrayList<ResourcePolicy>();
|
||||
|
||||
try
|
||||
{
|
||||
|
@@ -68,7 +68,7 @@ public class AuthenticationCountSelector implements Selector{
|
||||
*/
|
||||
public boolean select(String expression, Map objectModel, Parameters parameters) {
|
||||
// get an iterator of all the AuthenticationMethods defined
|
||||
final Iterator<AuthenticationMethod> authMethods = (Iterator<AuthenticationMethod>) AuthenticationManager
|
||||
final Iterator<AuthenticationMethod> authMethods = AuthenticationManager
|
||||
.authenticationMethodIterator();
|
||||
|
||||
final HttpServletResponse httpResponse = (HttpServletResponse) objectModel
|
||||
|
@@ -74,7 +74,7 @@ public class LoginRedirect extends AbstractAction {
|
||||
.get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
|
||||
final HttpServletRequest httpRequest = (HttpServletRequest) objectModel
|
||||
.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
|
||||
final Iterator<AuthenticationMethod> authMethods = (Iterator<AuthenticationMethod>) AuthenticationManager
|
||||
final Iterator<AuthenticationMethod> authMethods = AuthenticationManager
|
||||
.authenticationMethodIterator();
|
||||
|
||||
if (authMethods == null)
|
||||
|
Reference in New Issue
Block a user