ItEr43S09ImplantacionAplicacionItEr42S13: [Bug #242] Fixing bug.

It was caused because the sibling elements labels were included in the
check
This commit is contained in:
Óscar González Fernández 2010-01-16 19:42:54 +01:00
parent f2522839ad
commit 045c8d3205

View file

@ -779,16 +779,17 @@ public abstract class OrderElement extends BaseEntity implements
}
private boolean checkConstraintLabelNotRepeatedInTheSameBranch(
HashSet<Label> labels) {
HashSet<Label> parentLabels) {
HashSet<Label> withThisLabels = new HashSet<Label>(parentLabels);
for (Label label : getLabels()) {
if (containsLabel(labels, label)) {
if (containsLabel(withThisLabels, label)) {
return false;
}
labels.add(label);
withThisLabels.add(label);
}
for (OrderElement child : getChildren()) {
if (!child.checkConstraintLabelNotRepeatedInTheSameBranch(labels)) {
if (!child
.checkConstraintLabelNotRepeatedInTheSameBranch(withThisLabels)) {
return false;
}
}