mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-31 04:03:27 +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:
parent
b75a7f06bb
commit
228bfb3a4a
1 changed files with 53 additions and 45 deletions
|
@ -47,6 +47,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
|
||||||
fPath = path;
|
fPath = path;
|
||||||
fChildren = children;
|
fChildren = children;
|
||||||
fChildIndex = 0;
|
fChildIndex = 0;
|
||||||
|
assert !isDone();
|
||||||
}
|
}
|
||||||
private boolean isDone() {
|
private boolean isDone() {
|
||||||
return fChildIndex == fChildren.size();
|
return fChildIndex == fChildren.size();
|
||||||
|
@ -114,7 +115,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
|
||||||
private int fIndex = 0;
|
private int fIndex = 0;
|
||||||
private TreePath fCurrentPath;
|
private TreePath fCurrentPath;
|
||||||
private int fLowIndex = 0;
|
private int fLowIndex = 0;
|
||||||
private int fHighIndex = Integer.MAX_VALUE;
|
private int fHighIndex = Integer.MAX_VALUE - 1;
|
||||||
private int fPendingUpdates;
|
private int fPendingUpdates;
|
||||||
|
|
||||||
public MultiLevelUpdateHandler(Executor executor,
|
public MultiLevelUpdateHandler(Executor executor,
|
||||||
|
@ -135,7 +136,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
|
||||||
}
|
}
|
||||||
void startUpdate() {
|
void startUpdate() {
|
||||||
fContentProvider.update(new IChildrenUpdate[] {
|
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) {
|
void setRange(int low, int high) {
|
||||||
|
@ -166,51 +167,58 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected void processNext() {
|
protected void processNext() {
|
||||||
if (fIndex > fHighIndex) {
|
while (true) {
|
||||||
fStack.clear();
|
if (fIndex > fHighIndex) {
|
||||||
}
|
fStack.clear();
|
||||||
if (fStack.isEmpty()) {
|
}
|
||||||
fRequestMonitor.setDoneCount(fPendingUpdates);
|
if (fStack.isEmpty()) {
|
||||||
super.done();
|
fRequestMonitor.setDoneCount(fPendingUpdates);
|
||||||
return;
|
super.done();
|
||||||
}
|
|
||||||
UpdateLevel current = fStack.peek();
|
|
||||||
|
|
||||||
TreePath path = current.fPath;
|
|
||||||
Object data = current.nextChild();
|
|
||||||
path = path.createChildPath(data);
|
|
||||||
|
|
||||||
if (current.isDone()) {
|
|
||||||
fStack.pop();
|
|
||||||
}
|
|
||||||
if (fIndex >= fLowIndex && fIndex <= fHighIndex) {
|
|
||||||
if(data instanceof IAdaptable) {
|
|
||||||
IElementLabelProvider labelProvider = (IElementLabelProvider) ((IAdaptable)data).getAdapter(IElementLabelProvider.class);
|
|
||||||
if (labelProvider != null) {
|
|
||||||
++fPendingUpdates;
|
|
||||||
labelProvider.update(new ILabelUpdate[] {
|
|
||||||
new DummyLabelUpdate(data, path, fRequestMonitor)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fIndex++;
|
|
||||||
if (fViewer instanceof TreeViewer) {
|
|
||||||
TreeViewer treeViewer = (TreeViewer) fViewer;
|
|
||||||
if (treeViewer.getExpandedState(data)) {
|
|
||||||
fCurrentPath = path;
|
|
||||||
fContentProvider.update(new IChildrenUpdate[] {
|
|
||||||
new VMChildrenUpdate(path, fViewerInput, fPresentationContext, -1, -1, this)
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
// update also the hasChildren flag
|
UpdateLevel current = fStack.peek();
|
||||||
++fPendingUpdates;
|
assert !current.isDone();
|
||||||
fContentProvider.update(new IHasChildrenUpdate[] {
|
|
||||||
new VMHasChildrenUpdate(path, fViewerInput, fPresentationContext, new DataRequestMonitor<Boolean>(fExecutor, fRequestMonitor))
|
TreePath path = current.fPath;
|
||||||
});
|
Object data = current.nextChild();
|
||||||
|
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);
|
||||||
|
if (labelProvider != null) {
|
||||||
|
++fPendingUpdates;
|
||||||
|
labelProvider.update(new ILabelUpdate[] {
|
||||||
|
new DummyLabelUpdate(data, path, fRequestMonitor)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fIndex++;
|
||||||
|
if (fViewer instanceof TreeViewer) {
|
||||||
|
TreeViewer treeViewer = (TreeViewer) fViewer;
|
||||||
|
if (treeViewer.getExpandedState(data)) {
|
||||||
|
fCurrentPath = path;
|
||||||
|
fContentProvider.update(new IChildrenUpdate[] {
|
||||||
|
new VMChildrenUpdate(path, fViewerInput, fPresentationContext, -1, -1, this)
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
// update also the hasChildren flag
|
||||||
|
++fPendingUpdates;
|
||||||
|
fContentProvider.update(new IHasChildrenUpdate[] {
|
||||||
|
new VMHasChildrenUpdate(path, fViewerInput, fPresentationContext, new DataRequestMonitor<Boolean>(fExecutor, fRequestMonitor))
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
processNext();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue