List of usage examples for org.joda.time Duration isEqual
public boolean isEqual(ReadableDuration duration)
From source file:org.smartdeveloperhub.harvesters.it.testing.generator.ProjectActivityGenerator.java
License:Apache License
private void estimateIssue(final Issue issue, final Set<Item> changes, final LocalDateTime now) { final LocalDateTime dueTo = Utils.toLocalDateTime(issue.getDueTo()); final Duration oldValue = issue.getEstimatedTime(); Duration newValue = null; do {/*from w ww.j a v a 2s. c om*/ newValue = estimateEffort(now, dueTo); if (MINIMUM_EFFORT.isEqual(newValue) && MINIMUM_EFFORT.isEqual(oldValue)) { return; } } while (newValue.isEqual(oldValue)); issue.setEstimatedTime(newValue); final EstimatedTimeChangeItem item = new EstimatedTimeChangeItem(); item.setOldValue(oldValue); item.setNewValue(newValue); changes.add(item); if (oldValue == null) { LOGGER.trace(" + Estimated {} hours", newValue.getStandardHours()); } else { LOGGER.trace(" + Reestimated from {} to {} hours", oldValue.getStandardHours(), newValue.getStandardHours()); } }