Avoid FormBinder.getCurrentRows

It is potentially unsafe.

FEA: ItEr75S23FixAllocationModel
This commit is contained in:
Óscar González Fernández 2011-08-29 18:56:20 +02:00 committed by Óscar González Fernández
parent 0053c5e5d2
commit cfc7c01a1e
3 changed files with 16 additions and 13 deletions

View file

@ -760,4 +760,9 @@ public abstract class AllocationRow {
});
}
public boolean isNotFlat() {
return getOrigin() != null
&& getOrigin().getAssignmentFunction() != null;
}
}

View file

@ -906,4 +906,14 @@ public class FormBinder {
this.behaviour = behaviour;
}
public boolean isAnyNotFlat() {
for (AllocationRow allocationRow : allocationRowsHandler
.getCurrentRows()) {
if (allocationRow.isNotFlat()) {
return true;
}
}
return false;
}
}

View file

@ -720,19 +720,7 @@ public class ResourceAllocationController extends GenericForwardComposer {
}
public boolean isAnyNotFlat() {
if (formBinder == null) {
return false;
}
List<AllocationRow> currentRows = formBinder.getCurrentRows();
for (AllocationRow allocationRow : currentRows) {
if ((allocationRow.getOrigin() != null)
&& (allocationRow.getOrigin().getAssignmentFunction() != null)) {
return true;
}
}
return false;
return formBinder != null && formBinder.isAnyNotFlat();
}
}