warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable [duplicate]
Possible Duplicate:
What causes javac to issue the "uses unchecked or unsafe operations" warning
public void setParameter(String name, String []values) {
if (debug) System.out.println("LoginFilter::setParameter(" + name + "=" + values + ")" + " localParams = "+ localParams);
if (localParams == null) {
localParams = new Hashtable();
// Copy the parameters f开发者_高级运维rom the underlying request.
Map wrappedParams = getRequest().getParameterMap();
Set keySet = wrappedParams.keySet();
for (Iterator it = keySet.iterator(); it.hasNext(); ) {
Object key = it.next();
Object value = wrappedParams.get(key);
localParams.put(key, value);
/*localParams.put(key, value);*/
}
}
localParams.put(name, values);
}
the warnins is :
1) warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable localParams.put(key, value);
2) warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable localParams.put(name, values); ^
please help me to solve this problem
You need to change your compiler settings to add the "-Xlint" parameter. Then recompile your code. Then examine the additional error messages you will get as output. They will point you at the place(s) in your code where you have made errors.
精彩评论