We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
背景:java.util.GregorianCalendar 与 对象内含有内存地址相同的属性,顺序不一样结果会不同,其中一种情况序列化会失败。具体代码如下,放到repeater-plugin-core模块的test模块下直接可以复现。
test1()正常 test()异常
package com.alibaba.jvm.sandbox.repeater.plugin.core.serialize; import com.alibaba.jvm.sandbox.repeater.plugin.core.wrapper.SerializerWrapper; import com.alibaba.jvm.sandbox.repeater.plugin.domain.MockInvocation; import java.util.*; import java.util.concurrent.ConcurrentHashMap; public class HessianTest { public static void main(String[] args) throws SerializeException { test1(); test(); } public static void test() throws SerializeException { List<MockInvocation> ml = new ArrayList<>(); MockInvocation m1 = new MockInvocation(); MockInvocation m2 = new MockInvocation(); Object[] org = new Object[1]; org[0] = new GregorianCalendar(); m1.setCurrentArgs(org); ArrayList xxx = new ArrayList(); xxx.add(123); Map<String,Object> map = new ConcurrentHashMap<>(); map.put("xx",xxx); map.put("jj",xxx); Object[] ol = new Object[1]; ol[0] = map; m2.setCurrentArgs(ol); ml.add(m1); ml.add(m2); String ens = SerializerWrapper.hessianSerialize(ml); Object xx = SerializerWrapper.hessianDeserialize(ens); System.out.println(xx); } public static void test1() throws SerializeException { List<MockInvocation> ml = new ArrayList<>(); MockInvocation m1 = new MockInvocation(); MockInvocation m2 = new MockInvocation(); ArrayList xxx = new ArrayList(); xxx.add(123); Map<String,Object> map = new HashMap<>(); map.put("xx",xxx); map.put("jj",xxx); Object[] ol = new Object[1]; ol[0] = map; m1.setCurrentArgs(ol); Object[] org = new Object[1]; org[0] = new GregorianCalendar(); m2.setCurrentArgs(org); ml.add(m1); ml.add(m2); String ens = SerializerWrapper.hessianSerialize(ml); Object xx = SerializerWrapper.hessianDeserialize(ens); System.out.println(xx); } }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
背景:java.util.GregorianCalendar 与 对象内含有内存地址相同的属性,顺序不一样结果会不同,其中一种情况序列化会失败。具体代码如下,放到repeater-plugin-core模块的test模块下直接可以复现。
test1()正常
test()异常
The text was updated successfully, but these errors were encountered: