Skip to content

Comments

feat: add cloning fail fast check#2132

Merged
triceo merged 1 commit intoTimefoldAI:mainfrom
zepfred:chore/clone
Feb 19, 2026
Merged

feat: add cloning fail fast check#2132
triceo merged 1 commit intoTimefoldAI:mainfrom
zepfred:chore/clone

Conversation

@zepfred
Copy link
Contributor

@zepfred zepfred commented Feb 19, 2026

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a fail-fast validation check for deep cloning configuration. The check ensures that if a planning variable field is marked with @DeepPlanningClone, its type must also be deep-cloneable. This prevents runtime issues where the solver might fail to recognize that an assigned value belongs to a value range.

Changes:

  • Added fail-fast validation to detect invalid deep cloning configuration for planning variables
  • Created test domain classes to demonstrate the invalid scenario
  • Added test case to verify the error is thrown with appropriate messaging

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
DeepCloningUtils.java Added validation check in isFieldDeepCloned to throw an exception when a planning variable is marked for deep cloning but its type is not deep-cloneable
TestdataInvalidEntityProvidingSolution.java Test solution class demonstrating the invalid configuration scenario
TestdataInvalidEntityProvidingEntity.java Test entity with a planning variable incorrectly marked with @DeepPlanningClone when the value type is not deep-cloneable
AbstractSolutionClonerTest.java Test case verifying the new fail-fast check throws an appropriate exception with helpful error messages

@triceo triceo added this to the v2.0.0.CR1 milestone Feb 19, 2026
@sonarqubecloud
Copy link

@triceo triceo merged commit 3a5cb11 into TimefoldAI:main Feb 19, 2026
24 of 25 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