rem:    var sip = Components.classes["@mozilla.org/supports-interface-pointer;1"] .createInstance(Components.interfaces.nsISupportsInterfacePointer); sip.data = aCalendar; sip.dataIID = Components.interfaces.calICalendar; var index = getCalendars().indexOf(sip.data); 
add: var index = getIndexForCalendar(aCalendar); 
context: function removeCalendarFromTree(aCalendar){    var calTree = document.getElementById("calendarTree")    // Special trick to compare interface pointers, since normal, ==    // comparison can fail due to javascript wrapping.    var sip = Components.classes["@mozilla.org/supports-interface-pointer;1"]                         .createInstance(Components.interfaces.nsISupportsInterfacePointer);    sip.data = aCalendar;    sip.dataIID = Components.interfaces.calICalendar;    var index = getCalendars().indexOf(sip.data);    calTree.boxObject.rowCountChanged(index, -1);    // Just select the new last row, if we removed the last listed calendar    if (index == calTree.view.rowCount-1) {        index--;    }    calTree.view.selection.select(index);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/619aa1670bc48289ef248d80f1abb1907ee1ee2b/calendar-management.js/buggy/calendar/lightning/content/calendar-management.js