Bug 55822 [CoolBar] CoolBarManager.setLayout is poor API
build I20040323 CoolBarManager.setLayout has a couple of problems: 1. its Javadoc talks about internals 2. it takes an ArrayList of unspec'ed element type instead of IContributionItem[] 3. it talks about order, but really it allows the whole set of items to be replaced, not just reordered. Should change to take an IContributionItem[] (and copy the array).
bundles/org.eclipse.jface/src/org/eclipse/jface/action/CoolBarManager.java
int insertAt = wrapIndicies[i] + offset;
            displayedItems.add(insertAt, new Separator(USER_SEPARATOR));
            offset++;
        }
        
        ArrayList existingVisibleRows = new ArrayList(4);
        ListIterator rowIterator = contributionList.listIterator();
        collapseSeparators(rowIterator);
        int numRow = 0;
        while (rowIterator.hasNext()) {
            
            while (rowIterator.hasNext()) {
                IContributionItem cbItem = (IContributionItem) rowIterator
                        .next();
                if (displayedItems.contains(cbItem)) {
                    existingVisibleRows.add(new Integer(numRow));
                    break;
                }
                if (cbItem.isSeparator()) {
                    break;
                }
            }
            nextRow(rowIterator, false);
            numRow++;
        }
        Iterator existingRows = existingVisibleRows.iterator();
        
        if (existingRows.hasNext()) {
            row = ((Integer) existingRows.next()).intValue();
        }