Skip to content

fix: use proper field names in cacheable codecs#845

Merged
anthony-swirldslabs merged 1 commit into
mainfrom
844-cacheableFieldNames
May 22, 2026
Merged

fix: use proper field names in cacheable codecs#845
anthony-swirldslabs merged 1 commit into
mainfrom
844-cacheableFieldNames

Conversation

@anthony-swirldslabs
Copy link
Copy Markdown
Contributor

Description:
Fixing a small bug in the pbj.cacheable implementation where embedded hashCode() and equals() bodies used incorrect field names to refer to local temp_ variables. They used camelCase names while the temp_ fields use original protobuf names, which may be snake_case.

Test models are updated to verify this fix.

Related issue(s):

Fixes #844

Notes for reviewer:
All tests should pass.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
@anthony-swirldslabs anthony-swirldslabs self-assigned this May 22, 2026
@anthony-swirldslabs anthony-swirldslabs requested review from a team as code owners May 22, 2026 00:25
@github-actions
Copy link
Copy Markdown

JUnit Test Report

   521 files  ±0     521 suites  ±0   27s ⏱️ -1s
 1 537 tests ±0   1 533 ✅ ±0   4 💤 ±0  0 ❌ ±0 
10 755 runs  ±0  10 727 ✅ ±0  28 💤 ±0  0 ❌ ±0 

Results for commit 7265da3. ± Comparison against base commit f2a1e09.

@github-actions
Copy link
Copy Markdown

Integration Test Report

    428 files  + 2      428 suites  +2   18m 39s ⏱️ - 2m 50s
115 048 tests +18  115 048 ✅ +18  0 💤 ±0  0 ❌ ±0 
115 292 runs  +18  115 292 ✅ +18  0 💤 ±0  0 ❌ ±0 

Results for commit 7265da3. ± Comparison against base commit f2a1e09.

This pull request removes 2 and adds 20 tests. Note that renamed tests count towards both.
com.hedera.pbj.integration.test.ParserNeverWrapsTest ‑ [1] com.hedera.pbj.integration.test.ParserNeverWrapsTest$$Lambda/0x0000000032bf0b18@52388384
com.hedera.pbj.integration.test.ParserNeverWrapsTest ‑ [2] com.hedera.pbj.integration.test.ParserNeverWrapsTest$$Lambda/0x0000000032bf0d60@177c38c5
com.hedera.pbj.integration.test.ParserNeverWrapsTest ‑ [1] com.hedera.pbj.integration.test.ParserNeverWrapsTest$$Lambda/0x000000007cc8e310@7774060f
com.hedera.pbj.integration.test.ParserNeverWrapsTest ‑ [2] com.hedera.pbj.integration.test.ParserNeverWrapsTest$$Lambda/0x000000007cc8e558@58fc8272
com.hedera.pbj.test.proto.pbj.tests.CacheableNftIDTest ‑ [1] NoToStringWrapper{com.hedera.pbj.test.proto.pbj.CacheableNftID}
com.hedera.pbj.test.proto.pbj.tests.CacheableNftIDTest ‑ [2] NoToStringWrapper{com.hedera.pbj.test.proto.pbj.CacheableNftID}
com.hedera.pbj.test.proto.pbj.tests.CacheableNftIDTest ‑ [3] NoToStringWrapper{com.hedera.pbj.test.proto.pbj.CacheableNftID}
com.hedera.pbj.test.proto.pbj.tests.CacheableNftIDTest ‑ [4] NoToStringWrapper{com.hedera.pbj.test.proto.pbj.CacheableNftID}
com.hedera.pbj.test.proto.pbj.tests.CacheableNftIDTest ‑ [5] NoToStringWrapper{com.hedera.pbj.test.proto.pbj.CacheableNftID}
com.hedera.pbj.test.proto.pbj.tests.CacheableNftIDTest ‑ [6] NoToStringWrapper{com.hedera.pbj.test.proto.pbj.CacheableNftID}
com.hedera.pbj.test.proto.pbj.tests.CacheableNftIDTest ‑ [7] NoToStringWrapper{com.hedera.pbj.test.proto.pbj.CacheableNftID}
com.hedera.pbj.test.proto.pbj.tests.CacheableNftIDTest ‑ testCodecGetDefaultValueMethod()
…

@anthony-swirldslabs anthony-swirldslabs merged commit 6b3d791 into main May 22, 2026
24 checks passed
@anthony-swirldslabs anthony-swirldslabs deleted the 844-cacheableFieldNames branch May 22, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect field names in cacheable codecs for hashCode and equals bodies

2 participants