From 661d8bcf622824057f28208ad5385cd4cb8ec4b5 Mon Sep 17 00:00:00 2001 From: "rogan.dawes" Date: Tue, 10 Jul 2007 11:51:40 +0000 Subject: [PATCH] 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 --- .../org/owasp/webgoat/session/Course.java | 10 +++++----- .../org/owasp/webgoat/session/WebSession.java | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/Course.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/Course.java index 52eba65ec..da7ab99fc 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/Course.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/Course.java @@ -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 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 roles) + public List getLessons(WebSession s, List roles) { if (s.isHackedAdmin()) { roles.add(AbstractLesson.HACKED_ADMIN_ROLE); } - List lessonList = new ArrayList(); + List lessonList = new ArrayList(); 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 getLessons(Category category, List roles) { List lessonList = new ArrayList(); @@ -307,7 +307,7 @@ public class Course } - public List getLessons(WebSession s, Category category, List roles) + public List getLessons(WebSession s, Category category, List roles) { if (s.isHackedAdmin()) { diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/WebSession.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/WebSession.java index 5e389454f..eb85b84aa 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/WebSession.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/session/WebSession.java @@ -181,7 +181,7 @@ public class WebSession private String servletName; - private HashMap session = new HashMap(); + private HashMap session = new HashMap(); private boolean showCookies = false; @@ -290,7 +290,7 @@ public class WebSession return context; } - public List getRoles() + public List getRoles() { List roles = new ArrayList(); @@ -430,7 +430,7 @@ public class WebSession return getCourse().getLesson( this, id, getRoles() ); } - public List getLessons(Category category) + public List getLessons(Category category) { return getCourse().getLessons( this, category, getRoles() ); } @@ -456,13 +456,13 @@ public class WebSession return hint; } - public List getParams() + public List getParams() { - Vector params = null; + Vector params = null; if ( showParams() && getParser() != null ) { - params = new Vector(); + params = new Vector(); Enumeration e = getParser().getParameterNames(); @@ -655,7 +655,7 @@ public class WebSession return ( isAuthenticated ); } - private Map lessonSessions = new Hashtable(); + private Map lessonSessions = new Hashtable(); public boolean isAuthenticatedInLesson(AbstractLesson lesson)