Skip to content

Conversation

@Christopher-Chianelli
Copy link
Contributor

  • Previously, when a class is deep-cloned, a method that constructs and fully initializes a clone of that class is called. This has the potential to cause a StackOverflowException when a deep-cloned class refers to many other deep-cloned classes, such as in chained models.

  • Now, when a field is deeped cloned, it adds the field initializer to a cloneQueue, and that cloneQueue can only be processed for the first entity being cloned. As such, stack-height does not grow indefinitely.

  • Perform various cleanups in the GizmoSolutionCloner

  • Change method isInvalid to getIsInvalid so the GizmoSolutionCloner recongize it as the getter of the corresponding field.

Copy link
Collaborator

@triceo triceo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're already improving the code, I'm making some further improvement suggestions of my own. Reading this code is IMO harder than it could be.

Also, please make sure you work with up-to-date main, because CI is currently failing due to that.

Copy link
Collaborator

@triceo triceo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please review the Sonar comments.

- Previously, when a class is deep-cloned, a method that constructs
  and fully initializes a clone of that class is called. This has
  the potential to cause a StackOverflowException when a deep-cloned
  class refers to many other deep-cloned classes, such as in chained
  models.

- Now, when a field is deeped cloned, it adds the field initializer
  to a cloneQueue, and that cloneQueue can only be processed for
  the first entity being cloned. As such, stack-height does not
  grow indefinitely.

- Perform various cleanups in the GizmoSolutionCloner

- Change method `isInvalid` to `getIsInvalid` so the
  GizmoSolutionCloner recongize it as the getter of
  the corresponding field.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 3, 2025

@triceo triceo merged commit c9a40d5 into TimefoldAI:main Oct 3, 2025
34 checks passed
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