}
// rate helpers
vars.instruments = new RateHelper[vars.swaps];
final IborIndex index = new JPYLibor(new Period(6, TimeUnit.Months));
for (int i=0; i<vars.swaps; i++) {
final Handle<Quote> r = new Handle<Quote>(vars.rates[i]);
vars.instruments[i] = new SwapRateHelper(
r, new Period(swapData[i].n, swapData[i].units),
vars.calendar, // TODO: code review on this line!!!!
vars.fixedLegFrequency, vars.fixedLegConvention,
vars.fixedLegDayCounter, index);
}
vars.termStructure = new PiecewiseYieldCurve(
Discount.class, LogLinear.class, IterativeBootstrap.class,
vars.settlement, vars.instruments,
new Actual360(),
new Handle/*<Quote>*/[0],
new Date[0],
1.0e-12);
final RelinkableHandle<YieldTermStructure> curveHandle = new RelinkableHandle<YieldTermStructure>();
curveHandle.linkTo(vars.termStructure);
// check swaps
final IborIndex jpylibor6m = new JPYLibor(new Period(6, TimeUnit.Months), curveHandle);
for (int i=0; i<vars.swaps; i++) {
final Period tenor = new Period(swapData[i].n, swapData[i].units);
final VanillaSwap swap = new MakeVanillaSwap(tenor, jpylibor6m, 0.0)
.withEffectiveDate(vars.settlement)