1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-02 22:55:26 +02:00

Bug 243487 The reset(IDMContext) method clears descendants of the specified context but not the context itself.

Also, a return was missing.
This commit is contained in:
Marc Khouzam 2008-08-07 20:08:38 +00:00
parent 7c7d4c5918
commit 5f3384b6fe

View file

@ -537,10 +537,11 @@ public class CommandCache implements ICommandListener
public void reset(IDMContext dmc) {
if (dmc == null) {
fCachedContexts.clear();
return;
}
for (Iterator<IDMContext> itr = fCachedContexts.keySet().iterator(); itr.hasNext();) {
for (Iterator<IDMContext> itr = fCachedContexts.keySet().iterator(); itr.hasNext();) {
IDMContext keyDmc = itr.next();
if (keyDmc != null && DMContexts.isAncestorOf(keyDmc, dmc)) {
if (keyDmc != null && (dmc.equals(keyDmc) || DMContexts.isAncestorOf(keyDmc, dmc))) {
itr.remove();
}
}