title: How to assign values to a Map in java
body: <p>I get requestParameters Map from my app and assigning it to a different <code>map</code> with some changed values. Basically output I get is</p>
  
  <pre>
  email=a@a.com
  login
  projectname=abc
  </pre>
  
  <p>I want to assign </p>
  
  <pre>
  email=a@a.com
  request=login
  projectname=abc
  </pre>
  
  <p>So i did this</p>
  
  <pre><code>    tempKey=new String[requestParameters.size()];
      tempValue=new String[requestParameters.size()];
      requestParams=new HashMap();
  
      while(iterator.hasNext())
      {
  
          Map.Entry me=(Map.Entry)iterator.next();
          String[] arr=(String[])me.getValue();
  
          if(me.getKey().toString().equalsIgnoreCase("login"))
          {
              tempKey[i]="request";
              tempValue[i]=me.getKey().toString();
  
          }
          else
          {
              tempValue[i]=arr[0];
              tempKey[i]=me.getKey().toString();
          }
  
          requestParams.put(tempKey[i], tempValue[i]);
          log.info(tempKey[i]+"="+tempValue[i]);
          i++;
      }
  </code></pre>
  
  <p>I try to print the values from <code>requestParams</code> like this, but i get nothing</p>
  
  <pre><code>iterator=requestParams.entrySet().iterator();
      while(iterator.hasNext())
      {
  
          Map.Entry me=(Map.Entry)iterator.next();
          String[] arr=(String[])me.getValue();
          log.info(me.getKey().toString()+"="+arr[0]);
      }
  </code></pre>
  
  <p>It correctly prints the <code>log</code> using <code>tempKey[i]+"="+tempValue[i]</code> but it does not assign values to <code>requestParams</code> (modified map), What is wrong in the above code?</p>