Repository navigation
feat(scala): support native copy for Scala collections - #4197
Open
dajiaohuang wants to merge 2 commits into
Open
dajiaohuang wants to merge 2 commits into
dajiaohuang wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
Fory.copydid not provide native copy support for Scala immutable collections, mutable collections/maps, and ranges. This adds support while preserving object identity across mixed immutable/mutable cycles.What does this PR do?
List↔ mutable map and immutable map ↔ mutableListBufferidentity cycles.The contributor's human-authored rationale, retained verbatim: “会产生副本不同步” (copies may become unsynchronized) and “是否完全做到区分单一副本和原对象” (whether the implementation fully distinguishes the single copy from the original object).
Related issues
Related to #4103.
Verification
The contributor personally ran and reviewed the focused
NativeCopyTestchecks on 2026-10-27:++2.13.18 "fory-scala/testOnly org.apache.fory.serializer.scala.NativeCopyTest"— 5 tests run, 5 passed, 0 failed; exit code 0.++3.3.8 "fory-scala/testOnly org.apache.fory.serializer.scala.NativeCopyTest"— 5 tests run, 5 passed, 0 failed; exit code 0.git diff --checkpassed.The two targeted runs cover the changed behavior. No full Scala module suite, CI run, or benchmark is claimed. This is correctness support for previously unsupported native
Fory.copy, not a comparative performance claim; there is no equivalent native-copy baseline.AI Contribution Checklist
AI Usage Disclosure
NativeCopyTest.8e936331b6fa5c4b28ba356a10a518ea72b20ba4and the candidate fingerprint SHA-2562731b7a72ca0dcaa0567006ed6534b255162626a313128951941afcbb8575a79. Both returned no further actionable comments. Their final results and limitations are embedded below. Neither reviewer ran tests, builds, or benchmarks.Final Fory-guided review —
fory-fresh-guided-review-20261027-r2Final independent general review —
fory-fresh-independent-review-20261027-r2After the reviews, S regenerated the review artifact from the current worktree and reported that it matched the same candidate fingerprint. This is S's reconciliation, not a claim that either reviewer independently reproduced exact worktree/hash correspondence.
User-facing and compatibility impact
Fory.copyAPI; it does not add a public API signature.