Skip to content

Commit c12d976

Browse files
fix: force Quarkus' constraint metamodel build item to use reflection (#2156)
Due to what I assume to be classloader shenanigans, the generated Gizmo classes cannot access annotations on fields/methods at Quarkus build time. --------- Co-authored-by: Lukáš Petrovický <lukas@petrovicky.net>
1 parent 523d316 commit c12d976

File tree

45 files changed

+289
-262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+289
-262
lines changed

core/src/main/java/ai/timefold/solver/core/config/constructionheuristic/ConstructionHeuristicPhaseConfig.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@
3737
"moveSelectorConfigList",
3838
"foragerConfig"
3939
})
40-
public class ConstructionHeuristicPhaseConfig extends PhaseConfig<ConstructionHeuristicPhaseConfig> {
40+
public final class ConstructionHeuristicPhaseConfig extends PhaseConfig<ConstructionHeuristicPhaseConfig> {
4141

4242
public static final String XML_ELEMENT_NAME = "constructionHeuristic";
4343

4444
// Warning: all fields are null (and not defaulted) because they can be inherited
4545
// and also because the input config file should match the output config file
4646

47-
protected ConstructionHeuristicType constructionHeuristicType = null;
48-
protected EntitySorterManner entitySorterManner = null;
49-
protected ValueSorterManner valueSorterManner = null;
47+
private ConstructionHeuristicType constructionHeuristicType = null;
48+
private EntitySorterManner entitySorterManner = null;
49+
private ValueSorterManner valueSorterManner = null;
5050

5151
@XmlElements({
5252
@XmlElement(name = "queuedEntityPlacer", type = QueuedEntityPlacerConfig.class),
5353
@XmlElement(name = "queuedValuePlacer", type = QueuedValuePlacerConfig.class),
5454
@XmlElement(name = "pooledEntityPlacer", type = PooledEntityPlacerConfig.class)
5555
})
56-
protected EntityPlacerConfig entityPlacerConfig = null;
56+
private EntityPlacerConfig entityPlacerConfig = null;
5757

5858
/** Simpler alternative for {@link #entityPlacerConfig}. */
5959
@XmlElements({
@@ -68,10 +68,10 @@ public class ConstructionHeuristicPhaseConfig extends PhaseConfig<ConstructionHe
6868
@XmlElement(name = SwapMoveSelectorConfig.XML_ELEMENT_NAME, type = SwapMoveSelectorConfig.class),
6969
@XmlElement(name = UnionMoveSelectorConfig.XML_ELEMENT_NAME, type = UnionMoveSelectorConfig.class)
7070
})
71-
protected List<MoveSelectorConfig> moveSelectorConfigList = null;
71+
private List<MoveSelectorConfig> moveSelectorConfigList = null;
7272

7373
@XmlElement(name = "forager")
74-
protected ConstructionHeuristicForagerConfig foragerConfig = null;
74+
private ConstructionHeuristicForagerConfig foragerConfig = null;
7575

7676
// ************************************************************************
7777
// Constructors and simple getters/setters

core/src/main/java/ai/timefold/solver/core/config/constructionheuristic/decider/forager/ConstructionHeuristicForagerConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@XmlType(propOrder = {
1414
"pickEarlyType"
1515
})
16-
public class ConstructionHeuristicForagerConfig extends AbstractConfig<ConstructionHeuristicForagerConfig> {
16+
public final class ConstructionHeuristicForagerConfig extends AbstractConfig<ConstructionHeuristicForagerConfig> {
1717

1818
private ConstructionHeuristicPickEarlyType pickEarlyType = null;
1919

core/src/main/java/ai/timefold/solver/core/config/constructionheuristic/placer/PooledEntityPlacerConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@XmlType(propOrder = {
2424
"moveSelectorConfig"
2525
})
26-
public class PooledEntityPlacerConfig extends EntityPlacerConfig<PooledEntityPlacerConfig> {
26+
public final class PooledEntityPlacerConfig extends EntityPlacerConfig<PooledEntityPlacerConfig> {
2727

2828
@XmlElements({
2929
@XmlElement(name = CartesianProductMoveSelectorConfig.XML_ELEMENT_NAME,

core/src/main/java/ai/timefold/solver/core/config/constructionheuristic/placer/QueuedEntityPlacerConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
"entitySelectorConfig",
2828
"moveSelectorConfigList"
2929
})
30-
public class QueuedEntityPlacerConfig extends EntityPlacerConfig<QueuedEntityPlacerConfig> {
30+
public final class QueuedEntityPlacerConfig extends EntityPlacerConfig<QueuedEntityPlacerConfig> {
3131

3232
public static final String XML_ELEMENT_NAME = "queuedEntityPlacer";
3333

3434
@XmlElement(name = "entitySelector")
35-
protected EntitySelectorConfig entitySelectorConfig = null;
35+
private EntitySelectorConfig entitySelectorConfig = null;
3636

3737
@XmlElements({
3838
@XmlElement(name = CartesianProductMoveSelectorConfig.XML_ELEMENT_NAME,
@@ -46,7 +46,7 @@ public class QueuedEntityPlacerConfig extends EntityPlacerConfig<QueuedEntityPla
4646
@XmlElement(name = SwapMoveSelectorConfig.XML_ELEMENT_NAME, type = SwapMoveSelectorConfig.class),
4747
@XmlElement(name = UnionMoveSelectorConfig.XML_ELEMENT_NAME, type = UnionMoveSelectorConfig.class)
4848
})
49-
protected List<MoveSelectorConfig> moveSelectorConfigList = null;
49+
private List<MoveSelectorConfig> moveSelectorConfigList = null;
5050

5151
public @Nullable EntitySelectorConfig getEntitySelectorConfig() {
5252
return entitySelectorConfig;

core/src/main/java/ai/timefold/solver/core/config/constructionheuristic/placer/QueuedValuePlacerConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
"valueSelectorConfig",
2727
"moveSelectorConfig"
2828
})
29-
public class QueuedValuePlacerConfig extends EntityPlacerConfig<QueuedValuePlacerConfig> {
29+
public final class QueuedValuePlacerConfig extends EntityPlacerConfig<QueuedValuePlacerConfig> {
3030

3131
public static final String XML_ELEMENT_NAME = "queuedValuePlacer";
3232

33-
protected Class<?> entityClass = null;
33+
private Class<?> entityClass = null;
3434

3535
@XmlElement(name = "valueSelector")
36-
protected ValueSelectorConfig valueSelectorConfig = null;
36+
private ValueSelectorConfig valueSelectorConfig = null;
3737

3838
@XmlElements({
3939
@XmlElement(name = CartesianProductMoveSelectorConfig.XML_ELEMENT_NAME,

core/src/main/java/ai/timefold/solver/core/config/exhaustivesearch/ExhaustiveSearchPhaseConfig.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@
3232
"entitySelectorConfig",
3333
"moveSelectorConfig"
3434
})
35-
public class ExhaustiveSearchPhaseConfig extends PhaseConfig<ExhaustiveSearchPhaseConfig> {
35+
public final class ExhaustiveSearchPhaseConfig extends PhaseConfig<ExhaustiveSearchPhaseConfig> {
3636

3737
public static final String XML_ELEMENT_NAME = "exhaustiveSearch";
3838

3939
// Warning: all fields are null (and not defaulted) because they can be inherited
4040
// and also because the input config file should match the output config file
4141

42-
protected ExhaustiveSearchType exhaustiveSearchType = null;
43-
protected NodeExplorationType nodeExplorationType = null;
44-
protected EntitySorterManner entitySorterManner = null;
45-
protected ValueSorterManner valueSorterManner = null;
42+
private ExhaustiveSearchType exhaustiveSearchType = null;
43+
private NodeExplorationType nodeExplorationType = null;
44+
private EntitySorterManner entitySorterManner = null;
45+
private ValueSorterManner valueSorterManner = null;
4646

4747
@XmlElement(name = "entitySelector")
48-
protected EntitySelectorConfig entitySelectorConfig = null;
48+
private EntitySelectorConfig entitySelectorConfig = null;
4949

5050
@XmlElements({
5151
@XmlElement(name = CartesianProductMoveSelectorConfig.XML_ELEMENT_NAME,
@@ -59,7 +59,7 @@ public class ExhaustiveSearchPhaseConfig extends PhaseConfig<ExhaustiveSearchPha
5959
@XmlElement(name = SwapMoveSelectorConfig.XML_ELEMENT_NAME, type = SwapMoveSelectorConfig.class),
6060
@XmlElement(name = UnionMoveSelectorConfig.XML_ELEMENT_NAME, type = UnionMoveSelectorConfig.class)
6161
})
62-
protected MoveSelectorConfig moveSelectorConfig = null;
62+
private MoveSelectorConfig moveSelectorConfig = null;
6363

6464
public @Nullable ExhaustiveSearchType getExhaustiveSearchType() {
6565
return exhaustiveSearchType;

core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/common/nearby/NearbySelectionConfig.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,29 @@
3636
"betaDistributionAlpha",
3737
"betaDistributionBeta"
3838
})
39-
public class NearbySelectionConfig extends SelectorConfig<NearbySelectionConfig> {
39+
public final class NearbySelectionConfig extends SelectorConfig<NearbySelectionConfig> {
4040

4141
@XmlElement(name = "originEntitySelector")
42-
protected EntitySelectorConfig originEntitySelectorConfig = null;
42+
private EntitySelectorConfig originEntitySelectorConfig = null;
4343
@XmlElement(name = "originSubListSelector")
44-
protected SubListSelectorConfig originSubListSelectorConfig = null;
44+
private SubListSelectorConfig originSubListSelectorConfig = null;
4545
@XmlElement(name = "originValueSelector")
46-
protected ValueSelectorConfig originValueSelectorConfig = null;
47-
protected Class<? extends NearbyDistanceMeter> nearbyDistanceMeterClass = null;
46+
private ValueSelectorConfig originValueSelectorConfig = null;
47+
private Class<? extends NearbyDistanceMeter> nearbyDistanceMeterClass = null;
4848

49-
protected NearbySelectionDistributionType nearbySelectionDistributionType = null;
49+
private NearbySelectionDistributionType nearbySelectionDistributionType = null;
5050

51-
protected Integer blockDistributionSizeMinimum = null;
52-
protected Integer blockDistributionSizeMaximum = null;
53-
protected Double blockDistributionSizeRatio = null;
54-
protected Double blockDistributionUniformDistributionProbability = null;
51+
private Integer blockDistributionSizeMinimum = null;
52+
private Integer blockDistributionSizeMaximum = null;
53+
private Double blockDistributionSizeRatio = null;
54+
private Double blockDistributionUniformDistributionProbability = null;
5555

56-
protected Integer linearDistributionSizeMaximum = null;
56+
private Integer linearDistributionSizeMaximum = null;
5757

58-
protected Integer parabolicDistributionSizeMaximum = null;
58+
private Integer parabolicDistributionSizeMaximum = null;
5959

60-
protected Double betaDistributionAlpha = null;
61-
protected Double betaDistributionBeta = null;
60+
private Double betaDistributionAlpha = null;
61+
private Double betaDistributionBeta = null;
6262

6363
public @Nullable EntitySelectorConfig getOriginEntitySelectorConfig() {
6464
return originEntitySelectorConfig;

core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/entity/EntitySelectorConfig.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"selectedCountLimit"
4141
})
4242
@NullMarked
43-
public class EntitySelectorConfig extends SelectorConfig<EntitySelectorConfig> {
43+
public final class EntitySelectorConfig extends SelectorConfig<EntitySelectorConfig> {
4444

4545
public static EntitySelectorConfig newMimicSelectorConfig(String mimicSelectorRef) {
4646
return new EntitySelectorConfig()
@@ -49,41 +49,41 @@ public static EntitySelectorConfig newMimicSelectorConfig(String mimicSelectorRe
4949

5050
@Nullable
5151
@XmlAttribute
52-
protected String id = null;
52+
private String id = null;
5353
@XmlAttribute
5454
@Nullable
55-
protected String mimicSelectorRef = null;
55+
private String mimicSelectorRef = null;
5656

5757
@Nullable
58-
protected Class<?> entityClass = null;
58+
private Class<?> entityClass = null;
5959
@Nullable
60-
protected SelectionCacheType cacheType = null;
60+
private SelectionCacheType cacheType = null;
6161
@Nullable
62-
protected SelectionOrder selectionOrder = null;
62+
private SelectionOrder selectionOrder = null;
6363

6464
@Nullable
6565
@XmlElement(name = "nearbySelection")
66-
protected NearbySelectionConfig nearbySelectionConfig = null;
66+
private NearbySelectionConfig nearbySelectionConfig = null;
6767

6868
@Nullable
69-
protected Class<? extends SelectionFilter> filterClass = null;
69+
private Class<? extends SelectionFilter> filterClass = null;
7070

7171
@Nullable
72-
protected EntitySorterManner sorterManner = null;
72+
private EntitySorterManner sorterManner = null;
7373
@Nullable
74-
protected Class<? extends Comparator> comparatorClass = null;
74+
private Class<? extends Comparator> comparatorClass = null;
7575
@Nullable
76-
protected Class<? extends ComparatorFactory> comparatorFactoryClass = null;
76+
private Class<? extends ComparatorFactory> comparatorFactoryClass = null;
7777
@Nullable
78-
protected SelectionSorterOrder sorterOrder = null;
78+
private SelectionSorterOrder sorterOrder = null;
7979
@Nullable
80-
protected Class<? extends SelectionSorter> sorterClass = null;
80+
private Class<? extends SelectionSorter> sorterClass = null;
8181

8282
@Nullable
83-
protected Class<? extends SelectionProbabilityWeightFactory> probabilityWeightFactoryClass = null;
83+
private Class<? extends SelectionProbabilityWeightFactory> probabilityWeightFactoryClass = null;
8484

8585
@Nullable
86-
protected Long selectedCountLimit = null;
86+
private Long selectedCountLimit = null;
8787

8888
public EntitySelectorConfig() {
8989
}

core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/entity/pillar/PillarSelectorConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
"minimumSubPillarSize",
1818
"maximumSubPillarSize"
1919
})
20-
public class PillarSelectorConfig extends SelectorConfig<PillarSelectorConfig> {
20+
public final class PillarSelectorConfig extends SelectorConfig<PillarSelectorConfig> {
2121

2222
@XmlElement(name = "entitySelector")
23-
protected EntitySelectorConfig entitySelectorConfig = null;
23+
private EntitySelectorConfig entitySelectorConfig = null;
2424

25-
protected Integer minimumSubPillarSize = null;
26-
protected Integer maximumSubPillarSize = null;
25+
private Integer minimumSubPillarSize = null;
26+
private Integer maximumSubPillarSize = null;
2727

2828
public @Nullable EntitySelectorConfig getEntitySelectorConfig() {
2929
return entitySelectorConfig;

core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/list/DestinationSelectorConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"valueSelectorConfig",
2020
"nearbySelectionConfig",
2121
})
22-
public class DestinationSelectorConfig extends SelectorConfig<DestinationSelectorConfig> {
22+
public final class DestinationSelectorConfig extends SelectorConfig<DestinationSelectorConfig> {
2323

2424
@XmlElement(name = "entitySelector")
2525
private EntitySelectorConfig entitySelectorConfig;

0 commit comments

Comments
 (0)