Remove warnings by generic'ising users of Collections classes

git-svn-id: http://webgoat.googlecode.com/svn/trunk@188 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
rogan.dawes 2007-07-18 13:32:59 +00:00
parent e41a5ca395
commit 9e352396d3
5 changed files with 16 additions and 16 deletions

View File

@ -58,12 +58,12 @@ public class XMLInjection extends LessonAdapter
private final static String ACCOUNTID = "accountID"; private final static String ACCOUNTID = "accountID";
public static HashMap rewardsMap = new HashMap(); public static HashMap<Integer, Reward> rewardsMap = new HashMap<Integer, Reward>();
private final static IMG MAC_LOGO = new IMG("images/logos/macadamian.gif").setAlt( private final static IMG MAC_LOGO = new IMG("images/logos/macadamian.gif").setAlt(
"Macadamian Technologies").setBorder(0).setHspace(0).setVspace(0); "Macadamian Technologies").setBorder(0).setHspace(0).setVspace(0);
protected static HashMap init() protected static HashMap<Integer, Reward> init()
{ {
Reward r = new Reward(); Reward r = new Reward();

View File

@ -35,7 +35,7 @@ import java.util.Map;
public class Authorization public class Authorization
{ {
Map permissions = new Hashtable(); Map<Integer, Integer> permissions = new Hashtable<Integer, Integer>();
public Authorization() public Authorization()

View File

@ -535,7 +535,7 @@ public class ParameterParser
*/ */
public String[] getMissingParameters(String[] requestuired) public String[] getMissingParameters(String[] requestuired)
{ {
Vector missing = new Vector(); Vector<String> missing = new Vector<String>();
for (int i = 0; i < requestuired.length; i++) for (int i = 0; i < requestuired.length; i++)
{ {

View File

@ -50,7 +50,7 @@ public class UserTracker
// FIXME: persist this somehow! // FIXME: persist this somehow!
private static HashMap storage = new HashMap(); private static HashMap<String, HashMap<String, LessonTracker>> storage = new HashMap<String, HashMap<String, LessonTracker>>();
private static MemoryUserDatabase usersDB = new MemoryUserDatabase(); private static MemoryUserDatabase usersDB = new MemoryUserDatabase();
@ -180,7 +180,7 @@ public class UserTracker
public LessonTracker getLessonTracker(WebSession s, String user, public LessonTracker getLessonTracker(WebSession s, String user,
Screen screen) Screen screen)
{ {
HashMap usermap = getUserMap(user); HashMap<String, LessonTracker> usermap = getUserMap(user);
LessonTracker tracker = (LessonTracker) usermap.get(screen.getTitle()); LessonTracker tracker = (LessonTracker) usermap.get(screen.getTitle());
if (tracker == null) if (tracker == null)
{ {
@ -214,15 +214,15 @@ public class UserTracker
* @param userName Description of the Parameter * @param userName Description of the Parameter
* @return The userMap value * @return The userMap value
*/ */
private HashMap getUserMap(String userName) private HashMap<String, LessonTracker> getUserMap(String userName)
{ {
HashMap usermap = (HashMap) storage.get(userName); HashMap<String, LessonTracker> usermap = storage.get(userName);
if (usermap == null) if (usermap == null)
{ {
usermap = new HashMap(); usermap = new HashMap<String, LessonTracker>();
storage.put(userName, usermap); storage.put(userName, usermap);
@ -265,7 +265,7 @@ public class UserTracker
//System.out.println( "User [" + s.getUserName() + "] TRACKER: updating " + screen + " LTH " + tracker.hashCode() ); //System.out.println( "User [" + s.getUserName() + "] TRACKER: updating " + screen + " LTH " + tracker.hashCode() );
tracker.store(s, screen); tracker.store(s, screen);
HashMap usermap = getUserMap(s.getUserName()); HashMap<String, LessonTracker> usermap = getUserMap(s.getUserName());
usermap.put(screen.getTitle(), tracker); usermap.put(screen.getTitle(), tracker);
} }

View File

@ -35,9 +35,9 @@ import java.util.Map;
public class HtmlEncoder public class HtmlEncoder
{ {
static Map e2i = new HashMap(); static Map<String, Integer> e2i = new HashMap<String, Integer>();
static Map i2e = new HashMap(); static Map<Integer, String> i2e = new HashMap<Integer, String>();
// html entity list // html entity list
private static Object[][] entities = { { "quot", new Integer(34) }, // " - double-quote private static Object[][] entities = { { "quot", new Integer(34) }, // " - double-quote
@ -120,9 +120,9 @@ public class HtmlEncoder
public HtmlEncoder() public HtmlEncoder()
{ {
for (int i = 0; i < entities.length; i++) for (int i = 0; i < entities.length; i++)
e2i.put(entities[i][0], entities[i][1]); e2i.put((String)entities[i][0], (Integer)entities[i][1]);
for (int i = 0; i < entities.length; i++) for (int i = 0; i < entities.length; i++)
i2e.put(entities[i][1], entities[i][0]); i2e.put((Integer)entities[i][1], (String)entities[i][0]);
} }
@ -146,7 +146,7 @@ public class HtmlEncoder
{ {
char ch = s1.charAt(i); char ch = s1.charAt(i);
String entity = (String) i2e.get(new Integer((int) ch)); String entity = i2e.get(new Integer((int) ch));
if (entity == null) if (entity == null)
{ {
@ -202,7 +202,7 @@ public class HtmlEncoder
} }
else else
{ {
iso = (Integer) e2i.get(entity); iso = e2i.get(entity);
} }
if (iso == null) if (iso == null)
{ {