fastjson2
fastjson2 copied to clipboard
[FEATURE] Add JSpecify annotations
在库层面告知是否需要空判断。
没明白你的意思?这个有什么问题?
没明白你的意思?这个有什么问题?
我上一个添加jspecify https://jspecify.dev/docs/start-here 后的实际效果吧。当然空安全是个庞大的工作,但仍需进行。
- [Migrate to JSpecify annotations for nullability constraints] https://github.com/spring-projects/spring-framework/issues/28797#issuecomment-2387137015
- Null Safety in Spring applications with JSpecify and NullAway
fastjson是要零依赖的,不能依赖任何第三方Annotation
fastjson是要零依赖的,不能依赖任何第三方Annotation
这应该不是拒绝采用该方案的合理理由,实际上该库仅包含注解。
原来的代码就很清晰,引入引来无论是编译期还是运行期都没有必要
Sharing one example with java: https://github.com/jabrena/java-jspecify-maven-poc/