Fixed bug which could lead to race cond. in correlation calib.
@@ -26,6 +26,8 @@ import net.finmath.time.TimeDiscretizationInterface;
*/
public class LIBORCovarianceModelFromVolatilityAndCorrelation extends AbstractLIBORCovarianceModelParametric {
+ private static final long serialVersionUID = -2194221041462041686L;
+
private LIBORVolatilityModel volatilityModel;
private LIBORCorrelationModel correlationModel;
@@ -139,10 +141,11 @@ public class LIBORCovarianceModelFromVolatilityAndCorrelation extends AbstractLI
double[] newCorrelationParameter = new double[correlationParameter.length];
System.arraycopy(parameters, parameterIndex, newCorrelationParameter, 0, newCorrelationParameter.length);
parameterIndex += newCorrelationParameter.length;
- if(!Arrays.equals(newCorrelationParameter, correlationModel.getParameter()))
+ if(!Arrays.equals(newCorrelationParameter, correlationModel.getParameter())) {
correlationModel = ((LIBORCorrelationModel) correlationModel.clone());
correlationModel.setParameter(newCorrelationParameter);
}
+ }
return new LIBORCovarianceModelFromVolatilityAndCorrelation(this.getTimeDiscretization(), this.getLiborPeriodDiscretization(), volatilityModel, correlationModel);
}
