Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONArray的实例不再有toJSONString的方法了吗? #111

Closed
RyouonRitsu opened this issue Apr 29, 2022 · 6 comments
Closed

JSONArray的实例不再有toJSONString的方法了吗? #111

RyouonRitsu opened this issue Apr 29, 2022 · 6 comments
Labels
question Further information is requested

Comments

@RyouonRitsu
Copy link

1.0的版本的时候是可用的,更新到2.0版本后不可用了,请问是不再支持了吗?文档里没看到有写?

@wenshao
Copy link
Member

wenshao commented Apr 30, 2022

有两种用法:
 ```java
JSONArray array = ...;
array.toJSONString();


```java
JSON.toJSONString(xxx);

JSONArray没有继承自JSON了,所有有变化,需要你改一下

@wenshao wenshao added the question Further information is requested label Apr 30, 2022
@RyouonRitsu
Copy link
Author

我在使用array = JSON.parseArray(string)string = JSON.toJSONString(array)的过程中项目提示我出现了非法的反射使用…所有的非法反射使用将在后续被拒绝,是我的用法有问题吗

@wenshao
Copy link
Member

wenshao commented Apr 30, 2022

fastjson2会针对JDK 17后的版本做不同的实现

@RyouonRitsu
Copy link
Author

所以我是该无视它继续用还是回滚到1.x老版本

@wenshao
Copy link
Member

wenshao commented Apr 30, 2022

你可以无视他

@RyouonRitsu
Copy link
Author

好的,感谢您的回复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants