mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.bean.BeanPath;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.func.Filter;
|
||||
import cn.hutool.core.lang.mutable.MutablePair;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
@@ -163,7 +163,7 @@ public class JSONObject extends MapWrapper<String, Object> implements JSON, JSON
|
||||
* @throws JSONException If any of the values are non-finite numbers.
|
||||
*/
|
||||
public JSONArray toJSONArray(Collection<String> names) throws JSONException {
|
||||
if (CollectionUtil.isEmpty(names)) {
|
||||
if (CollUtil.isEmpty(names)) {
|
||||
return null;
|
||||
}
|
||||
final JSONArray ja = new JSONArray(this.config);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.ArrayIter;
|
||||
import cn.hutool.core.collection.iter.ArrayIter;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.lang.func.Filter;
|
||||
|
@@ -3,15 +3,14 @@ package cn.hutool.json;
|
||||
import cn.hutool.core.annotation.Alias;
|
||||
import cn.hutool.core.annotation.PropIgnore;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.text.StrUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.json.test.bean.JSONBean;
|
||||
import cn.hutool.json.test.bean.ResultDto;
|
||||
import cn.hutool.json.test.bean.Seq;
|
||||
@@ -239,7 +238,7 @@ public class JSONObjectTest {
|
||||
userA.setA("A user");
|
||||
userA.setName("{\n\t\"body\":{\n\t\t\"loginId\":\"id\",\n\t\t\"password\":\"pwd\"\n\t}\n}");
|
||||
userA.setDate(new Date());
|
||||
userA.setSqs(CollectionUtil.newArrayList(new Seq("seq1"), new Seq("seq2")));
|
||||
userA.setSqs(CollUtil.newArrayList(new Seq("seq1"), new Seq("seq2")));
|
||||
|
||||
JSONObject json = JSONUtil.parseObj(userA);
|
||||
UserA userA2 = json.toBean(UserA.class);
|
||||
@@ -321,7 +320,7 @@ public class JSONObjectTest {
|
||||
UserA userA = new UserA();
|
||||
userA.setName("nameTest");
|
||||
userA.setDate(new Date());
|
||||
userA.setSqs(CollectionUtil.newArrayList(new Seq(null), new Seq("seq2")));
|
||||
userA.setSqs(CollUtil.newArrayList(new Seq(null), new Seq("seq2")));
|
||||
|
||||
JSONObject json = JSONUtil.parseObj(userA, false);
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
@@ -59,7 +59,7 @@ public class JSONUtilTest {
|
||||
a2.setDate(DateUtil.date());
|
||||
a2.setName("AAAA222Name");
|
||||
|
||||
ArrayList<UserA> list = CollectionUtil.newArrayList(a1, a2);
|
||||
ArrayList<UserA> list = CollUtil.newArrayList(a1, a2);
|
||||
HashMap<String, Object> map = MapUtil.newHashMap();
|
||||
map.put("total", 13);
|
||||
map.put("rows", list);
|
||||
|
Reference in New Issue
Block a user