A bug in add() method of PeriodList

roy zhu
  • roy zhu

    roy zhu - 2009-11-04

    I'm using **ical4j-1.0-rc2**. I found there is a bug when add a period list to another. Consider the following example,

    PeriodList pList1 = new PeriodList();

    PeriodList pList2 = new PeriodList();


    The combined period list is not assigned to the pList1. Could someone look into this issue?

    **PeriodList.java (line: 215)**

    **public final PeriodList add(final PeriodList periods) { … }**

  • Alexander Klimetschek

    I think this is right - it will return a new list with both lists combined. Maybe the javadoc could be a bit more clearer.


  • Ben Fortuna

    Ben Fortuna - 2009-11-14

    I've updated the javadoc to hopefully make this a bit clearer:

         * A convenience method that combines all the periods in the specified list to
         * this list. The result returned is a new PeriodList instance, except where
         * no periods are specified in the arguments. In such cases this instance is returned.
         * Normalisation is also performed automatically after all periods have been added.
         * @param periods a list of periods to add
         * @return a period list instance



Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks