1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-30 11:43:33 +02:00

[250309] [update policy] Assertion error in VM cache update handler

[250396] [update policy] Cache prefetch does not work for the Expressions view
This commit is contained in:
Anton Leherbauer 2008-10-10 10:37:03 +00:00
parent b75a7f06bb
commit 228bfb3a4a

View file

@ -47,6 +47,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
fPath = path;
fChildren = children;
fChildIndex = 0;
assert !isDone();
}
private boolean isDone() {
return fChildIndex == fChildren.size();
@ -114,7 +115,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
private int fIndex = 0;
private TreePath fCurrentPath;
private int fLowIndex = 0;
private int fHighIndex = Integer.MAX_VALUE;
private int fHighIndex = Integer.MAX_VALUE - 1;
private int fPendingUpdates;
public MultiLevelUpdateHandler(Executor executor,
@ -135,7 +136,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
}
void startUpdate() {
fContentProvider.update(new IChildrenUpdate[] {
new VMChildrenUpdate(fCurrentPath, fViewerInput, fPresentationContext, -1, -1, this)
new VMChildrenUpdate(fCurrentPath, fViewerInput, fPresentationContext, fLowIndex, fHighIndex - fLowIndex + 1, this)
});
}
void setRange(int low, int high) {
@ -166,6 +167,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
}
}
protected void processNext() {
while (true) {
if (fIndex > fHighIndex) {
fStack.clear();
}
@ -175,14 +177,20 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
return;
}
UpdateLevel current = fStack.peek();
assert !current.isDone();
TreePath path = current.fPath;
Object data = current.nextChild();
path = path.createChildPath(data);
if (current.isDone()) {
fStack.pop();
}
if (data == null) {
// consider null children - http://bugs.eclipse.org/250309
++fIndex;
continue;
}
path = path.createChildPath(data);
if (fIndex >= fLowIndex && fIndex <= fHighIndex) {
if(data instanceof IAdaptable) {
IElementLabelProvider labelProvider = (IElementLabelProvider) ((IAdaptable)data).getAdapter(IElementLabelProvider.class);
@ -211,6 +219,6 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
});
}
}
processNext();
}
}
}