feat: add cloning fail fast check#2132
Merged
triceo merged 1 commit intoTimefoldAI:mainfrom Feb 19, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
approved these changes
Feb 19, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.