开发者

warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable [duplicate]

This question already has answers here: Closed 11 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜