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:
parent
e41a5ca395
commit
9e352396d3
@ -58,12 +58,12 @@ public class XMLInjection extends LessonAdapter
|
||||
|
||||
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(
|
||||
"Macadamian Technologies").setBorder(0).setHspace(0).setVspace(0);
|
||||
|
||||
protected static HashMap init()
|
||||
protected static HashMap<Integer, Reward> init()
|
||||
{
|
||||
Reward r = new Reward();
|
||||
|
||||
|
@ -35,7 +35,7 @@ import java.util.Map;
|
||||
public class Authorization
|
||||
{
|
||||
|
||||
Map permissions = new Hashtable();
|
||||
Map<Integer, Integer> permissions = new Hashtable<Integer, Integer>();
|
||||
|
||||
|
||||
public Authorization()
|
||||
|
@ -535,7 +535,7 @@ public class ParameterParser
|
||||
*/
|
||||
public String[] getMissingParameters(String[] requestuired)
|
||||
{
|
||||
Vector missing = new Vector();
|
||||
Vector<String> missing = new Vector<String>();
|
||||
|
||||
for (int i = 0; i < requestuired.length; i++)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ public class UserTracker
|
||||
|
||||
// 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();
|
||||
|
||||
@ -180,7 +180,7 @@ public class UserTracker
|
||||
public LessonTracker getLessonTracker(WebSession s, String user,
|
||||
Screen screen)
|
||||
{
|
||||
HashMap usermap = getUserMap(user);
|
||||
HashMap<String, LessonTracker> usermap = getUserMap(user);
|
||||
LessonTracker tracker = (LessonTracker) usermap.get(screen.getTitle());
|
||||
if (tracker == null)
|
||||
{
|
||||
@ -214,15 +214,15 @@ public class UserTracker
|
||||
* @param userName Description of the Parameter
|
||||
* @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)
|
||||
{
|
||||
|
||||
usermap = new HashMap();
|
||||
usermap = new HashMap<String, LessonTracker>();
|
||||
|
||||
storage.put(userName, usermap);
|
||||
|
||||
@ -265,7 +265,7 @@ public class UserTracker
|
||||
//System.out.println( "User [" + s.getUserName() + "] TRACKER: updating " + screen + " LTH " + tracker.hashCode() );
|
||||
tracker.store(s, screen);
|
||||
|
||||
HashMap usermap = getUserMap(s.getUserName());
|
||||
HashMap<String, LessonTracker> usermap = getUserMap(s.getUserName());
|
||||
usermap.put(screen.getTitle(), tracker);
|
||||
|
||||
}
|
||||
|
@ -35,9 +35,9 @@ import java.util.Map;
|
||||
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
|
||||
private static Object[][] entities = { { "quot", new Integer(34) }, // " - double-quote
|
||||
@ -120,9 +120,9 @@ public class HtmlEncoder
|
||||
public HtmlEncoder()
|
||||
{
|
||||
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++)
|
||||
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);
|
||||
|
||||
String entity = (String) i2e.get(new Integer((int) ch));
|
||||
String entity = i2e.get(new Integer((int) ch));
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
@ -202,7 +202,7 @@ public class HtmlEncoder
|
||||
}
|
||||
else
|
||||
{
|
||||
iso = (Integer) e2i.get(entity);
|
||||
iso = e2i.get(entity);
|
||||
}
|
||||
if (iso == null)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user