Various type safety fixes (converting to generics)

This appears to have fixed a possible bug, so is a good thing


git-svn-id: http://webgoat.googlecode.com/svn/trunk@142 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
rogan.dawes 2007-07-10 11:51:40 +00:00
parent eaf12c706c
commit 661d8bcf62
2 changed files with 12 additions and 12 deletions

View File

@ -205,7 +205,7 @@ public class Course
* @param role Description of the Parameter
* @return The lesson value
*/
public AbstractLesson getLesson(WebSession s, int lessonId, List roles)
public AbstractLesson getLesson(WebSession s, int lessonId, List<String> roles)
{
if (s.isHackedAdmin())
{
@ -252,13 +252,13 @@ public class Course
* @param role Description of the Parameter
* @return The lessons value
*/
public List getLessons(WebSession s, List<String> roles)
public List<AbstractLesson> getLessons(WebSession s, List<String> roles)
{
if (s.isHackedAdmin())
{
roles.add(AbstractLesson.HACKED_ADMIN_ROLE);
}
List<String> lessonList = new ArrayList<String>();
List<AbstractLesson> lessonList = new ArrayList<AbstractLesson>();
Iterator categoryIter = getCategories().iterator();
while (categoryIter.hasNext())
@ -277,7 +277,7 @@ public class Course
* @param role Description of the Parameter
* @return The lessons value
*/
private List getLessons(Category category, List roles)
private List<AbstractLesson> getLessons(Category category, List roles)
{
List<AbstractLesson> lessonList = new ArrayList<AbstractLesson>();
@ -307,7 +307,7 @@ public class Course
}
public List getLessons(WebSession s, Category category, List<String> roles)
public List<AbstractLesson> getLessons(WebSession s, Category category, List<String> roles)
{
if (s.isHackedAdmin())
{

View File

@ -181,7 +181,7 @@ public class WebSession
private String servletName;
private HashMap session = new HashMap();
private HashMap<String,Object> session = new HashMap<String, Object>();
private boolean showCookies = false;
@ -290,7 +290,7 @@ public class WebSession
return context;
}
public List getRoles()
public List<String> getRoles()
{
List<String> roles = new ArrayList<String>();
@ -430,7 +430,7 @@ public class WebSession
return getCourse().getLesson( this, id, getRoles() );
}
public List getLessons(Category category)
public List<AbstractLesson> getLessons(Category category)
{
return getCourse().getLessons( this, category, getRoles() );
}
@ -456,13 +456,13 @@ public class WebSession
return hint;
}
public List getParams()
public List<Parameter> getParams()
{
Vector params = null;
Vector<Parameter> params = null;
if ( showParams() && getParser() != null )
{
params = new Vector();
params = new Vector<Parameter>();
Enumeration e = getParser().getParameterNames();
@ -655,7 +655,7 @@ public class WebSession
return ( isAuthenticated );
}
private Map lessonSessions = new Hashtable();
private Map<AbstractLesson, LessonSession> lessonSessions = new Hashtable<AbstractLesson, LessonSession>();
public boolean isAuthenticatedInLesson(AbstractLesson lesson)