TreeUi: unhandled index not ready warning on update node descriptor

This commit is contained in:
Kirill Kalishev
2010-02-10 15:27:35 +03:00
parent 86f3440d47
commit 4f0221a986
@@ -780,8 +780,14 @@ public class AbstractTreeUi {
}
private boolean _update(NodeDescriptor nodeDescriptor) {
nodeDescriptor.setUpdateCount(nodeDescriptor.getUpdateCount() + 1);
return getBuilder().updateNodeDescriptor(nodeDescriptor);
try {
nodeDescriptor.setUpdateCount(nodeDescriptor.getUpdateCount() + 1);
return getBuilder().updateNodeDescriptor(nodeDescriptor);
}
catch (IndexNotReadyException e) {
warnOnIndexNotReady();
return false;
}
}
private void assertIsDispatchThread() {
@@ -1283,10 +1289,7 @@ public class AbstractTreeUi {
passOne = getTreeStructure().getChildElements(element);
}
catch (IndexNotReadyException e) {
if (!myWasEverIndexNotReady) {
myWasEverIndexNotReady = true;
LOG.warn("Tree is not dumb-mode-aware; treeBuilder=" + getBuilder() + " treeStructure=" + getTreeStructure());
}
warnOnIndexNotReady();
return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
@@ -1315,6 +1318,13 @@ public class AbstractTreeUi {
return passOne;
}
private void warnOnIndexNotReady() {
if (!myWasEverIndexNotReady) {
myWasEverIndexNotReady = true;
LOG.warn("Tree is not dumb-mode-aware; treeBuilder=" + getBuilder() + " treeStructure=" + getTreeStructure());
}
}
private void updateNodesToInsert(final ArrayList<TreeNode> nodesToInsert,
TreeUpdatePass pass,
boolean canSmartExpand,