Skip to content

Xml - ObjectWithAttributesGene - add unsafecopy override and tests#1518

Open
suarezrominajulieta wants to merge 3 commits intomasterfrom
feature/xml
Open

Xml - ObjectWithAttributesGene - add unsafecopy override and tests#1518
suarezrominajulieta wants to merge 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
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.

1 participant