[Bug #1084] Fix bug
Use floating point arithmetic if the fraction overflows FEA: ItEr74S04BugFixing
This commit is contained in:
parent
8370d66ebb
commit
0e118ea1b6
1 changed files with 8 additions and 2 deletions
|
|
@ -328,8 +328,14 @@ public class TaskElementAdapter implements ITaskElementAdapter {
|
|||
return Duration.ZERO;
|
||||
}
|
||||
Fraction fraction = fractionOfWorkingDayFor(effortDuration);
|
||||
return new Duration(fraction.multiplyBy(
|
||||
Fraction.getFraction(DAY_MILLISECONDS, 1)).intValue());
|
||||
try {
|
||||
return new Duration(fraction.multiplyBy(
|
||||
Fraction.getFraction(DAY_MILLISECONDS, 1)).intValue());
|
||||
} catch (ArithmeticException e) {
|
||||
// if fraction overflows use floating point arithmetic
|
||||
return new Duration(
|
||||
(int) (fraction.doubleValue() * DAY_MILLISECONDS));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue