mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -460,6 +460,7 @@ public final class InternalJSONUtil {
|
||||
* @param c 字符
|
||||
* @return 转义后的字符串
|
||||
*/
|
||||
@SuppressWarnings("UnnecessaryUnicodeEscape")
|
||||
private static String escape(final char c) {
|
||||
switch (c) {
|
||||
case '\b':
|
||||
|
@@ -10,7 +10,7 @@ import org.junit.Test;
|
||||
* 测试在bean转换时使用BeanConverter,默认忽略转换失败的字段。
|
||||
* 现阶段Converter的问题在于,无法更细粒度的控制转换失败的范围,例如Bean的一个字段为List,
|
||||
* list任意一个item转换失败都会导致这个list为null。
|
||||
*
|
||||
* <p>
|
||||
* TODO 需要在Converter中添加ConvertOption,用于更细粒度的控制转换规则
|
||||
*/
|
||||
public class Issue1200Test {
|
||||
|
@@ -9,7 +9,7 @@ import java.time.LocalDateTime;
|
||||
/**
|
||||
* https://gitee.com/loolly/dashboard/issues?id=I1F8M2
|
||||
*/
|
||||
public class IssueI1F8M2 {
|
||||
public class IssueI1F8M2Test {
|
||||
@Test
|
||||
public void toBeanTest() {
|
||||
final String jsonStr = "{\"eventType\":\"fee\",\"fwdAlertingTime\":\"2020-04-22 16:34:13\",\"fwdAnswerTime\":\"\"}";
|
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 此问题原来出在BeanCopier中,判断循环引用使用了equals,并不严谨。
|
||||
* 修复后使用==判断循环引用。
|
||||
*/
|
||||
public class IssueI1H2VN {
|
||||
public class IssueI1H2VNTest {
|
||||
|
||||
@Test
|
||||
public void toBeanTest() {
|
@@ -10,7 +10,7 @@ import java.time.LocalDateTime;
|
||||
/**
|
||||
* 测试带毫秒的日期转换
|
||||
*/
|
||||
public class IssueI3BS4S {
|
||||
public class IssueI3BS4STest {
|
||||
|
||||
@Test
|
||||
public void toBeanTest(){
|
@@ -5,7 +5,7 @@ import lombok.Data;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class IssueI3EGJP {
|
||||
public class IssueI3EGJPTest {
|
||||
|
||||
@Test
|
||||
public void hutoolMapToBean() {
|
@@ -2,7 +2,6 @@ package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.math.NumberUtil;
|
||||
import cn.hutool.json.serialize.JSONStringer;
|
||||
@@ -14,11 +13,7 @@ import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
import java.util.*;
|
||||
|
||||
public class JSONUtilTest {
|
||||
|
||||
|
@@ -12,9 +12,8 @@ public class GlobalValueWriterMappingTest {
|
||||
|
||||
@Before
|
||||
public void init(){
|
||||
GlobalValueWriterMapping.put(CustomSubBean.class, (JSONValueWriter<CustomSubBean>) (writer, value) -> {
|
||||
writer.writeRaw(String.valueOf(value.getId()));
|
||||
});
|
||||
GlobalValueWriterMapping.put(CustomSubBean.class,
|
||||
(JSONValueWriter<CustomSubBean>) (writer, value) -> writer.writeRaw(String.valueOf(value.getId())));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user