-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
JSON.toJSONString() 序列化导致原Map的value转换为LinkedHashMap #1254
Labels
bug
Something isn't working
good first issue
Good for newcomers
later
This will be worked on in later version
Comments
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
OrezzerO
added
bug
Something isn't working
good first issue
Good for newcomers
and removed
wontfix
This will not be worked on
labels
Dec 30, 2022
@gofow You are right, looking forward to your participation. |
gofow
pushed a commit
to gofow/sofa-rpc
that referenced
this issue
Feb 19, 2023
gofow
pushed a commit
to gofow/sofa-rpc
that referenced
this issue
Feb 19, 2023
EvenLjj
pushed a commit
that referenced
this issue
Feb 28, 2023
* fix bug #1254 for JSON serialization and deserialization * fix bug #1254 for JSON serialization and deserialization * modify JSONTest * add two cases to JSONTest * pass JSONTest * remove the modification of addType * format code * modify test method name --------- Co-authored-by: HISSs <taiguhe@foxmail.com> Co-authored-by: liujianjun.ljj <liujianjun.ljj@antgroup.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
good first issue
Good for newcomers
later
This will be worked on in later version
Describe the bug
JSON.toJSONString() 序列化导致原Map的value转换为LinkedHashMap。
Expected behavior
JSON.toJSONString() 序列化后不影响原实体
Actual behavior
JSON序列化自定义对象时,调用BeanSerializer.serialize()将对象转换成map
如果,自定义对象中属性是Map时,会将Value替换成递归调用的结果,
这时如果Value是对象,会转换成LinkedHashMap,返回后会替换原始实体
Steps to reproduce
运行Demo的main方法
Minimal yet complete reproducer code (or GitHub URL to code)
import com.alipay.sofa.rpc.common.json.JSON;
import java.util.HashMap;
import java.util.Map;
public class TestDemo {
}
Environment
java -version
): 11.0.15uname -a
): Windows10The text was updated successfully, but these errors were encountered: