This commit is contained in:
Looly 2021-02-03 13:34:41 +08:00
parent 0056560a93
commit fe71315f24
3 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@
### Bug修复
* 【json 】 JSONUtil.isJson方法改变trim策略解决特殊空白符导致判断失败问题
* 【json 】 修复SQLEXception导致的栈溢出issue#1401@Github
* 【json 】 修复SQLEXception导致的栈溢出issue#1399@Github
-------------------------------------------------------------------------------------------------------------

View File

@ -736,7 +736,7 @@ public final class JSONUtil {
}
try {
// fix issue#1401@Github
// fix issue#1399@Github
if(object instanceof SQLException){
return object.toString();
}

View File

@ -183,7 +183,7 @@ public class JSONUtilTest {
@Test
public void sqlExceptionTest(){
//https://github.com/looly/hutool/issues/1401
//https://github.com/looly/hutool/issues/1399
// SQLException实现了Iterable接口默认是遍历之会栈溢出修正后只返回string
final JSONObject set = JSONUtil.createObj().set("test", new SQLException("test"));
Assert.assertEquals("{\"test\":\"java.sql.SQLException: test\"}", set.toString());