-
Notifications
You must be signed in to change notification settings - Fork 114
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
怎样友好的兼容 java 中的集合类 #343
Comments
@alpha-baby 你的意思是 java中 如果 Object[] 中只有一个元素,就会序列化为 TypedList, 如果有2个不同的元素就会序列化为 UntypedList 吗? 如果真是这样,就变得不可预期,是不是一种不可取的方式? |
不管有几个元素都会序列化成 TypedList, 这里和元素个数没得关系, |
@alpha-baby 跨语言访问最好还是不要使用特定语言中才有的类定义,如果要兼容,需要在go中特殊定义,参考 https://github.com/apache/dubbo-go-hessian2/blob/master/java_util/README_CN.md |
确实是这样,我这里的情况是,对方定义的那个 java 接口已经很多年了,方法入参中已经定义成了 List |
What would you like to be added:
Why is this needed:
在 java 中把这个结构序列化出来:
golang 这个接口序列化出来是:
java 把 Object[] 序列化,为了TypedList, 但是 golang 把 interface{} 切片序列化为了 UntypedList 这个又是为什么呢?
The text was updated successfully, but these errors were encountered: