public void run() { synchronized (SortedNodeTreeModel.this) { SortedNodeTreeModel.this.sortingTask = null; } for (Iterator i=toSort.iterator(); i.hasNext();) { VisualizerNode curr = (VisualizerNode) i.next(); SortedNodeTreeModel.this.doSortChildren(curr); } } }
public void run() { synchronized (SortedNodeTreeModel.this) { SortedNodeTreeModel.this.sortingTask = null; } for (Iterator i=toSort.iterator(); i.hasNext();) { VisualizerNode curr = (VisualizerNode) i.next(); SortedNodeTreeModel.this.doSortChildren(curr); } } }
void sortChildren (VisualizerNode parent, boolean synchronous) { //#37802 - resorts are processed too aggressively, causing //NPEs. Except for user-invoked actions (clicking the column //header, etc.), we will defer them to run later on the EQ, so //the change in the node has a chance to be fully processed if (synchronous) { synchronized (this) { if (sortingTask != null) { sortingTask.remove (parent); if (sortingTask.isEmpty()) { sortingTask = null; } } } doSortChildren (parent); } else { synchronized (this) { if (sortingTask == null) { sortingTask = new SortingTask(); SwingUtilities.invokeLater (sortingTask); } } sortingTask.add (parent); } }
void sortChildren (VisualizerNode parent, boolean synchronous) { //#37802 - resorts are processed too aggressively, causing //NPEs. Except for user-invoked actions (clicking the column //header, etc.), we will defer them to run later on the EQ, so //the change in the node has a chance to be fully processed if (synchronous) { synchronized (this) { if (sortingTask != null) { sortingTask.remove (parent); if (sortingTask.isEmpty()) { sortingTask = null; } } } doSortChildren (parent); } else { synchronized (this) { if (sortingTask == null) { sortingTask = new SortingTask(); SwingUtilities.invokeLater (sortingTask); } } sortingTask.add (parent); } }