fix JSONUtil.isJson

This commit is contained in:
Looly
2021-02-03 12:57:14 +08:00
parent f126ded53a
commit 1a7812a281
6 changed files with 30 additions and 8 deletions

View File

@@ -801,7 +801,7 @@ public final class JSONUtil {
if (StrUtil.isBlank(str)) {
return false;
}
return StrUtil.isWrap(str.trim(), '{', '}');
return StrUtil.isWrap(StrUtil.trim(str), '{', '}');
}
/**
@@ -815,7 +815,7 @@ public final class JSONUtil {
if (StrUtil.isBlank(str)) {
return false;
}
return StrUtil.isWrap(str.trim(), '[', ']');
return StrUtil.isWrap(StrUtil.trim(str), '[', ']');
}
/**

View File

@@ -179,4 +179,4 @@ public class JSONUtilTest {
" \"test\": \"\\\\地库地库\",\n" +
"}");
}
}
}