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

com.alibaba.com.caucho.hessian.io.HessianInput.readObject()不管什么类型读取出来的都是list #29

Open
iwhalecloud-platform opened this issue Apr 16, 2020 · 1 comment

Comments

@iwhalecloud-platform
Copy link

iwhalecloud-platform commented Apr 16, 2020

代码

com.alibaba.com.caucho.hessian.io.HessianInput.readObject();

if (List.class != reader.getType() && List.class.isAssignableFrom(reader.getType()))
                    return reader.readList(this, length, valueType ? expectedTypes.get(0) : null);

第一个条件:List.class != reader.getType() 读取的类型不能是List
第二个条件:List.class.isAssignableFrom(reader.getType())) 判断接口类型,这里明显少了一个 感叹号。
应该加一个感叹号

!List.class.isAssignableFrom(reader.getType()))

否则永远都是list读取

 case 'V': {
                String type = readType();

如果type为空是否要默认list,否则读取的是map序列化

@lucky-xin
Copy link

这个是去年提的,我现在看源码还是一样呀

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

No branches or pull requests

2 participants