rem: calComp.addSubcomponent(aItems[i].icalComponent); 
add: var item = aItems[i]; calComp.addSubcomponent(item.icalComponent); var rec = item.recurrenceInfo; if (rec != null) { var exceptions = rec.getExceptionIds({}); for each ( var exid in exceptions ) { var ex = rec.getExceptionFor(exid, false); if (ex != null) { calComp.addSubcomponent(ex.icalComponent); } } } 
context:     doWriteICS: function () {        var savedthis = this;        var listener =        {            onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail)            {                try  {                    // All events are returned. Now set up a channel and a                    // streamloader to upload.  onStopRequest will be called                    // once the write has finished                    var ioService = Components.classes                        ["@mozilla.org/network/io-service;1"]                        .getService(Components.interfaces.nsIIOService);                    var channel = ioService.newChannelFromURI(                        fixupUri(savedthis.mUri));                    // Allow the hook to add things to the channel, like a                    // header that checks etags                    savedthis.mHooks.onBeforePut(channel);                    channel.notificationCallbacks = savedthis;                    var uploadChannel = channel.QueryInterface(                        Components.interfaces.nsIUploadChannel);                    // do the actual serialization                    var icsStream = calComp.serializeToICSStream();                    uploadChannel.setUploadStream(icsStream, "text/calendar",                                                  -1);                    channel.asyncOpen(savedthis, savedthis);                } catch (ex) {                    savedthis.mObserver.onError(                        ex.result, "The calendar could not be saved; there " +                        "was a failure: 0x" + ex.result.toString(16));                }                return;            },            onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems)            {                for (var i=0; i<aCount; i++) {                    calComp.addSubcomponent(aItems[i].icalComponent);                }            }        };        var calComp = this.mICSService.createIcalComponent("VCALENDAR");        calComp.version = "2.0";        calComp.prodid = "-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN";        var i;        for (i in this.unmappedComponents) {             dump("Adding a "+this.unmappedComponents[i].componentType+"\n");             calComp.addSubcomponent(this.unmappedComponents[i]);        }        for (i in this.unmappedProperties) {             dump("Adding "+this.unmappedProperties[i].propertyName+"\n");             calComp.addProperty(this.unmappedProperties[i]);        }        this.getItems(calICalendar.ITEM_FILTER_TYPE_ALL | calICalendar.ITEM_FILTER_COMPLETED_ALL,                      0, null, null, listener);    },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/8ab2077e734d1c6d49dc4d3b9c755c02bcd48bf5/calICSCalendar.js/buggy/calendar/providers/ics/calICSCalendar.js