Index: TreeTableView.java =================================================================== RCS file: /cvs/openide/src/org/openide/explorer/view/TreeTableView.java,v retrieving revision 1.50.14.1 diff -c -r1.50.14.1 TreeTableView.java *** TreeTableView.java 20 Nov 2003 12:59:45 -0000 1.50.14.1 --- TreeTableView.java 6 Dec 2003 10:53:54 -0000 *************** *** 1030,1036 **** return rowComparator; } ! void sortChildren (VisualizerNode parent) { final Comparator comparator = getRowComparator(); if (comparator == null || parent == null) { return; --- 1030,1066 ---- return rowComparator; } ! void sortChildren(final VisualizerNode parent) { ! //issue 37802, coalesce multiple changes that would trigger resorts ! //and run after changes are done, as long as code making the changes ! //holds the AWT tree lock ! if (Thread.holdsLock(getTreeLock())) { ! if (sorters.get(parent) == null) { ! DelayedSorter ds = new DelayedSorter(parent); ! sorters.put(parent, ds); ! SwingUtilities.invokeLater(ds); ! } ! } else { ! _sortChildren(parent); ! } ! } ! ! private java.util.Hashtable sorters = new java.util.Hashtable(); ! private class DelayedSorter implements Runnable { ! private VisualizerNode parent; ! public DelayedSorter(VisualizerNode parent) { ! this.parent = parent; ! } ! public void run() { ! synchronized (getTreeLock()) { ! System.err.println("Delayed sorter running"); ! _sortChildren(parent); ! } ! sorters.remove(parent); ! } ! } ! ! void _sortChildren (VisualizerNode parent) { final Comparator comparator = getRowComparator(); if (comparator == null || parent == null) { return;