LouisLou2 opened a new pull request, #2308: URL: https://github.com/apache/fory/pull/2308
## What does this PR do? This PR fixes a `ClassCastException` during deserialization caused by an incorrect `MetaStringBytes` being retrieved from the cache. The previous cache key `(long, long)` in `MetaStringResolver` (for small meta strings) didn't include the string's `encoding` byte, leading to collisions when different strings (e.g., "aclass" vs "Aclass") hashed to the same two longs. **Changes:** 1. **Introduced `LongLongByteMap`:** A new map using a `(long k1, long k2, byte k3)` key. 2. **Updated `MetaStringResolver`:** Modified relevant methods (e.g., `createSmallMetaStringBytes`, `readSmallMetaStringBytes`) to use `LongLongByteMap`, incorporating the `encoding` byte into the cache key for small meta strings. 3. **Renamed Test:** `LongLongMapTest.java` renamed to `LongLongByteMapTest.java` and updated to test the new map. ## Related issues - #2307 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark <!-- When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here. --> -- 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]
