diff --git a/JSONArray.java b/JSONArray.java index b2717d9..3605411 100644 --- a/JSONArray.java +++ b/JSONArray.java @@ -151,10 +151,10 @@ public class JSONArray implements Iterable { * @param collection * A Collection. */ - public JSONArray(Collection collection) { + public JSONArray(Collection collection) { this.myArrayList = new ArrayList(); if (collection != null) { - Iterator iter = collection.iterator(); + Iterator iter = collection.iterator(); while (iter.hasNext()) { this.myArrayList.add(JSONObject.wrap(iter.next())); } diff --git a/JSONObject.java b/JSONObject.java index ed1159e..5d17cc7 100755 --- a/JSONObject.java +++ b/JSONObject.java @@ -243,12 +243,14 @@ public class JSONObject { * the JSONObject. * @throws JSONException */ - public JSONObject(Map map) { + public JSONObject(Map map) { this.map = new HashMap(); if (map != null) { - Iterator> i = map.entrySet().iterator(); + Set eSet = map.entrySet(); + @SuppressWarnings("unchecked") + Iterator> i = (Iterator>) eSet.iterator(); while (i.hasNext()) { - Entry entry = i.next(); + Entry entry = i.next(); Object value = entry.getValue(); if (value != null) { this.map.put(entry.getKey(), wrap(value));