We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3645f91 commit 2fbe4d9Copy full SHA for 2fbe4d9
JSONObject.java
@@ -250,8 +250,10 @@ public JSONObject(JSONTokener x) throws JSONException {
250
* the JSONObject.
251
*/
252
public JSONObject(Map<?, ?> m) {
253
- this.map = new HashMap<String, Object>(m == null ? 0 : m.size());
254
- if (m != null) {
+ if (m == null) {
+ this.map = new HashMap<String, Object>();
255
+ } else {
256
+ this.map = new HashMap<String, Object>(m.size());
257
for (final Entry<?, ?> e : m.entrySet()) {
258
final Object value = e.getValue();
259
if (value != null) {
0 commit comments