|
7 | 7 | import ai.timefold.solver.core.api.domain.solution.PlanningSolution; |
8 | 8 | import ai.timefold.solver.core.api.domain.variable.PiggybackShadowVariable; |
9 | 9 | import ai.timefold.solver.core.api.domain.variable.ShadowVariable; |
| 10 | +import ai.timefold.solver.core.api.domain.variable.VariableListener; |
10 | 11 | import ai.timefold.solver.core.impl.domain.common.accessor.MemberAccessor; |
11 | 12 | import ai.timefold.solver.core.impl.domain.entity.descriptor.EntityDescriptor; |
12 | 13 | import ai.timefold.solver.core.impl.domain.policy.DescriptorPolicy; |
@@ -70,11 +71,13 @@ private void linkShadowSources(DescriptorPolicy descriptorPolicy) { |
70 | 71 | + shadowEntityDescriptor.buildInvalidVariableNameExceptionMessage(shadowVariableName)); |
71 | 72 | } |
72 | 73 | if (!(uncastShadowVariableDescriptor instanceof CustomShadowVariableDescriptor)) { |
73 | | - throw new IllegalArgumentException("The entityClass (" + entityDescriptor.getEntityClass() |
74 | | - + ") has a @" + PiggybackShadowVariable.class.getSimpleName() |
75 | | - + " annotated property (" + variableMemberAccessor.getName() |
76 | | - + ") with refVariable (" + uncastShadowVariableDescriptor.getSimpleEntityAndVariableName() |
77 | | - + ") that lacks a @" + ShadowVariable.class.getSimpleName() + " annotation."); |
| 74 | + throw new IllegalArgumentException(""" |
| 75 | + The entityClass (%s) has a @%s annotated property (%s) with refVariable (%s) that |
| 76 | + lacks a %s @%s annotation. |
| 77 | + """.formatted(entityDescriptor.getEntityClass(), PiggybackShadowVariable.class.getSimpleName(), |
| 78 | + variableMemberAccessor.getName(), uncastShadowVariableDescriptor.getSimpleEntityAndVariableName(), |
| 79 | + VariableListener.class.getSimpleName(), |
| 80 | + ShadowVariable.class.getSimpleName())); |
78 | 81 | } |
79 | 82 | shadowVariableDescriptor = (CustomShadowVariableDescriptor<Solution_>) uncastShadowVariableDescriptor; |
80 | 83 | shadowVariableDescriptor.registerSinkVariableDescriptor(this); |
|
0 commit comments