mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
修复toJSONString导致CPU使用率高的问题
This commit is contained in:
parent
c8b56ed2b9
commit
afafd8ac05
@ -146,10 +146,8 @@ public interface JSON extends Converter, Cloneable, Serializable {
|
|||||||
*/
|
*/
|
||||||
default String toJSONString(final int indentFactor) throws JSONException {
|
default String toJSONString(final int indentFactor) throws JSONException {
|
||||||
final StringWriter sw = new StringWriter();
|
final StringWriter sw = new StringWriter();
|
||||||
synchronized (sw.getBuffer()) {
|
|
||||||
return this.write(sw, indentFactor, 0, null).toString();
|
return this.write(sw, indentFactor, 0, null).toString();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将JSON内容写入Writer,无缩进<br>
|
* 将JSON内容写入Writer,无缩进<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user