mirror of
https://github.com/stleary/JSON-java.git
synced 2026-01-24 00:03:17 -05:00
wildcard generic types, e.g. Collection<?> instead of Collection<Object>. This was proposed by other pull requests (#111, #112) already. Consider this commit as merge with #111 and #112. JSONArray: - put(Collection<?> value) {...} - put(Map<String, ?> value) {...} - put(int index, Collection<?> value) throws JSONException {...} - put(int index, Map<String, ?> value) throws JSONException {...} JSONObject: - put(String key, Collection<?> value) throws JSONException {...} - put(String key, Map<String, ?> value) throws JSONException {...} Changed all code affected by new JSONObject and JSONArray constructors: JSONObject: - valueToString(Object value) throws JSONException { - value instanceof Map - value instanceof Collection } - wrap(Object object) { - value instanceof Map - value instanceof Collection } - writeValue(Writer writer, Object value, int indentFactor, int indent){ - value instanceof Map - value instanceof Collection }
62 KiB
Executable File
62 KiB
Executable File