rem: gCreateInFolder = bookmarkView.outlinerBuilder.getResourceAtIndex(currentIndex).Value; 
add: gCreateInFolder = bookmarkView.treeBuilder.getResourceAtIndex(currentIndex).Value; 
context: function onOK(){  if (!document.getElementById("folderbox").hasAttribute("hidden")) {    var bookmarkView = document.getElementById("bookmarks-view");    var currentIndex = bookmarkView.currentIndex;    if (currentIndex != -1)      gCreateInFolder = bookmarkView.outlinerBuilder.getResourceAtIndex(currentIndex).Value;  }  // In Select Folder Mode, do nothing but tell our caller what  // folder was selected.   if (window.arguments[4] == "selectFolder")    window.arguments[5].selectedFolder = gCreateInFolder;  else {    // Otherwise add a bookmark to the selected folder.     const kBMDS = kRDF.GetDataSource("rdf:bookmarks");    const kBMSContractID = "@mozilla.org/browser/bookmarks-service;1";    const kBMSIID = Components.interfaces.nsIBookmarksService;    const kBMS = Components.classes[kBMSContractID].getService(kBMSIID);    var rFolder = kRDF.GetResource(gCreateInFolder, true);    const kRDFCContractID = "@mozilla.org/rdf/container;1";    const kRDFIID = Components.interfaces.nsIRDFContainer;    const kRDFC = Components.classes[kRDFCContractID].getService(kRDFIID);    try {      kRDFC.Init(kBMDS, rFolder);    }    catch (e) {      // No "NC:NewBookmarkFolder" exists, just append to the root.      rFolder = kRDF.GetResource("NC:BookmarksRoot", true);      kRDFC.Init(kBMDS, rFolder);    }    if (!gFld_URL.value) return;        // Check to see if the item is a local directory path, and if so, convert    // to a file URL so that aggregation with rdf:files works    var url = gFld_URL.value;    try {      const kLFContractID = "@mozilla.org/file/local;1";      const kLFIID = Components.interfaces.nsILocalFile;      const kLF = Components.classes[kLFContractID].createInstance(kLFIID);      kLF.initWithUnicodePath(url);      if (kLF.exists()) {          var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.classes.nsIIOService);                    url = ioService.getURLSpecFromFile(kLF);      }    }    catch (e) {    }        kBMS.createBookmarkWithDetails(gFld_Name.value, url, gBookmarkCharset, rFolder, -1);  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/d38a0937d9c93a0a9d913e2ac781e4328bb8cc73/addBookmark.js/buggy/xpfe/components/bookmarks/resources/addBookmark.js