caucho hessian2 implementation in Go for [apache/dubbo-go](https://github.com/apache/dubbo-go) which is compatible with [dubbo-hessian-lite](https://github.com/apache/dubbo-hessian-lite)
Apache License 2.0
209
stars
112
forks
source link
Java Double type covert to float64 panic when null value set. #305
What happened: Java side:
class Score implements Serializable { private Double score; private String name;
}
..... ..... Score s = new Score(); s.setScore(null); s.setName("DoubleWithNull");
golang side:
type score struct { Score float64 Name string }
golang side get error when Double is null value as below
error:decDouble parse double wrong tag:78-0x4e\ngithub.com/apache/dubbo-go-hessian2.(Decoder).decDouble\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/double.go:151\ngithub.com/apache/dubbo-go-hessian2.(Decoder).decInstance\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/object.go:486\ngithub.com/apache/dubbo-go-hessian2.(Decoder).decObject\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/object.go:696\ngithub.com/apache/dubbo-go-hessian2.(Decoder).DecodeValue\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/decode.go:285\ngithub.com/apache/dubbo-go-hessian2.(Decoder).decObject\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/object.go:655\ngithub.com/apache/dubbo-go-hessian2.(Decoder).DecodeValue\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/decode.go:285\ngithub.com/apache/dubbo-go-hessian2.(Decoder).Decode\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/decode.go:214\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.unmarshalRequestBody\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/impl/hessian.go:244\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.HessianSerializer.Unmarshal\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/impl/hessian.go:56\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.(ProtocolCodec).Decode\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/impl/codec.go:186\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.(DubboPackage).Unmarshal\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/impl/package.go:93\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo.(DubboCodec).decodeRequest\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/dubbo_codec.go:189\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo.(DubboCodec).Decode\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/dubbo_codec.go:165\ndubbo.apache.org/dubbo-go/v3/remoting/getty.(RpcServerPackageHandler).Read\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/remoting/getty/readwriter.go:104\ngithub.com/apache/dubbo-getty.(session).handleTCPPackage\n\t/go/pkg/mod/github.com/apache/dubbo-getty@v1.4.5/session.go:627\ngithub.com/apache/dubbo-getty.(session).handlePackage\n\t/go/pkg/mod/github.com/apache/dubbo-getty@v1.4.5/session.go:549\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581\ndecInstance->decDouble field name:totalScore\ngithub.com/apache/dubbo-go-hessian2.(Decoder).decInstance\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/object.go:488\ngithub.com/apache/dubbo-go-hessian2.(Decoder).decObject\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/object.go:696\ngithub.com/apache/dubbo-go-hessian2.(Decoder).DecodeValue\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/decode.go:285\ngithub.com/apache/dubbo-go-hessian2.(Decoder).decObject\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/object.go:655\ngithub.com/apache/dubbo-go-hessian2.(Decoder).DecodeValue\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/decode.go:285\ngithub.com/apache/dubbo-go-hessian2.(Decoder).Decode\n\t/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.10.1-0.20211206111530-75ff95074949/decode.go:214\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.unmarshalRequestBody\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/impl/hessian.go:244\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.HessianSerializer.Unmarshal\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/impl/hessian.go:56\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.(ProtocolCodec).Decode\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/impl/codec.go:186\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo/impl.(DubboPackage).Unmarshal\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/impl/package.go:93\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo.(DubboCodec).decodeRequest\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/dubbo_codec.go:189\ndubbo.apache.org/dubbo-go/v3/protocol/dubbo.(DubboCodec).Decode\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/protocol/dubbo/dubbo_codec.go:165\ndubbo.apache.org/dubbo-go/v3/remoting/getty.(RpcServerPackageHandler).Read\n\t/go/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.0-rc4-1/remoting/getty/readwriter.go:104\ngithub.com/apache/dubbo-getty.(session).handleTCPPackage\n\t/go/pkg/mod/github.com/apach
What you expected to happen: zero value without error in golang code. How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?: