[Bug #1310] Reorder the code to fix the two exceptions happening here.
FEA: ItEr75S04BugFixing
This commit is contained in:
parent
efca992df5
commit
e868dfd256
1 changed files with 10 additions and 8 deletions
|
|
@ -516,17 +516,19 @@ public abstract class AssignedCriterionRequirementController<T, M> extends
|
|||
@Override
|
||||
public void validate(Component comp, Object value)
|
||||
throws WrongValueException {
|
||||
Validate.isTrue(value instanceof Integer);
|
||||
int intValue = value == null ? 0 : (Integer) value;
|
||||
if (intValue == 0) {
|
||||
if(value == null) {
|
||||
orderElementTotalHours.setValue(0);
|
||||
}
|
||||
try {
|
||||
if (getElement() instanceof OrderLine) {
|
||||
((OrderLine) getElement()).setWorkHours(intValue);
|
||||
else {
|
||||
Validate.isTrue(value instanceof Integer);
|
||||
int intValue = (Integer) value;
|
||||
try {
|
||||
if (getElement() instanceof OrderLine) {
|
||||
((OrderLine) getElement()).setWorkHours(intValue);
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new WrongValueException(comp, _(e.getMessage()));
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new WrongValueException(comp, _(e.getMessage()));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue