final VolatilitySurface volatilitySurface = (VolatilitySurface) volatilitySurfaceObject;
if (!(volatilitySurface.getSurface() instanceof InterpolatedDoublesSurface)) {
throw new OpenGammaRuntimeException("Expecting an InterpolatedDoublesSurface; got " + volatilitySurface.getSurface().getClass());
}
final InstrumentDefinition<?> definition = security.accept(_visitor);
final HistoricalTimeSeriesBundle timeSeries = HistoricalTimeSeriesFunctionUtils.getHistoricalTimeSeriesInputs(executionContext, inputs);
final InstrumentDerivative swaption = _definitionConverter.convert(security, definition, now, fullCurveNames, timeSeries);
final ValueProperties properties = getResultProperties(currency.getCode(), curveCalculationConfigName, surfaceName);
final ValueSpecification spec = new ValueSpecification(_valueRequirementName, target.toSpecification(), properties);
final BlackFlatSwaptionParameters parameters = new BlackFlatSwaptionParameters(volatilitySurface.getSurface(),
SwaptionUtils.getSwapGenerator(security, definition, securitySource));