I am wondering about the performance of Java HashMap vs JSONObject.
It seems JSONObject stores data internally using HashMap. But JSONObject might have additional overhead compared to HashMap.
Does any one know ...
I found out that since JSON doesn't make a difference between hashes and objects, I can bypass the "law" of always sticking to dto classes, and instead return an "on-the-fly" hashmap, ...
JSONObject is complaining that the keys in the map you supplied are not of type String. It requires the keys to be strings. Of what class are the keys in mp? If you're not sure, add after the third line: Class clazz = mp.keySet().iterator().next().getClass(); // assert !mp.isEmpty() System.out.println(clazz); // hopefully you have access to stdout from tomcat. otherwise, print to the ...