mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -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”字符串
|
||||
|
@@ -40,7 +40,7 @@ public class JSONTokener {
|
||||
/**
|
||||
* 源
|
||||
*/
|
||||
private Reader reader;
|
||||
private final Reader reader;
|
||||
|
||||
/**
|
||||
* JSON配置
|
||||
|
@@ -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());
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user