#129 JSONObject.fromObject() class causes a problem stackOverFlow

open
nobody
None
5
2012-04-12
2012-04-12
sailwe
No

The equals method JSONNull class causes a problem stackOverFlow.When using the Memcached caching JSONobjects,please deserialize it and use JSONObject.fromObject(cachedJSONObject).So the judgment conditions of Object.equals (null) should be coupled with the equals method.Sincerely hope that the next version to fix this problem. Thanks!

Changed the JSONNull.equals Code:
public boolean equals( Object object ) {
return object == null || object == this || object == instance
|| (object instanceof JSONObject && ((JSONObject) object).isNullObject())
|| "null".equals( object ) || object.equals(null);
}

Discussion