From 85c1fe016165b66d8fa5f124504d2888ba184d76 Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Tue, 19 Feb 2008 17:43:29 +0000 Subject: [PATCH] [219107] Fixed a logic error in VM cache which caused incomplete updates occasionally. --- .../viewmodel/update/AbstractCachingVMProvider.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java index fa14d97b2a1..ae68fb748fb 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java @@ -358,7 +358,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa { // Workaround for a bug caused by an optimization in the viewer: // 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 // Instead of checking getStatus().isOK(), check getData() != null. if(getData() != null) { @@ -382,9 +382,10 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa for(int j = 0; j < getData().size(); j++) { int offset = updateOffset + j; Object child = getData().get(j); - - entry.fChildren.put(offset, child); - update.setChild(child, offset); + if (child != null) { + entry.fChildren.put(offset, child); + update.setChild(child, offset); + } } } update.done(); @@ -411,11 +412,10 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa } // 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); if (child != null) { update.setChild(entry.fChildren.get(position), position); - } else { childrenMissingFromCache.remove(position); } }