Skip to content

fix(android): use equals() instead of == for string comparison in Deserializer#4552

Open
hobostay wants to merge 1 commit intoTencent:mainfrom
hobostay:fix/deserializer-string-comparison
Open

fix(android): use equals() instead of == for string comparison in Deserializer#4552
hobostay wants to merge 1 commit intoTencent:mainfrom
hobostay:fix/deserializer-string-comparison

Conversation

@hobostay
Copy link
Copy Markdown

Summary

  • Fix key == "null" to "null".equals(key) in Deserializer.java (lines 242, 266)
  • The == operator checks reference equality, not value equality
  • When strings are deserialized from binary format, they are not interned, so == comparison with the literal "null" would always fail
  • This bug causes the null key handling logic to never trigger, potentially leading to incorrect map deserialization

Test plan

  • Verify that deserializing a map with a "null" string key correctly pushes a null key to the HippyMap/HippyArray
  • Run existing serialization/deserialization unit tests to ensure no regression

🤖 Generated with Claude Code

…erializer

In Deserializer.java, `key == "null"` uses reference equality which
fails when the string is deserialized from binary format (not interned).
Changed to `"null".equals(key)` to correctly compare string values.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hobostay hobostay requested review from iPel and siguangli as code owners April 22, 2026 11:56
@github-actions github-actions Bot added framework: android size: xs Denotes a PR that changes 0-9 lines labels Apr 22, 2026
@tencent-adm
Copy link
Copy Markdown
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Test User seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hippy-service
Copy link
Copy Markdown

hippy-service Bot commented Apr 22, 2026

Hi, @hobostay. Thanks for your PR! 👏

🏷️ You can leave a comment in this PR with #help tag when you need help (e.g. some status checks run failed due to internal issue), admin team members will help asap.

@hippy-service
Copy link
Copy Markdown

hippy-service Bot commented Apr 22, 2026

After a quick scan, I have approved workflow to run.

Details

🏷️ New commits in this PR would not be tested automatically until this pull request is reviewed by our collaborators.
🏷️ No need to worry about the status of merge_guard and [gh] pull request merge guard / merge_guard (pull_request_target) checks, once this pull request is met merge requirements, it will be automatically converted to successful status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework: android size: xs Denotes a PR that changes 0-9 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants