mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-16 13:35:22 +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:
parent
7c7d4c5918
commit
5f3384b6fe
1 changed files with 3 additions and 2 deletions
|
@ -537,10 +537,11 @@ public class CommandCache implements ICommandListener
|
||||||
public void reset(IDMContext dmc) {
|
public void reset(IDMContext dmc) {
|
||||||
if (dmc == null) {
|
if (dmc == null) {
|
||||||
fCachedContexts.clear();
|
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();
|
IDMContext keyDmc = itr.next();
|
||||||
if (keyDmc != null && DMContexts.isAncestorOf(keyDmc, dmc)) {
|
if (keyDmc != null && (dmc.equals(keyDmc) || DMContexts.isAncestorOf(keyDmc, dmc))) {
|
||||||
itr.remove();
|
itr.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue