-5

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 from 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

Community
  • 1
  • 1
majda
  • 1
  • 1
  • 4

1 Answers1

1

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.

rossum
  • 15,344
  • 1
  • 24
  • 38
  • how to change my compiler settings to add the "-Xlint" parameter, i travel with netbeans 6.9.1 ??? – majda Aug 22 '11 at 17:33
  • You need to get to the "Project Properties" window in your version of NetBeans. Look in the help for your version (it moves around the menu tree in different versions). Select Build/Compile in the option tree. Enter the option you want in the "Compiler Options" text box: "-Xlint" – rossum Aug 22 '11 at 17:49
  • thank you, but i have another warnning : warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable localParams.put(key, value); ^ – majda Aug 22 '11 at 17:57
  • and the second warning : warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable localParams.put(name, values); ^ – majda Aug 22 '11 at 17:58
  • pleeez, can you help me , i have this warning : warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable localParams.put(key, value); ^ – majda Aug 22 '11 at 18:04
  • This is the code : if (localParams == null) { localParams = new Hashtable(); // Copy the parameters from 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); – majda Aug 22 '11 at 21:56
  • The First Warning is : HELPDESKGESTION\src\java\glpi\filter\LoginFilter.java:329: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable localParams.put(key, value); ^ – majda Sep 26 '11 at 16:04