Avoid exception if effortAssigned is zero
Add a warning if this happens and the totalEffort is not zero. FEA: ItEr70S04BugFixingx
This commit is contained in:
parent
339f02c931
commit
9532c2b71f
1 changed files with 5 additions and 0 deletions
|
|
@ -212,6 +212,11 @@ abstract class LoadPeriodGenerator {
|
|||
if (totalEffort.isZero()) {
|
||||
return effortAssigned.isZero() ? 0 : Integer.MAX_VALUE;
|
||||
}
|
||||
if (effortAssigned.isZero()) {
|
||||
LOG.warn("total effort is " + totalEffort
|
||||
+ " but effortAssigned is zero");
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
Fraction fraction = totalEffort.divivedBy(effortAssigned);
|
||||
Fraction percentage = fraction.multiplyBy(Fraction.getFraction(100, 1));
|
||||
return percentage.intValue();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue