You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the FieldAccessingSolutionCloner fails to construct an object, it throws an exception with message "The class $CLAZZ should have a no-arg constructor to create a planning clone.". However, construction can fail for other reasons, e.g. in my case, I initialize some fields based on other fields, and this failed when a certain collection was empty.
Expected behavior
A better error message, e.g. "Failed to create a new instance of class $CLAZZ for the purpose of solution-cloning. This could be due to a missing no-arg constructor or some other error inside the logic of class $CLAZZ triggered by the no-arg constructor."
Actual behavior
Describe clearly and concisely what actually happened.
To Reproduce
N/A
Environment
Timefold Solver Version or Git ref: 1.1.0
Output of java -version: N/A
Output of uname -a or ver: N/A
Additional information
N/A
The text was updated successfully, but these errors were encountered:
Something like this (Kotlin).
When you create a new TimeBlock using the default constructor, the list of Timeslots is empty and so next() throws a NoSuchElementException.
Of course there are problems with my classes, but I think the error message could be improved - I ended up spending 10 minutes figuring out why my no-arg constructor was not getting picked up.
Describe the bug
When the
FieldAccessingSolutionCloner
fails to construct an object, it throws an exception with message"The class $CLAZZ should have a no-arg constructor to create a planning clone."
. However, construction can fail for other reasons, e.g. in my case, I initialize some fields based on other fields, and this failed when a certain collection was empty.Expected behavior
A better error message, e.g.
"Failed to create a new instance of class $CLAZZ for the purpose of solution-cloning. This could be due to a missing no-arg constructor or some other error inside the logic of class $CLAZZ triggered by the no-arg constructor."
Actual behavior
Describe clearly and concisely what actually happened.
To Reproduce
N/A
Environment
Timefold Solver Version or Git ref: 1.1.0
Output of
java -version
: N/AOutput of
uname -a
orver
: N/AAdditional information
N/A
The text was updated successfully, but these errors were encountered: