Looly 5 年之前
父节点
当前提交
f6289f118c

+ 0 - 1
hutool-core/src/test/java/cn/hutool/core/bean/BeanUtilTest.java

@@ -4,7 +4,6 @@ import cn.hutool.core.annotation.Alias;
 import cn.hutool.core.bean.copier.CopyOptions;
 import cn.hutool.core.bean.copier.ValueProvider;
 import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.lang.Console;
 import cn.hutool.core.map.MapUtil;
 import lombok.Data;
 import lombok.Getter;

+ 1 - 1
hutool-extra/pom.xml

@@ -378,7 +378,7 @@
 		<dependency>
 			<groupId>com.googlecode.aviator</groupId>
 			<artifactId>aviator</artifactId>
-			<version>5.1.4</version>
+			<version>5.2.1</version>
 			<scope>compile</scope>
 			<optional>true</optional>
 		</dependency>

+ 1 - 1
hutool-json/src/main/java/cn/hutool/json/JSONArray.java

@@ -208,7 +208,7 @@ public class JSONArray implements JSON, JSONGetter<Integer>, List<Object>, Rando
 	}
 
 	/**
-	 * JSONArray转为以<code>separator</code>为分界符的字符串
+	 * JSONArray转为以{@code separator}为分界符的字符串
 	 *
 	 * @param separator 分界符
 	 * @return a string.

+ 13 - 4
hutool-json/src/test/java/cn/hutool/json/JSONArrayTest.java

@@ -1,6 +1,7 @@
 package cn.hutool.json;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.convert.ConvertException;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.lang.Console;
@@ -34,6 +35,14 @@ public class JSONArrayTest {
 	}
 
 	@Test
+	public void addNullTest(){
+		final List<String> aaa = ListUtil.of("aaa", null);
+		String jsonStr = JSONUtil.toJsonStr(JSONUtil.parse(aaa,
+				JSONConfig.create().setIgnoreNullValue(false)));
+		Assert.assertEquals("[\"aaa\",null]", jsonStr);
+	}
+
+	@Test
 	public void addTest() {
 		// 方法1
 		JSONArray array = JSONUtil.createArray();
@@ -96,7 +105,7 @@ public class JSONArrayTest {
 
 		List<Exam> list = array.toList(Exam.class);
 		Assert.assertFalse(list.isEmpty());
-		Assert.assertEquals(Exam.class, list.get(0).getClass());
+		Assert.assertSame(Exam.class, list.get(0).getClass());
 	}
 
 	@Test
@@ -107,7 +116,7 @@ public class JSONArrayTest {
 		List<User> userList = JSONUtil.toList(array, User.class);
 		
 		Assert.assertFalse(userList.isEmpty());
-		Assert.assertEquals(User.class, userList.get(0).getClass());
+		Assert.assertSame(User.class, userList.get(0).getClass());
 		
 		Assert.assertEquals(Integer.valueOf(111), userList.get(0).getId());
 		Assert.assertEquals(Integer.valueOf(112), userList.get(1).getId());
@@ -125,7 +134,7 @@ public class JSONArrayTest {
 		List<Dict> list = JSONUtil.toList(array, Dict.class);
 		
 		Assert.assertFalse(list.isEmpty());
-		Assert.assertEquals(Dict.class, list.get(0).getClass());
+		Assert.assertSame(Dict.class, list.get(0).getClass());
 		
 		Assert.assertEquals(Integer.valueOf(111), list.get(0).getInt("id"));
 		Assert.assertEquals(Integer.valueOf(112), list.get(1).getInt("id"));
@@ -142,7 +151,7 @@ public class JSONArrayTest {
 		//noinspection SuspiciousToArrayCall
 		Exam[] list = array.toArray(new Exam[0]);
 		Assert.assertNotEquals(0, list.length);
-		Assert.assertEquals(Exam.class, list[0].getClass());
+		Assert.assertSame(Exam.class, list[0].getClass());
 	}
 
 	/**

+ 1 - 1
hutool-system/pom.xml

@@ -26,7 +26,7 @@
 		<dependency>
 			<groupId>com.github.oshi</groupId>
 			<artifactId>oshi-core</artifactId>
-			<version>5.3.5</version>
+			<version>5.3.6</version>
 			<scope>provided</scope>
 		</dependency>
 	</dependencies>