Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AbstractTestElement#clone might produce non-identical clones if element constructor adds a non-default property value #5984

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

vlsi
Copy link
Collaborator

@vlsi vlsi commented Jun 14, 2023

Historically AbstractTestElement calls default constructor in order to create a clone. It might be that a constructor would add properties (e.g. LoopController, HeaderManager), so we might get invalid clones if the clone source removes a property which was added in the constructor.

An alternative approach would be using super.clone(), however, it would be a significant change, so for now I suggest just removing "extra" properties that might be accidentally added in constructor.

The visible effect was that LoopController was unequal after cloning if user removes continueForever property from the LoopController.

@vlsi vlsi added this to the 5.6 milestone Jun 14, 2023
@vlsi vlsi marked this pull request as ready for review June 14, 2023 09:35
@vlsi vlsi changed the title fix: AbstractTestElement#clone might produce non-identical clones if element constructor added a non-default property value fix: AbstractTestElement#clone might produce non-identical clones if element constructor adds a non-default property value Jun 14, 2023
…element constructor adds a non-default property value

Historically AbstractTestElement calls default constructor in order to create a clone.
It might be that a constructor would add properties (e.g. LoopController,
HeaderManager), so we might get invalid clones if the clone source
_removes_ a property which was added in the constructor.
@vlsi vlsi added the defect label Jun 14, 2023
@vlsi vlsi merged commit 88423ed into apache:master Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant