Fix precondition error in finishing criterions
The descendants of the criterion were being matched too, when only the exact match was required. FEA: ItEr74S04BugFixing
This commit is contained in:
parent
5ed78405f7
commit
e8c762a520
1 changed files with 12 additions and 2 deletions
|
|
@ -321,6 +321,16 @@ public abstract class Resource extends IntegrationEntity {
|
|||
});
|
||||
}
|
||||
|
||||
public Query exactly(final Criterion criterion) {
|
||||
return withNewPredicate(new IPredicate() {
|
||||
|
||||
@Override
|
||||
public boolean accepts(CriterionSatisfaction satisfaction) {
|
||||
return criterion.isEquivalent(satisfaction.getCriterion());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to retrieve the result. If no predicate was set, it
|
||||
* returns all satisfactions
|
||||
|
|
@ -540,8 +550,8 @@ public abstract class Resource extends IntegrationEntity {
|
|||
public List<CriterionSatisfaction> finishEnforcedAt(Criterion criterion,
|
||||
LocalDate date) {
|
||||
ArrayList<CriterionSatisfaction> result = new ArrayList<CriterionSatisfaction>();
|
||||
for (CriterionSatisfaction criterionSatisfaction : query().from(
|
||||
criterion).at(date).result()) {
|
||||
for (CriterionSatisfaction criterionSatisfaction : query()
|
||||
.exactly(criterion).at(date).result()) {
|
||||
criterionSatisfaction.finish(date);
|
||||
result.add(criterionSatisfaction);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue