title: JSONObject unchecked call to put(K,V) as a member of the raw type java.util.HashMap
body: <p>The code below produces the following compiler warning:</p>
  
  <pre><code>JSONObject obj = new JSONObject();
  obj.put("foo", "bar");
  </code></pre>
  
  <p>Compiler message:</p>
  
  <blockquote>
    <p>unchecked call to put(K,V) as a member of the raw type
    java.util.HashMap</p>
  </blockquote>
  
  <p>I populate the JSONObject with values via JSONObject.put() and then call obj.toString() to get the json out. How can I fix the warning above (I compile with -Werror).</p>
  
  <p>The JSONObject is from the following library.</p>
  
  <pre><code>import org.json.simple.JSONObject;
  </code></pre>
  
  <p>Maven dependency:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt;
      &lt;artifactId&gt;json-simple&lt;/artifactId&gt;
      &lt;version&gt;1.1.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>