This commit is contained in:
Looly
2019-10-29 19:05:23 +08:00
parent 3cef7fa9a7
commit bf03aebcef
107 changed files with 283 additions and 456 deletions

View File

@@ -18,17 +18,6 @@ public class JSONNull implements Serializable{
*/
public static final JSONNull NULL = new JSONNull();
/**
* There is only intended to be a single instance of the NULL object, so the clone method returns itself.
*克隆方法只返回本身,此对象是个单例对象
*
* @return NULL.
*/
@Override
protected final Object clone() {
return this;
}
/**
* A Null object is equal to the null value and to itself.
* 对象与其本身和<code>null</code>值相等
@@ -38,7 +27,7 @@ public class JSONNull implements Serializable{
*/
@Override
public boolean equals(Object object) {
return object == null || object == this;
return object == null || (object instanceof JSONNull && object == this);
}
@Override

View File

@@ -17,7 +17,6 @@ import cn.hutool.json.serialize.JSONObjectSerializer;
import cn.hutool.json.serialize.JSONSerializer;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.lang.reflect.Method;
import java.math.BigDecimal;