luern0313 / lson Goto Github PK
View Code? Open in Web Editor NEW一个用于JSON序列化/反序列化的Java库,拥有良好的性能和高拓展性。 A Java library for JSON serialization/deserialization, it has good performance and high extensibility.
License: Apache License 2.0
一个用于JSON序列化/反序列化的Java库,拥有良好的性能和高拓展性。 A Java library for JSON serialization/deserialization, it has good performance and high extensibility.
License: Apache License 2.0
Lson before v1.3.7 was discovered to contain a stack overflow via the Map parameter.
Exception in thread "main" java.lang.StackOverflowError
at java.base/java.lang.StringBuilder.<init>(StringBuilder.java:104)
at java.base/java.lang.Class.toString(Class.java:191)
at cn.luern0313.lson.util.TypeUtil.getName(TypeUtil.java:87)
at cn.luern0313.lson.util.TypeUtil.isPrimitivePlus(TypeUtil.java:112)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:42)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
at cn.luern0313.lson.Serialization.listToJson(Serialization.java:67)
at cn.luern0313.lson.Serialization.toJson(Serialization.java:47)
<dependency>
<groupId>cn.luern0313.lson</groupId>
<artifactId>Lson</artifactId>
<version>0.90</version>
</dependency>
import cn.luern0313.lson.LsonUtil;
import java.util.HashMap;
public class PoC {
public static void main(String[] args) {
HashMap<String,Object> map=new HashMap<>();
map.put("t",map);
LsonUtil.toJson(map);
}
}
Refer to the solution of jackson-databind: Add the depth variable to record the current parsing depth. If the parsing depth exceeds a certain threshold, an exception is thrown. (FasterXML/jackson-databind@fcfc499)
Refer to the GSON solution: Change the recursive processing on deeply nested arrays or JSON objects to stack+iteration processing.((google/gson@2d01d6a20f39881c692977564c1ea591d9f39027))
程序打开后可正常使用但全是乱码
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.