Skip to content

Commit 7bf5f9b

Browse files
committed
chore: address comments
1 parent bc16ba3 commit 7bf5f9b

File tree

8 files changed

+17
-16
lines changed

8 files changed

+17
-16
lines changed

core/src/main/java/ai/timefold/solver/core/impl/domain/variable/declarative/DeclarativeShadowVariableDescriptor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public void processAnnotations(DescriptorPolicy descriptorPolicy) {
5353

5454
if (method == null) {
5555
throw new IllegalArgumentException("""
56-
@%s (%s) defines a supplierMethod (%s) that does not exist inside its declaring class (%s).
57-
Maybe you misspelled the supplierMethod name?
58-
Maybe you have included a unallowed parameter, which does not match the expected solution class: %s"""
56+
@%s (%s) defines a supplierName (%s) that does not exist inside its declaring class (%s).
57+
Maybe you misspelled the supplierName name?
58+
Maybe you have included a disallowed parameter, which does not match the expected solution class: %s"""
5959
.formatted(ShadowVariable.class.getSimpleName(), variableName, methodName,
6060
variableMemberAccessor.getDeclaringClass().getCanonicalName(), solutionClass.getName()));
6161
}

core/src/test/java/ai/timefold/solver/core/impl/domain/solution/descriptor/SolutionDescriptorTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,13 @@ void testBadChainedAndListModel() {
420420
}
421421

422422
@Test
423-
void missingDeclarativeSupplierMethod() {
423+
void missingDeclarativeSupplierName() {
424424
assertThatCode(TestdataDeclarativeMissingSupplierSolution::buildSolutionDescriptor)
425425
.hasMessageContainingAll("@ShadowVariable (endTime)",
426-
"supplierMethod (calculateEndTime) that does not exist",
426+
"supplierName (calculateEndTime) that does not exist",
427427
"inside its declaring class (ai.timefold.solver.core.testdomain.shadow.missing.TestdataDeclarativeMissingSupplierValue).",
428-
"Maybe you misspelled the supplierMethod name?");
428+
"Maybe you misspelled the supplierName name?",
429+
"Maybe you have included a disallowed parameter, which does not match the expected solution class: ai.timefold.solver.core.testdomain.shadow.missing.");
429430
}
430431

431432
@Test

core/src/test/java/ai/timefold/solver/core/impl/domain/variable/declarative/RootVariableSourceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ void invalidParameter() {
634634
TestdataInvalidDeclarativeParameterValue.class)
635635
.getMetaModel())
636636
.hasMessageContaining(
637-
"Maybe you have included a unallowed parameter, which does not match the expected solution class");
637+
"Maybe you have included a disallowed parameter, which does not match the expected solution class");
638638
}
639639

640640
@Test

core/src/test/java/ai/timefold/solver/core/testdomain/shadow/parameter/TestdataBasicVarParameterEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public long getDurationInDays() {
5050

5151
@Override
5252
public String toString() {
53-
return "TestdataBasicVarEntity{" +
53+
return "TestdataBasicVarParameterEntity{" +
5454
"id=" + id +
5555
", value=" + value +
5656
'}';

core/src/test/java/ai/timefold/solver/core/testdomain/shadow/parameter/TestdataBasicVarParameterSolution.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void setScore(HardSoftScore score) {
7878

7979
@Override
8080
public String toString() {
81-
return "TestdataBasicVarSolution{" +
81+
return "TestdataBasicVarParameterSolution{" +
8282
"entities=" + entities +
8383
", values=" + values +
8484
", problemFacts=" + problemFacts +

quarkus-integration/quarkus/deployment/src/main/java/ai/timefold/solver/quarkus/deployment/TimefoldProcessor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,9 +1062,9 @@ private GeneratedGizmoClasses generateDomainAccessors(Map<String, SolverConfig>
10621062
if (methodInfo == null) {
10631063
throw new IllegalArgumentException(
10641064
"""
1065-
@%s (%s) defines a supplierMethod (%s) that does not exist inside its declaring class (%s).
1066-
Maybe you misspelled the supplierMethod name?
1067-
Maybe you have included a unallowed parameter, which does not match the expected solution class: %s"""
1065+
@%s (%s) defines a supplierName (%s) that does not exist inside its declaring class (%s).
1066+
Maybe you misspelled the supplierName name?
1067+
Maybe you have included a disallowed parameter, which does not match the expected solution class: %s"""
10681068
.formatted(ShadowVariable.class.getSimpleName(), memberName, targetMethodName,
10691069
classInfo.name().toString(), solutionClassInfo.name().toString()));
10701070
}

quarkus-integration/quarkus/deployment/src/test/java/ai/timefold/solver/quarkus/TimefoldProcessorMissingSupplierForDeclarativeVariableTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class TimefoldProcessorMissingSupplierForDeclarativeVariableTest {
3030
.isInstanceOf(IllegalArgumentException.class)
3131
.hasMessageContainingAll(
3232
"@ShadowVariable (endTime)",
33-
"supplierMethod (calculateEndTime) that does not exist",
33+
"supplierName (calculateEndTime) that does not exist",
3434
"inside its declaring class (ai.timefold.solver.quarkus.testdomain.declarative.missing.TestdataQuarkusDeclarativeMissingSupplierValue).",
35-
"Maybe you misspelled the supplierMethod name?"));
35+
"Maybe you misspelled the supplierName name?"));
3636

3737
@Test
3838
void test() {

spring-integration/spring-boot-autoconfigure/src/test/java/ai/timefold/solver/spring/boot/autoconfigure/TimefoldSolverSingleSolverAutoConfigurationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ void missingSupplierVariables() {
252252
"timefold.solver.termination.best-score-limit=0")
253253
.run(context -> context.getBean(SolverFactory.class)))
254254
.hasMessageContainingAll("@ShadowVariable (value1AndValue2)",
255-
"supplierMethod (value1AndValue2Supplier) that does not exist",
255+
"supplierName (value1AndValue2Supplier) that does not exist",
256256
"inside its declaring class (ai.timefold.solver.spring.boot.autoconfigure.missingsuppliervariable.domain.TestdataSpringMissingSupplierVariableEntity).",
257-
"Maybe you misspelled the supplierMethod name?");
257+
"Maybe you misspelled the supplierName name?");
258258
}
259259

260260
@Test

0 commit comments

Comments
 (0)