Skip to content

Xml - ObjectWithAttributesGene - add unsafecopy override and tests#1518

Merged
arcuri82 merged 3 commits intomasterfrom
feature/xml
Apr 27, 2026
Merged

Xml - ObjectWithAttributesGene - add unsafecopy override and tests#1518
arcuri82 merged 3 commits intomasterfrom
feature/xml

Conversation

@suarezrominajulieta
Copy link
Copy Markdown
Collaborator

@suarezrominajulieta suarezrominajulieta commented Apr 23, 2026

Summary:

ObjectWithAttributesGene models XML elements with attributes (e.g., ).
The attributeNames set determines which fields are rendered as XML attributes vs. child elements.

Previously, ObjectWithAttributesGene did not override unsafeCopyValueFrom, causing mutation
operations to silently lose XML attribute metadata and potentially produce malformed XML during fuzzing.

Changes:

  • Changed attributeNames from val to var to allow reassignment in the override.
  • Added unsafeCopyValueFrom override: copies attributeNames when the source is an
    ObjectWithAttributesGene, or resets it to emptySet() when copying from a plain ObjectGene.

Tests:

Three new unit tests in ObjectWithAttributesGeneTest:

  • Verifies attributeNames is correctly transferred between two ObjectWithAttributesGene instances.
  • Verifies attributeNames is cleared when copying from a plain ObjectGene.
  • Verifies equality is preserved when both genes share the same attributeNames.

@suarezrominajulieta suarezrominajulieta marked this pull request as ready for review April 26, 2026 18:36
@arcuri82 arcuri82 merged commit e5db63e into master Apr 27, 2026
14 checks passed
@arcuri82 arcuri82 deleted the feature/xml branch April 27, 2026 07:53
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.

2 participants