The code below produces the following compiler warning:
JSONObject obj = new JSONObject();
obj.put("foo", "bar");
Compiler message:
unchecked call to put(K,V) as a member of the raw type java.util.HashMap
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).
The JSONObject is from the following library.
import org.json.simple.JSONObject;
Maven dependency:
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
JSONObject
from?