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

[QUESTION] JSONObject LinkedHashMap 泛型问题 #257

Closed
MisakaTAT opened this issue May 15, 2022 · 5 comments
Closed

[QUESTION] JSONObject LinkedHashMap 泛型问题 #257

MisakaTAT opened this issue May 15, 2022 · 5 comments
Labels
question Further information is requested
Milestone

Comments

@MisakaTAT
Copy link

请描述您的问题

public class JSONObject extends LinkedHashMap implements InvocationHandler

如题,fastjson2相较于v1版本移除了LinkedHashMap泛型,在原项目升级v2版本后出现多处以下告警,经翻阅issues了解到是为了修复 #110,目前暂时用@SuppressWarnings("unchecked")抑制了告警,想请问下后续会考虑将泛型加回来吗?关联问题 #165

Unchecked assignment: 'com.alibaba.fastjson2.JSONObject' to 'java.util.Map<java.lang.String,java.lang.Object>
@MisakaTAT MisakaTAT added the question Further information is requested label May 15, 2022
@wenshao
Copy link
Member

wenshao commented May 15, 2022

你用的是什么版本?

@MisakaTAT
Copy link
Author

你用的是什么版本?

2.0.3

@louisjiang
Copy link

public void test1(JSONObject param1){ }
public void test1(Map<String,String> param1){ }

在2.0.3的版本这样的写法是有问题的.

@louisjiang
Copy link

为什么要去掉父类的泛型?

@wenshao wenshao added this to the 2.0.4 milestone May 20, 2022
@wenshao
Copy link
Member

wenshao commented May 21, 2022

https://github.com/alibaba/fastjson2/releases/tag/2.0.4
问题已经修复,请用新版本

@wenshao wenshao closed this as completed May 21, 2022
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

3 participants