mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[219107] Fixed a logic error in VM cache which caused incomplete updates occasionally.
This commit is contained in:
parent
895d9764ca
commit
85c1fe0161
1 changed files with 6 additions and 6 deletions
|
@ -358,7 +358,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
{
|
{
|
||||||
// Workaround for a bug caused by an optimization in the viewer:
|
// Workaround for a bug caused by an optimization in the viewer:
|
||||||
// The viewer may request more children then there are at a given level.
|
// The viewer may request more children then there are at a given level.
|
||||||
// This caues the update to return with an error.
|
// This causes the update to return with an error.
|
||||||
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=202109
|
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=202109
|
||||||
// Instead of checking getStatus().isOK(), check getData() != null.
|
// Instead of checking getStatus().isOK(), check getData() != null.
|
||||||
if(getData() != null) {
|
if(getData() != null) {
|
||||||
|
@ -382,11 +382,12 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
for(int j = 0; j < getData().size(); j++) {
|
for(int j = 0; j < getData().size(); j++) {
|
||||||
int offset = updateOffset + j;
|
int offset = updateOffset + j;
|
||||||
Object child = getData().get(j);
|
Object child = getData().get(j);
|
||||||
|
if (child != null) {
|
||||||
entry.fChildren.put(offset, child);
|
entry.fChildren.put(offset, child);
|
||||||
update.setChild(child, offset);
|
update.setChild(child, offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
update.done();
|
update.done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -411,11 +412,10 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill in the known children from cache.
|
// Fill in the known children from cache.
|
||||||
for(int position = update.getOffset(); position < update.getOffset() + update.getLength(); position++) {
|
for(Integer position = update.getOffset(); position < update.getOffset() + update.getLength(); position++) {
|
||||||
Object child = entry.fChildren.get(position);
|
Object child = entry.fChildren.get(position);
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
update.setChild(entry.fChildren.get(position), position);
|
update.setChild(entry.fChildren.get(position), position);
|
||||||
} else {
|
|
||||||
childrenMissingFromCache.remove(position);
|
childrenMissingFromCache.remove(position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue