GerardGao opened a new pull request, #399: URL: https://github.com/apache/dubbo-go-hessian2/pull/399
**What this PR does**: Adds regression tests covering `*int64` pointer encoding, the scenario reported in apache/dubbo-go#2410: - `TestNullTypedScalarPointers`: add the missing `(*int64)(nil)` case - `NullFieldStruct`: add an `Int64 *int64` field to cover the nil-field path for `*int64` - `TestInt64PtrFieldStructEncode`: verify that a non-nil `*int64` struct field is encoded as a hessian long (short-form `0x3c 0x30 0x39` for 12345) and round-trips correctly, so a Java consumer deserializes it into a `java.lang.Long` field instead of reading a misaligned value Background: apache/dubbo-go#2410 reported that a Go provider returning a struct with a `*int64` field caused `HessianFieldException ... unexpected object java.lang.String` on the Java side. The root cause was that old versions silently skipped nil scalar pointers when encoding POJO fields, shifting subsequent field values so the Java deserializer read a later String where the Long was expected. This was fixed by #368 (nil pointer -> hessian null) plus the non-nil dereference path; these tests pin the behavior for `*int64`, which #394 did not cover. **Which issue(s) this PR fixes**: apache/dubbo-go#2410 (cross-repo reference; the issue can be closed after the reporter or a maintainer verifies with a recent version) **Special notes for your reviewer**: Pure test change, no production code modified. Verified with `go vet ./` and the full test suite (all packages pass, including the Java cross-validation tests); existing tests still pass. **Does this PR introduce a user-facing change?**: ```release-note NONE ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
