public VanillaSwap value() /* @ReadOnly */ {
QL.validateExperimentalMode();
Date startDate;
if (!effectiveDate_.isNull()) {
startDate = effectiveDate_;
} else {
/*@Natural*/ final int fixingDays = iborIndex_.fixingDays();
final Date referenceDate = new Settings().evaluationDate();
final Date spotDate = floatCalendar_.advance(referenceDate, fixingDays, TimeUnit.Days);
startDate = spotDate.add(forwardStart_);
}
//XXX: remove this block
//
// Date startDate;
// if (effectiveDate_ != null) {
// startDate = effectiveDate_;
// } else {
// Date spotDate;
// if (fixingDays == null) {
// final int firstFixing = iborIndex_.fixingDays();
// final Date referenceDate = new Settings().evaluationDate();
// spotDate = floatCalendar_.advance (referenceDate, firstFixing, TimeUnit.Days);
// } else {
// final int firstFixing = (int) fixingDays.get(0);
// final Date referenceDate = new Settings().evaluationDate();
// spotDate = floatCalendar_.advance (referenceDate, firstFixing, TimeUnit.Days);
// }
// startDate = spotDate.add (forwardStart_);
// }
Date endDate;
if (!terminationDate_.isNull()) {
endDate = terminationDate_;
} else {
endDate = startDate.add (swapTenor_);
}