// Usually...
this.latestDate = swap.maturityDate();
// ...but due to adjustments, the last floating coupon might need a later date for fixing
if (new Settings().isUseIndexedCoupon()) {
final FloatingRateCoupon lastFloating = (FloatingRateCoupon) this.swap.floatingLeg().last();
final Date fixingValueDate = this.iborIndex.valueDate(lastFloating.fixingDate());
final Date endValueDate = this.iborIndex.maturityDate(fixingValueDate);
this.latestDate = Date.max(latestDate, endValueDate);
}
}