@Test(expected = JSONException.class) public void testFromMapWithNullKey() throws Exception { Map<String, String> map = new HashMap<String, String>(); map.put(null, "value"); JSONUtils.fromMap(map); }
public static JSONObject fromMap(Map<String, String> map) throws JSONException { JSONObject json = new JSONObject(); if (map == null) return json; for (Entry<String, String> entry : map.entrySet()) { json.put(entry.getKey(), entry.getValue()); } return json; }
JSONUtils { public static JSONObject fromMap(Map<String, String> map) throws JSONException { JSONObject json = new JSONObject(); if (map == null) return json; for (Entry<String, String> entry : map.entrySet()) { json.put(entry.getKey(), entry.getValue()); } return json; } }
JSONUtils { public static JSONObject fromMap(Map<String, String> map) throws JSONException { JSONObject json = new JSONObject(); if (map == null) return json; for (Entry<String, String> entry : map.entrySet()) { json.put(entry.getKey(), entry.getValue()); } return json; } private  JSONUtils(); }
JSONUtils { public static JSONObject fromMap(Map<String, String> map) throws JSONException { JSONObject json = new JSONObject(); if (map == null) return json; for (Entry<String, String> entry : map.entrySet()) { json.put(entry.getKey(), entry.getValue()); } return json; } private  JSONUtils(); static JObject mapToJSON(Map<String, String> map); static JValue setToJSON(Set<String> set); static JValue filtersToJSON(ResourceListQuery query, ListProvidersService listProvidersService,
          Organization org); static JValue filtersToJSONSeriesWriteAccess(ResourceListQuery query, ListProvidersService listProvidersService,
          Organization org, Map<String, String> series); static JSONObject fromMap(Map<String, String> map); static Map<String, String> toMap(JSONObject json); }
JSONUtils { public static JSONObject fromMap(Map<String, String> map) throws JSONException { JSONObject json = new JSONObject(); if (map == null) return json; for (Entry<String, String> entry : map.entrySet()) { json.put(entry.getKey(), entry.getValue()); } return json; } private  JSONUtils(); static JObject mapToJSON(Map<String, String> map); static JValue setToJSON(Set<String> set); static JValue filtersToJSON(ResourceListQuery query, ListProvidersService listProvidersService,
          Organization org); static JValue filtersToJSONSeriesWriteAccess(ResourceListQuery query, ListProvidersService listProvidersService,
          Organization org, Map<String, String> series); static JSONObject fromMap(Map<String, String> map); static Map<String, String> toMap(JSONObject json);  }