GitHub PullRequestReviewCommentEvent at 2014-09-29 09:50:24
Repository: OG-Platform
Actor: marc-opengamma
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/comments/18145270","id":18145270,"diff_hunk":"@@ -0,0 +1,609 @@\n+/**\n+ * Copyright (C) 2014 - present by OpenGamma Inc. and the OpenGamma group of companies\n+ * \n+ * Please see distribution for license.\n+ */\n+package com.opengamma.analytics.financial.instrument.payment;\n+\n+import static org.testng.AssertJUnit.assertEquals;\n+import static org.testng.AssertJUnit.assertFalse;\n+import static org.testng.AssertJUnit.assertTrue;\n+\n+import org.testng.annotations.Test;\n+import org.threeten.bp.Period;\n+import org.threeten.bp.ZonedDateTime;\n+\n+import com.opengamma.OpenGammaRuntimeException;\n+import com.opengamma.analytics.financial.instrument.index.IborIndex;\n+import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixed;\n+import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixedFxReset;\n+import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponIborFxReset;\n+import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponIborSpread;\n+import com.opengamma.analytics.financial.interestrate.payments.derivative.Payment;\n+import com.opengamma.analytics.financial.schedule.ScheduleCalculator;\n+import com.opengamma.analytics.util.time.TimeCalculator;\n+import com.opengamma.financial.convention.businessday.BusinessDayConvention;\n+import com.opengamma.financial.convention.businessday.BusinessDayConventions;\n+import com.opengamma.financial.convention.calendar.Calendar;\n+import com.opengamma.financial.convention.calendar.MondayToFridayCalendar;\n+import com.opengamma.financial.convention.daycount.DayCount;\n+import com.opengamma.financial.convention.daycount.DayCounts;\n+import com.opengamma.timeseries.DoubleTimeSeries;\n+import com.opengamma.timeseries.precise.zdt.ImmutableZonedDateTimeDoubleTimeSeries;\n+import com.opengamma.util.money.Currency;\n+import com.opengamma.util.test.TestGroup;\n+import com.opengamma.util.time.DateUtils;\n+\n+/**\n+ * Tests CouponIborFxResetDefinition.\n+ */\n+@Test(groups = TestGroup.UNIT)\n+@SuppressWarnings(\"unchecked\")\n+public class CouponIborFxResetDefinitionTest {\n+\n+  private static final Period TENOR = Period.ofMonths(3);\n+  private static final int SETTLEMENT_DAYS = 2;\n+  private static final Calendar CALENDAR = new MondayToFridayCalendar(\"A\");\n+  private static final DayCount DAY_COUNT_INDEX = DayCounts.ACT_360;\n+  private static final BusinessDayConvention BUSINESS_DAY = BusinessDayConventions.MODIFIED_FOLLOWING;\n+  private static final boolean IS_EOM = true;\n+  private static final Currency CUR = Currency.EUR;\n+  private static final IborIndex INDEX = new IborIndex(CUR, TENOR, SETTLEMENT_DAYS, DAY_COUNT_INDEX, BUSINESS_DAY,\n+      IS_EOM, \"Deprecated\");\n+\n+  private static final Currency CUR_REF = Currency.EUR;\n+  private static final Currency CUR_PAY = Currency.USD;\n+  private static final ZonedDateTime PAYMENT_DATE = DateUtils.getUTCDate(2011, 4, 7);\n+  private static final ZonedDateTime ACCRUAL_START_DATE = DateUtils.getUTCDate(2011, 1, 6);\n+  private static final ZonedDateTime ACCRUAL_END_DATE = DateUtils.getUTCDate(2011, 4, 6);\n+  private static final ZonedDateTime FX_FIXING_DATE = DateUtils.getUTCDate(2011, 1, 3);\n+  private static final ZonedDateTime FX_DELIVERY_DATE = DateUtils.getUTCDate(2011, 1, 6);\n+  private static final double ACCRUAL_FACTOR = 0.267;\n+  private static final double NOTIONAL = 1000000; //1m\n+  private static final double SPREAD = -0.001; // -10 bps\n+\n+  private static final ZonedDateTime FIXING_DATE_SAME_AS_FX = DateUtils.getUTCDate(2011, 1, 3);\n+  private static final CouponIborFxResetDefinition CPN_SAME_FIXING_DATES = new CouponIborFxResetDefinition(CUR_PAY,\n+      PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, ACCRUAL_FACTOR, NOTIONAL, FIXING_DATE_SAME_AS_FX, INDEX,\n+      SPREAD, CALENDAR, CUR_REF, FX_FIXING_DATE, FX_DELIVERY_DATE);\n+\n+  private static final ZonedDateTime FIXING_DATE_AFTER_FX = FIXING_DATE_SAME_AS_FX.plusDays(2);\n+  private static final CouponIborFxResetDefinition CPN_FX_FIXED_FIRST = new CouponIborFxResetDefinition(CUR_PAY,\n+      PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, ACCRUAL_FACTOR, NOTIONAL, FIXING_DATE_AFTER_FX, INDEX,\n+      SPREAD, CALENDAR, CUR_REF, FX_FIXING_DATE, FX_DELIVERY_DATE);\n+\n+  private static final ZonedDateTime FIXING_DATE_BEFORE_FX = FIXING_DATE_SAME_AS_FX.minusDays(2);\n+  private static final CouponIborFxResetDefinition CPN_INDEX_FIXED_FIRST = new CouponIborFxResetDefinition(CUR_PAY,\n+      PAYMENT_DATE, ACCRUAL_START_DATE, ACCRUAL_END_DATE, ACCRUAL_FACTOR, NOTIONAL, FIXING_DATE_BEFORE_FX, INDEX,\n+      SPREAD, CALENDAR, CUR_REF, FX_FIXING_DATE, FX_DELIVERY_DATE);\n+\n+  private static final double FX_FIXING_RATE = 1.40;\n+  private static final DoubleTimeSeries<ZonedDateTime> FX_FIXING_TS_10 =\n+      ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(\n+          new ZonedDateTime[] {FX_FIXING_DATE.minusDays(11), FX_FIXING_DATE.minusDays(10) },\n+          new double[] {1.38, 1.39 });\n+  private static final DoubleTimeSeries<ZonedDateTime> FX_FIXING_TS_1 =\n+      ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(\n+          new ZonedDateTime[] {FX_FIXING_DATE.minusDays(2), FX_FIXING_DATE.minusDays(1) },\n+          new double[] {1.38, 1.39 });\n+  private static final DoubleTimeSeries<ZonedDateTime> FX_FIXING_TS_0 =\n+      ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(\n+          new ZonedDateTime[] {FX_FIXING_DATE.minusDays(2), FX_FIXING_DATE.minusDays(1), FX_FIXING_DATE },\n+          new double[] {1.38, 1.39, FX_FIXING_RATE });\n+\n+  private static final double FIXING_RATE = 0.04;\n+  private static final DoubleTimeSeries<ZonedDateTime> INDEX_FIXING_TS_SAME = ImmutableZonedDateTimeDoubleTimeSeries\n+      .ofUTC(new ZonedDateTime[] {FIXING_DATE_SAME_AS_FX }, new double[] {FIXING_RATE });\n+  private static final DoubleTimeSeries<ZonedDateTime> INDEX_FIXING_TS_AFTER_FX = ImmutableZonedDateTimeDoubleTimeSeries\n+      .ofUTC(new ZonedDateTime[] {FIXING_DATE_AFTER_FX }, new double[] {FIXING_RATE });\n+  private static final DoubleTimeSeries<ZonedDateTime> INDEX_FIXING_TS_BEFORE_FX = ImmutableZonedDateTimeDoubleTimeSeries\n+      .ofUTC(new ZonedDateTime[] {FIXING_DATE_BEFORE_FX }, new double[] {FIXING_RATE });\n+  private static final DoubleTimeSeries<ZonedDateTime> INDEX_FIXING_TS_OLD = ImmutableZonedDateTimeDoubleTimeSeries\n+      .ofUTC(new ZonedDateTime[] {FIXING_DATE_BEFORE_FX.minusDays(10) }, new double[] {FIXING_RATE });\n+\n+  private static final double TOLERANCE_AMOUNT = 1.0E-6;\n+\n+  /**\n+   * \n+   */\n+  @Test\n+  public void testGetter() {\n+    ZonedDateTime expFixingPeriodStartDate = ScheduleCalculator.getAdjustedDate(FIXING_DATE_SAME_AS_FX,\n+        INDEX.getSpotLag(), CALENDAR);\n+    ZonedDateTime expFixingPeriodEndDate = ScheduleCalculator.getAdjustedDate(expFixingPeriodStartDate,\n+        INDEX.getTenor(), INDEX.getBusinessDayConvention(), CALENDAR, INDEX.isEndOfMonth());\n+\n+    CouponIborFxResetDefinition cpnRe = new CouponIborFxResetDefinition(CUR_PAY, PAYMENT_DATE, ACCRUAL_START_DATE,\n+        ACCRUAL_END_DATE, ACCRUAL_FACTOR, NOTIONAL, FX_FIXING_DATE, expFixingPeriodStartDate, expFixingPeriodEndDate,\n+        INDEX.getDayCount().getDayCountFraction(expFixingPeriodStartDate, expFixingPeriodEndDate, CALENDAR), INDEX,\n+        SPREAD, CALENDAR, CUR_REF, FX_FIXING_DATE, FX_DELIVERY_DATE);\n+    assertEquals(cpnRe, CPN_SAME_FIXING_DATES);\n+\n+    assertEquals(NOTIONAL, CPN_SAME_FIXING_DATES.getNotional(), TOLERANCE_AMOUNT);\n+    assertEquals(FIXING_DATE_SAME_AS_FX, CPN_SAME_FIXING_DATES.getFixingDate());\n+    assertEquals(SPREAD, CPN_SAME_FIXING_DATES.getSpread(), TOLERANCE_AMOUNT);\n+    assertEquals(PAYMENT_DATE, CPN_SAME_FIXING_DATES.getPaymentDate());\n+    assertEquals(ACCRUAL_START_DATE, CPN_SAME_FIXING_DATES.getAccrualStartDate());\n+    assertEquals(ACCRUAL_END_DATE, CPN_SAME_FIXING_DATES.getAccrualEndDate());\n+    assertEquals(CALENDAR, CPN_SAME_FIXING_DATES.getCalendar());\n+\n+    assertEquals(expFixingPeriodStartDate, CPN_SAME_FIXING_DATES.getFixingPeriodStartDate());\n+    assertEquals(expFixingPeriodEndDate, CPN_SAME_FIXING_DATES.getFixingPeriodEndDate());\n+    assertEquals(INDEX.getDayCount().getDayCountFraction(expFixingPeriodStartDate, expFixingPeriodEndDate, CALENDAR),\n+        CPN_SAME_FIXING_DATES.getFixingPeriodAccrualFactor());\n+    assertEquals(CUR_REF, CPN_SAME_FIXING_DATES.getReferenceCurrency());\n+    assertEquals(FX_FIXING_DATE, CPN_SAME_FIXING_DATES.getFxFixingDate());\n+    assertEquals(FX_DELIVERY_DATE, CPN_SAME_FIXING_DATES.getFxDeliveryDate());\n+  }\n+\n+  /**\n+   * Without time series\n+   */\n+  @Test\n+  public void toDerivativeWithoughtHts() {\n+    ZonedDateTime valuationDate = FX_FIXING_DATE.minusDays(10);\n+    double fixingPeriodStartTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_SAME_FIXING_DATES.getFixingPeriodStartDate());\n+    double fixingPeriodEndTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_SAME_FIXING_DATES.getFixingPeriodEndDate());\n+    double paymentTime = TimeCalculator.getTimeBetween(valuationDate, PAYMENT_DATE);\n+    double fixingTime = TimeCalculator.getTimeBetween(valuationDate, FX_FIXING_DATE);\n+    double deliveryTime = TimeCalculator.getTimeBetween(valuationDate, FX_DELIVERY_DATE);\n+    CouponIborFxReset cpnExpected = new CouponIborFxReset(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL, fixingTime,\n+        INDEX, fixingPeriodStartTime, fixingPeriodEndTime, CPN_SAME_FIXING_DATES.getFixingPeriodAccrualFactor(),\n+        SPREAD, CUR, fixingTime,\n+        deliveryTime);\n+    CouponIborFxReset cpnConverted = CPN_SAME_FIXING_DATES.toDerivative(valuationDate);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnExpected, cpnConverted);\n+  }\n+\n+  /**\n+   * valuationDate is before FX fixing data, and before index fixing date\n+   */\n+  @Test\n+  public void toDerivativeBeforeFxBeforeIndex() {\n+    ZonedDateTime valuationDate = FX_FIXING_DATE.minusDays(10);\n+    double fixingPeriodStartTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_SAME_FIXING_DATES.getFixingPeriodStartDate());\n+    double fixingPeriodEndTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_SAME_FIXING_DATES.getFixingPeriodEndDate());\n+    double paymentTime = TimeCalculator.getTimeBetween(valuationDate, PAYMENT_DATE);\n+    double fixingTime = TimeCalculator.getTimeBetween(valuationDate, FX_FIXING_DATE);\n+    double deliveryTime = TimeCalculator.getTimeBetween(valuationDate, FX_DELIVERY_DATE);\n+    CouponIborFxReset cpnExpected = new CouponIborFxReset(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL, fixingTime,\n+        INDEX, fixingPeriodStartTime, fixingPeriodEndTime, CPN_SAME_FIXING_DATES.getFixingPeriodAccrualFactor(),\n+        SPREAD, CUR, fixingTime, deliveryTime);\n+    DoubleTimeSeries<ZonedDateTime>[] htsArray = new DoubleTimeSeries[] {INDEX_FIXING_TS_SAME, FX_FIXING_TS_10 };\n+    Payment cpnConverted = CPN_SAME_FIXING_DATES.toDerivative(valuationDate, htsArray);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnExpected, cpnConverted);\n+  }\n+\n+  /**\n+   * valuationDate is on FX fixing data, and on index fixing date\n+   */\n+  @Test\n+  public void toDerivativeOnFxOnIndex() {\n+    ZonedDateTime valuationDate = FX_FIXING_DATE;\n+    double fixingTime = TimeCalculator.getTimeBetween(valuationDate, CPN_SAME_FIXING_DATES.getFixingDate());\n+    double fixingPeriodStartTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_SAME_FIXING_DATES.getFixingPeriodStartDate());\n+    double fixingPeriodEndTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_SAME_FIXING_DATES.getFixingPeriodEndDate());\n+    double paymentTime = TimeCalculator.getTimeBetween(valuationDate, PAYMENT_DATE);\n+    double fxFixingTime = TimeCalculator.getTimeBetween(valuationDate, FX_FIXING_DATE);\n+    double fXDeliveryTime = TimeCalculator.getTimeBetween(valuationDate, FX_DELIVERY_DATE);\n+\n+    /*\n+     * FX rate, index Rate, not available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithoutFxRateWithoutIndex = new DoubleTimeSeries[] {\n+        INDEX_FIXING_TS_BEFORE_FX, FX_FIXING_TS_1 };\n+    CouponIborFxReset cpnWithoutFxIndexExpected = new CouponIborFxReset(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL,\n+        fixingTime, INDEX, fixingPeriodStartTime, fixingPeriodEndTime,\n+        CPN_SAME_FIXING_DATES.getFixingPeriodAccrualFactor(), SPREAD, CUR, fxFixingTime, fXDeliveryTime);\n+    Payment cpnConvertedWithoutFxIndex = CPN_SAME_FIXING_DATES.toDerivative(valuationDate,\n+        htsArrayWithoutFxRateWithoutIndex);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithoutFxIndexExpected, cpnConvertedWithoutFxIndex);\n+\n+    /*\n+     * FX rate available, index Rate not available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithFxRateWithoutIndex = new DoubleTimeSeries[] {\n+        INDEX_FIXING_TS_BEFORE_FX, FX_FIXING_TS_0 };\n+    CouponIborSpread cpnWithFxExpected = new CouponIborSpread(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL *\n+        FX_FIXING_RATE, fixingTime, INDEX, fixingPeriodStartTime, fixingPeriodEndTime,\n+        CPN_SAME_FIXING_DATES.getFixingPeriodAccrualFactor(), SPREAD);\n+    Payment cpnConvertedWithFx = CPN_SAME_FIXING_DATES.toDerivative(valuationDate, htsArrayWithFxRateWithoutIndex);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithFxExpected, cpnConvertedWithFx);\n+\n+    /*\n+     * FX rate not available, index Rate available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithoutFxRateWithIndex = new DoubleTimeSeries[] {\n+        INDEX_FIXING_TS_SAME, FX_FIXING_TS_1 };\n+    CouponFixedFxReset cpnWithIndexExpected = new CouponFixedFxReset(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL,\n+        FIXING_RATE + SPREAD, CUR_REF, fxFixingTime, fXDeliveryTime);\n+    Payment cpnConvertedWithIndex = CPN_SAME_FIXING_DATES.toDerivative(valuationDate, htsArrayWithoutFxRateWithIndex);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithIndexExpected, cpnConvertedWithIndex);\n+\n+    /*\n+     * FX rate, index Rate available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithFxRateIndex = new DoubleTimeSeries[] {\n+        INDEX_FIXING_TS_SAME, FX_FIXING_TS_0 };\n+    CouponFixed cpnWithFxIndexExpected = new CouponFixed(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL *\n+        FX_FIXING_RATE, FIXING_RATE + SPREAD);\n+    Payment cpnConvertedWithFxIndex = CPN_SAME_FIXING_DATES.toDerivative(valuationDate, htsArrayWithFxRateIndex);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithFxIndexExpected, cpnConvertedWithFxIndex);\n+  }\n+\n+  /**\n+   * valuationDate is after FX fixing data, and after index fixing date\n+   */\n+  @Test\n+  public void toDerivativeAfterFxAfterIndex() {\n+    ZonedDateTime valuationDate = FX_FIXING_DATE.plusDays(1);\n+    double paymentTime = TimeCalculator.getTimeBetween(valuationDate, PAYMENT_DATE);\n+\n+    DoubleTimeSeries<ZonedDateTime>[] htsArray = new DoubleTimeSeries[] {INDEX_FIXING_TS_SAME, FX_FIXING_TS_0 };\n+    CouponFixed cpnWithFxIndexExpected = new CouponFixed(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL *\n+        FX_FIXING_RATE, FIXING_RATE + SPREAD);\n+    Payment cpnConvertedWithFxIndex = CPN_SAME_FIXING_DATES.toDerivative(valuationDate, htsArray);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithFxIndexExpected, cpnConvertedWithFxIndex);\n+  }\n+\n+  /**\n+   * valuationDate is on FX fixing data, but before index fixing date\n+   */\n+  @Test\n+  public void toDerivativeOnFxBeforeIndex() {\n+    ZonedDateTime valuationDate = FX_FIXING_DATE;\n+    double fixingTime = TimeCalculator.getTimeBetween(valuationDate, CPN_FX_FIXED_FIRST.getFixingDate());\n+    double fixingPeriodStartTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_FX_FIXED_FIRST.getFixingPeriodStartDate());\n+    double fixingPeriodEndTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_FX_FIXED_FIRST.getFixingPeriodEndDate());\n+    double paymentTime = TimeCalculator.getTimeBetween(valuationDate, PAYMENT_DATE);\n+    double fxFixingTime = TimeCalculator.getTimeBetween(valuationDate, FX_FIXING_DATE);\n+    double fXDeliveryTime = TimeCalculator.getTimeBetween(valuationDate, FX_DELIVERY_DATE);\n+\n+    /*\n+     * FX rate not available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithoutFxRate = new DoubleTimeSeries[] {INDEX_FIXING_TS_AFTER_FX,\n+        FX_FIXING_TS_1 };\n+    CouponIborFxReset cpnWithoutFxRateExpected = new CouponIborFxReset(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL,\n+        fixingTime, INDEX, fixingPeriodStartTime, fixingPeriodEndTime,\n+        CPN_FX_FIXED_FIRST.getFixingPeriodAccrualFactor(), SPREAD, CUR, fxFixingTime, fXDeliveryTime);\n+    Payment cpnConvertedWithoutFxRate = CPN_FX_FIXED_FIRST.toDerivative(valuationDate, htsArrayWithoutFxRate);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithoutFxRateExpected, cpnConvertedWithoutFxRate);\n+\n+    /*\n+     * FX rate available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithFxRate = new DoubleTimeSeries[] {INDEX_FIXING_TS_AFTER_FX,\n+        FX_FIXING_TS_0 };\n+    CouponIborSpread cpnWithFxRateExpected = new CouponIborSpread(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL *\n+        FX_FIXING_RATE, fixingTime, INDEX, fixingPeriodStartTime, fixingPeriodEndTime,\n+        CPN_FX_FIXED_FIRST.getFixingPeriodAccrualFactor(), SPREAD);\n+    Payment cpnConvertedWithFxRate = CPN_FX_FIXED_FIRST.toDerivative(valuationDate, htsArrayWithFxRate);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithFxRateExpected, cpnConvertedWithFxRate);\n+  }\n+\n+  /**\n+   * valuationDate is on FX fixing data, but after index fixing date\n+   */\n+  @Test\n+  public void toDerivativeOnFxAfterIndex() {\n+    ZonedDateTime valuationDate = FX_FIXING_DATE;\n+    double paymentTime = TimeCalculator.getTimeBetween(valuationDate, PAYMENT_DATE);\n+    double fxFixingTime = TimeCalculator.getTimeBetween(valuationDate, FX_FIXING_DATE);\n+    double fXDeliveryTime = TimeCalculator.getTimeBetween(valuationDate, FX_DELIVERY_DATE);\n+\n+    /*\n+     * FX rate not available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithoutFxRate = new DoubleTimeSeries[] {INDEX_FIXING_TS_BEFORE_FX,\n+        FX_FIXING_TS_1 };\n+    CouponFixedFxReset cpnWithIndexExpected = new CouponFixedFxReset(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL,\n+        FIXING_RATE + SPREAD, CUR_REF, fxFixingTime, fXDeliveryTime);\n+    Payment cpnConvertedWithIndex = CPN_INDEX_FIXED_FIRST.toDerivative(valuationDate, htsArrayWithoutFxRate);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithIndexExpected, cpnConvertedWithIndex);\n+\n+    /*\n+     * FX rate available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithFxRate = new DoubleTimeSeries[] {INDEX_FIXING_TS_BEFORE_FX,\n+        FX_FIXING_TS_0 };\n+    CouponFixed cpnWithFxIndexExpected = new CouponFixed(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL *\n+        FX_FIXING_RATE, FIXING_RATE + SPREAD);\n+    Payment cpnConvertedWithFxIndex = CPN_INDEX_FIXED_FIRST.toDerivative(valuationDate, htsArrayWithFxRate);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithFxIndexExpected, cpnConvertedWithFxIndex);\n+  }\n+\n+  /**\n+   * valuationDate is before FX fixing data, but on index fixing date\n+   */\n+  @Test\n+  public void toDerivativeBeforeFxOnIndex() {\n+    ZonedDateTime valuationDate = FIXING_DATE_BEFORE_FX;\n+    double fixingTime = TimeCalculator.getTimeBetween(valuationDate, CPN_INDEX_FIXED_FIRST.getFixingDate());\n+    double fixingPeriodStartTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_INDEX_FIXED_FIRST.getFixingPeriodStartDate());\n+    double fixingPeriodEndTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_INDEX_FIXED_FIRST.getFixingPeriodEndDate());\n+    double paymentTime = TimeCalculator.getTimeBetween(valuationDate, PAYMENT_DATE);\n+    double fxFixingTime = TimeCalculator.getTimeBetween(valuationDate, FX_FIXING_DATE);\n+    double fXDeliveryTime = TimeCalculator.getTimeBetween(valuationDate, FX_DELIVERY_DATE);\n+\n+    /*\n+     * index not available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithoutIndex = new DoubleTimeSeries[] {\n+        INDEX_FIXING_TS_OLD, FX_FIXING_TS_10 };\n+    CouponIborFxReset cpnWithoutIndexExpected = new CouponIborFxReset(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL,\n+        fixingTime, INDEX, fixingPeriodStartTime, fixingPeriodEndTime,\n+        CPN_INDEX_FIXED_FIRST.getFixingPeriodAccrualFactor(), SPREAD, CUR, fxFixingTime, fXDeliveryTime);\n+    Payment cpnConvertedWithoutIndex = CPN_INDEX_FIXED_FIRST.toDerivative(valuationDate, htsArrayWithoutIndex);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithoutIndexExpected, cpnConvertedWithoutIndex);\n+\n+    /*\n+     * Index available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithIndex = new DoubleTimeSeries[] {\n+        INDEX_FIXING_TS_BEFORE_FX, FX_FIXING_TS_10 };\n+    CouponFixedFxReset cpnWithIndexExpected = new CouponFixedFxReset(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL,\n+        FIXING_RATE + SPREAD, CUR_REF, fxFixingTime, fXDeliveryTime);\n+    Payment cpnConvertedWithIndex = CPN_INDEX_FIXED_FIRST.toDerivative(valuationDate, htsArrayWithIndex);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithIndexExpected, cpnConvertedWithIndex);\n+  }\n+\n+  /**\n+   * valuationDate is after FX fixing data, but on index fixing date\n+   */\n+  @Test\n+  public void toDerivativeAfterFxOnIndex() {\n+    ZonedDateTime valuationDate = FIXING_DATE_AFTER_FX;\n+    double fixingTime = TimeCalculator.getTimeBetween(valuationDate, CPN_FX_FIXED_FIRST.getFixingDate());\n+    double fixingPeriodStartTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_FX_FIXED_FIRST.getFixingPeriodStartDate());\n+    double fixingPeriodEndTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_FX_FIXED_FIRST.getFixingPeriodEndDate());\n+    double paymentTime = TimeCalculator.getTimeBetween(valuationDate, PAYMENT_DATE);\n+\n+    /*\n+     * Index not available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithFxRateWithoutIndex = new DoubleTimeSeries[] {\n+        INDEX_FIXING_TS_SAME, FX_FIXING_TS_0 };\n+    CouponIborSpread cpnWithFxExpected = new CouponIborSpread(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL *\n+        FX_FIXING_RATE, fixingTime, INDEX, fixingPeriodStartTime, fixingPeriodEndTime,\n+        CPN_FX_FIXED_FIRST.getFixingPeriodAccrualFactor(), SPREAD);\n+    Payment cpnConvertedWithFx = CPN_FX_FIXED_FIRST.toDerivative(valuationDate, htsArrayWithFxRateWithoutIndex);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithFxExpected, cpnConvertedWithFx);\n+    \n+    /*\n+     * Index available\n+     */\n+    DoubleTimeSeries<ZonedDateTime>[] htsArrayWithFxRateIndex = new DoubleTimeSeries[] {\n+        INDEX_FIXING_TS_AFTER_FX, FX_FIXING_TS_0 };\n+    CouponFixed cpnWithFxIndexExpected = new CouponFixed(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL *\n+        FX_FIXING_RATE, FIXING_RATE + SPREAD);\n+    Payment cpnConvertedWithFxIndex = CPN_FX_FIXED_FIRST.toDerivative(valuationDate, htsArrayWithFxRateIndex);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithFxIndexExpected, cpnConvertedWithFxIndex);\n+  }\n+\n+  /**\n+   * valuationDate is before FX fixing data, but after index fixing date\n+   */\n+  @Test\n+  public void toDerivativeBeforeFxAfterIndex() {\n+    ZonedDateTime valuationDate = FX_FIXING_DATE.minusDays(1);\n+    double paymentTime = TimeCalculator.getTimeBetween(valuationDate, PAYMENT_DATE);\n+    double fxFixingTime = TimeCalculator.getTimeBetween(valuationDate, FX_FIXING_DATE);\n+    double fXDeliveryTime = TimeCalculator.getTimeBetween(valuationDate, FX_DELIVERY_DATE);\n+\n+    DoubleTimeSeries<ZonedDateTime>[] htsArray = new DoubleTimeSeries[] {\n+        INDEX_FIXING_TS_BEFORE_FX, FX_FIXING_TS_1 };\n+    CouponFixedFxReset cpnWithIndexExpected = new CouponFixedFxReset(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL,\n+        FIXING_RATE + SPREAD, CUR_REF, fxFixingTime, fXDeliveryTime);\n+    Payment cpnConvertedWithIndex = CPN_INDEX_FIXED_FIRST.toDerivative(valuationDate, htsArray);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithIndexExpected, cpnConvertedWithIndex);\n+  }\n+\n+  /**\n+   * valuationDate is after FX fixing data, but before index fixing date\n+   */\n+  @Test\n+  public void toDerivativeAfterFxBeforeIndex() {\n+    ZonedDateTime valuationDate = FX_FIXING_DATE.plusDays(1);\n+    double fixingTime = TimeCalculator.getTimeBetween(valuationDate, CPN_FX_FIXED_FIRST.getFixingDate());\n+    double fixingPeriodStartTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_FX_FIXED_FIRST.getFixingPeriodStartDate());\n+    double fixingPeriodEndTime = TimeCalculator.getTimeBetween(valuationDate,\n+        CPN_FX_FIXED_FIRST.getFixingPeriodEndDate());\n+    double paymentTime = TimeCalculator.getTimeBetween(valuationDate, PAYMENT_DATE);\n+\n+    DoubleTimeSeries<ZonedDateTime>[] htsArray = new DoubleTimeSeries[] {\n+        INDEX_FIXING_TS_AFTER_FX, FX_FIXING_TS_0 };\n+    CouponIborSpread cpnWithFxExpected = new CouponIborSpread(CUR_PAY, paymentTime, ACCRUAL_FACTOR, NOTIONAL *\n+        FX_FIXING_RATE, fixingTime, INDEX, fixingPeriodStartTime, fixingPeriodEndTime,\n+        CPN_FX_FIXED_FIRST.getFixingPeriodAccrualFactor(), SPREAD);\n+    Payment cpnConvertedWithFx = CPN_FX_FIXED_FIRST.toDerivative(valuationDate, htsArray);\n+    assertEquals(\"CouponIborFxResetDefinition: toDerivative\", cpnWithFxExpected, cpnConvertedWithFx);\n+  }\n+  \n+  /**\n+   * \n+   */","path":"projects/OG-Analytics/src/test/java/com/opengamma/analytics/financial/instrument/payment/CouponIborFxResetDefinitionTest.java","position":438,"original_position":438,"commit_id":"2c80d57e420a37fc83ac63b60f55238fa1b1b83f","original_commit_id":"2c80d57e420a37fc83ac63b60f55238fa1b1b83f","user":{"login":"marc-opengamma","id":644983,"avatar_url":"https://avatars.githubusercontent.com/u/644983?v=2","gravatar_id":"","url":"https://api.github.com/users/marc-opengamma","html_url":"https://github.com/marc-opengamma","followers_url":"https://api.github.com/users/marc-opengamma/followers","following_url":"https://api.github.com/users/marc-opengamma/following{/other_user}","gists_url":"https://api.github.com/users/marc-opengamma/gists{/gist_id}","starred_url":"https://api.github.com/users/marc-opengamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marc-opengamma/subscriptions","organizations_url":"https://api.github.com/users/marc-opengamma/orgs","repos_url":"https://api.github.com/users/marc-opengamma/repos","events_url":"https://api.github.com/users/marc-opengamma/events{/privacy}","received_events_url":"https://api.github.com/users/marc-opengamma/received_events","type":"User","site_admin":false},"body":"Add java doc or remove comments.","created_at":"2014-09-29T09:50:24Z","updated_at":"2014-09-29T09:50:24Z","html_url":"https://github.com/OpenGamma/OG-Platform/pull/216#discussion_r18145270","pull_request_url":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/216","_links":{"self":{"href":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/comments/18145270"},"html":{"href":"https://github.com/OpenGamma/OG-Platform/pull/216#discussion_r18145270"},"pull_request":{"href":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/216"}}},"pull_request":{"url":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/216","id":21860505,"html_url":"https://github.com/OpenGamma/OG-Platform/pull/216","diff_url":"https://github.com/OpenGamma/OG-Platform/pull/216.diff","patch_url":"https://github.com/OpenGamma/OG-Platform/pull/216.patch","issue_url":"https://api.github.com/repos/OpenGamma/OG-Platform/issues/216","number":216,"state":"open","locked":false,"title":"Topic/plt 430","user":{"login":"yukiiwashita","id":3006656,"avatar_url":"https://avatars.githubusercontent.com/u/3006656?v=2","gravatar_id":"","url":"https://api.github.com/users/yukiiwashita","html_url":"https://github.com/yukiiwashita","followers_url":"https://api.github.com/users/yukiiwashita/followers","following_url":"https://api.github.com/users/yukiiwashita/following{/other_user}","gists_url":"https://api.github.com/users/yukiiwashita/gists{/gist_id}","starred_url":"https://api.github.com/users/yukiiwashita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yukiiwashita/subscriptions","organizations_url":"https://api.github.com/users/yukiiwashita/orgs","repos_url":"https://api.github.com/users/yukiiwashita/repos","events_url":"https://api.github.com/users/yukiiwashita/events{/privacy}","received_events_url":"https://api.github.com/users/yukiiwashita/received_events","type":"User","site_admin":false},"body":"* Added **CouponIborFxResetDefinition** as an extension of **CouponDefinition** since the toDerivative method requires two sets of historical time series. \r\n* Added **CouponIborFxReset**.\r\n* Implemented **CouponIborFxResetDiscountingMethod** for PV, PV sensitivity and currency exposure. ","created_at":"2014-09-26T16:46:14Z","updated_at":"2014-09-29T09:50:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ce52114b10a99625e1600564072c14e8cc0aa24","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/216/commits","review_comments_url":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/216/comments","review_comment_url":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OpenGamma/OG-Platform/issues/216/comments","statuses_url":"https://api.github.com/repos/OpenGamma/OG-Platform/statuses/2c80d57e420a37fc83ac63b60f55238fa1b1b83f","head":{"label":"OpenGamma:topic/PLT-430","ref":"topic/PLT-430","sha":"2c80d57e420a37fc83ac63b60f55238fa1b1b83f","user":{"login":"OpenGamma","id":120064,"avatar_url":"https://avatars.githubusercontent.com/u/120064?v=2","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"repo":{"id":933698,"name":"OG-Platform","full_name":"OpenGamma/OG-Platform","owner":{"login":"OpenGamma","id":120064,"avatar_url":"https://avatars.githubusercontent.com/u/120064?v=2","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenGamma/OG-Platform","description":"The core OpenGamma Platform wrapper project","fork":false,"url":"https://api.github.com/repos/OpenGamma/OG-Platform","forks_url":"https://api.github.com/repos/OpenGamma/OG-Platform/forks","keys_url":"https://api.github.com/repos/OpenGamma/OG-Platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenGamma/OG-Platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenGamma/OG-Platform/teams","hooks_url":"https://api.github.com/repos/OpenGamma/OG-Platform/hooks","issue_events_url":"https://api.github.com/repos/OpenGamma/OG-Platform/issues/events{/number}","events_url":"https://api.github.com/repos/OpenGamma/OG-Platform/events","assignees_url":"https://api.github.com/repos/OpenGamma/OG-Platform/assignees{/user}","branches_url":"https://api.github.com/repos/OpenGamma/OG-Platform/branches{/branch}","tags_url":"https://api.github.com/repos/OpenGamma/OG-Platform/tags","blobs_url":"https://api.github.com/repos/OpenGamma/OG-Platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenGamma/OG-Platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenGamma/OG-Platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenGamma/OG-Platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenGamma/OG-Platform/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenGamma/OG-Platform/languages","stargazers_url":"https://api.github.com/repos/OpenGamma/OG-Platform/stargazers","contributors_url":"https://api.github.com/repos/OpenGamma/OG-Platform/contributors","subscribers_url":"https://api.github.com/repos/OpenGamma/OG-Platform/subscribers","subscription_url":"https://api.github.com/repos/OpenGamma/OG-Platform/subscription","commits_url":"https://api.github.com/repos/OpenGamma/OG-Platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenGamma/OG-Platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenGamma/OG-Platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenGamma/OG-Platform/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenGamma/OG-Platform/contents/{+path}","compare_url":"https://api.github.com/repos/OpenGamma/OG-Platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenGamma/OG-Platform/merges","archive_url":"https://api.github.com/repos/OpenGamma/OG-Platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenGamma/OG-Platform/downloads","issues_url":"https://api.github.com/repos/OpenGamma/OG-Platform/issues{/number}","pulls_url":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenGamma/OG-Platform/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenGamma/OG-Platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenGamma/OG-Platform/labels{/name}","releases_url":"https://api.github.com/repos/OpenGamma/OG-Platform/releases{/id}","created_at":"2010-09-23T15:47:12Z","updated_at":"2014-09-10T10:39:36Z","pushed_at":"2014-09-26T16:34:23Z","git_url":"git://github.com/OpenGamma/OG-Platform.git","ssh_url":"git@github.com:OpenGamma/OG-Platform.git","clone_url":"https://github.com/OpenGamma/OG-Platform.git","svn_url":"https://github.com/OpenGamma/OG-Platform","homepage":"http://developers.opengamma.com/","size":788166,"stargazers_count":180,"watchers_count":180,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":107,"mirror_url":null,"open_issues_count":12,"forks":107,"open_issues":12,"watchers":180,"default_branch":"master"}},"base":{"label":"OpenGamma:develop","ref":"develop","sha":"85f7ddb9c94b936eee4a08712cf2d48e3fbeac95","user":{"login":"OpenGamma","id":120064,"avatar_url":"https://avatars.githubusercontent.com/u/120064?v=2","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"repo":{"id":933698,"name":"OG-Platform","full_name":"OpenGamma/OG-Platform","owner":{"login":"OpenGamma","id":120064,"avatar_url":"https://avatars.githubusercontent.com/u/120064?v=2","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenGamma/OG-Platform","description":"The core OpenGamma Platform wrapper project","fork":false,"url":"https://api.github.com/repos/OpenGamma/OG-Platform","forks_url":"https://api.github.com/repos/OpenGamma/OG-Platform/forks","keys_url":"https://api.github.com/repos/OpenGamma/OG-Platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenGamma/OG-Platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenGamma/OG-Platform/teams","hooks_url":"https://api.github.com/repos/OpenGamma/OG-Platform/hooks","issue_events_url":"https://api.github.com/repos/OpenGamma/OG-Platform/issues/events{/number}","events_url":"https://api.github.com/repos/OpenGamma/OG-Platform/events","assignees_url":"https://api.github.com/repos/OpenGamma/OG-Platform/assignees{/user}","branches_url":"https://api.github.com/repos/OpenGamma/OG-Platform/branches{/branch}","tags_url":"https://api.github.com/repos/OpenGamma/OG-Platform/tags","blobs_url":"https://api.github.com/repos/OpenGamma/OG-Platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenGamma/OG-Platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenGamma/OG-Platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenGamma/OG-Platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenGamma/OG-Platform/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenGamma/OG-Platform/languages","stargazers_url":"https://api.github.com/repos/OpenGamma/OG-Platform/stargazers","contributors_url":"https://api.github.com/repos/OpenGamma/OG-Platform/contributors","subscribers_url":"https://api.github.com/repos/OpenGamma/OG-Platform/subscribers","subscription_url":"https://api.github.com/repos/OpenGamma/OG-Platform/subscription","commits_url":"https://api.github.com/repos/OpenGamma/OG-Platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenGamma/OG-Platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenGamma/OG-Platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenGamma/OG-Platform/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenGamma/OG-Platform/contents/{+path}","compare_url":"https://api.github.com/repos/OpenGamma/OG-Platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenGamma/OG-Platform/merges","archive_url":"https://api.github.com/repos/OpenGamma/OG-Platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenGamma/OG-Platform/downloads","issues_url":"https://api.github.com/repos/OpenGamma/OG-Platform/issues{/number}","pulls_url":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenGamma/OG-Platform/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenGamma/OG-Platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenGamma/OG-Platform/labels{/name}","releases_url":"https://api.github.com/repos/OpenGamma/OG-Platform/releases{/id}","created_at":"2010-09-23T15:47:12Z","updated_at":"2014-09-10T10:39:36Z","pushed_at":"2014-09-26T16:34:23Z","git_url":"git://github.com/OpenGamma/OG-Platform.git","ssh_url":"git@github.com:OpenGamma/OG-Platform.git","clone_url":"https://github.com/OpenGamma/OG-Platform.git","svn_url":"https://github.com/OpenGamma/OG-Platform","homepage":"http://developers.opengamma.com/","size":788166,"stargazers_count":180,"watchers_count":180,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":107,"mirror_url":null,"open_issues_count":12,"forks":107,"open_issues":12,"watchers":180,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/216"},"html":{"href":"https://github.com/OpenGamma/OG-Platform/pull/216"},"issue":{"href":"https://api.github.com/repos/OpenGamma/OG-Platform/issues/216"},"comments":{"href":"https://api.github.com/repos/OpenGamma/OG-Platform/issues/216/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/216/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OpenGamma/OG-Platform/pulls/216/commits"},"statuses":{"href":"https://api.github.com/repos/OpenGamma/OG-Platform/statuses/2c80d57e420a37fc83ac63b60f55238fa1b1b83f"}}}}