diff options
author | aclement <aclement> | 2006-05-11 07:24:45 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-05-11 07:24:45 +0000 |
commit | 519880eefc4d3bc1467c8c20fb5c284271c10f4f (patch) | |
tree | e040a3824af5ef17cc5c3223388ca20c530d5b58 /asm | |
parent | c625e91d4fc0875a636d366dd0bae181739193fe (diff) | |
download | aspectj-519880eefc4d3bc1467c8c20fb5c284271c10f4f.tar.gz aspectj-519880eefc4d3bc1467c8c20fb5c284271c10f4f.zip |
134471 - incremental structure model repair code overhaul - repair the filemap and typemap in addition to the handle map (long standing bug!)
Diffstat (limited to 'asm')
-rw-r--r-- | asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java index 7839b3abd..b32391c42 100644 --- a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java +++ b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java @@ -406,6 +406,7 @@ public class AspectJElementHierarchy implements IHierarchy { fileMap.clear(); } + // TODO rename this method ... it does more than just the handle map public void updateHandleMap(Set deletedFiles) { // Only delete the entries we need to from the handle map - for performance reasons List forRemoval = new ArrayList(); @@ -418,6 +419,29 @@ public class AspectJElementHierarchy implements IHierarchy { String handle = (String) iter.next(); handleMap.remove(handle); } + forRemoval.clear(); + k = typeMap.keySet(); + for (Iterator iter = k.iterator(); iter.hasNext();) { + String element = (String) iter.next(); + IProgramElement ipe = (IProgramElement)typeMap.get(element); + if (deletedFiles.contains(getFilename(ipe.getHandleIdentifier()))) forRemoval.add(element); + } + for (Iterator iter = forRemoval.iterator(); iter.hasNext();) { + String handle = (String) iter.next(); + typeMap.remove(handle); + } + forRemoval.clear(); + k = fileMap.keySet(); + for (Iterator iter = k.iterator(); iter.hasNext();) { + String element = (String) iter.next(); + IProgramElement ipe = (IProgramElement)fileMap.get(element); + if (deletedFiles.contains(getFilename(ipe.getHandleIdentifier()))) forRemoval.add(element); + } + for (Iterator iter = forRemoval.iterator(); iter.hasNext();) { + String handle = (String) iter.next(); + fileMap.remove(handle); + } + } // XXX shouldn't be aware of the delimiter |