This commit is contained in:
Looly
2020-04-11 13:08:46 +08:00
parent 73fd3b849f
commit bc486cdac4
207 changed files with 1329 additions and 1355 deletions

View File

@@ -25,16 +25,12 @@ public class JSONNull implements Serializable{
* @param object An object to test for nullness.
* @return true if the object parameter is the JSONObject.NULL object or null.
*/
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
@Override
public boolean equals(Object object) {
return object == null || (object instanceof JSONNull && object == this);
return object == null || (object == this);
}
@Override
public int hashCode() {
return super.hashCode();
}
/**
* Get the "null" string value.
*获得“null”字符串

View File

@@ -40,7 +40,7 @@ public class JSONTokener {
/**
* 源
*/
private Reader reader;
private final Reader reader;
/**
* JSON配置

View File

@@ -1,14 +1,5 @@
package cn.hutool.json;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Console;
@@ -17,6 +8,14 @@ import cn.hutool.core.util.CharsetUtil;
import cn.hutool.json.test.bean.Exam;
import cn.hutool.json.test.bean.JsonNode;
import cn.hutool.json.test.bean.KeyBean;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* JSONArray单元测试
@@ -121,6 +120,7 @@ public class JSONArrayTest {
String jsonStr = FileUtil.readString("exam_test.json", CharsetUtil.CHARSET_UTF_8);
JSONArray array = JSONUtil.parseArray(jsonStr);
//noinspection SuspiciousToArrayCall
Exam[] list = array.toArray(new Exam[0]);
Assert.assertNotEquals(0, list.length);
Assert.assertEquals(Exam.class, list[0].getClass());

View File

@@ -74,7 +74,7 @@ public class ResultDto<T> implements Serializable {
* @param message the message
* @param result the result
*/
ResultDto(int code, String message, T result) {
public ResultDto(int code, String message, T result) {
super();
this.code(code).message(message).result(result);
}