Browse Source

324804

tags/V1_6_10RC1
aclement 13 years ago
parent
commit
6249672405
1 changed files with 23 additions and 19 deletions
  1. 23
    19
      asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java

+ 23
- 19
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java View File

@@ -61,22 +61,22 @@ public class AspectJElementHierarchy implements IHierarchy {
public IProgramElement getRoot() {
return root;
}
public String toSummaryString() {
StringBuilder s = new StringBuilder();
s.append("FileMap has "+fileMap.size()+" entries\n");
s.append("HandleMap has "+handleMap.size()+" entries\n");
s.append("TypeMap has "+handleMap.size()+" entries\n");
s.append("FileMap has " + fileMap.size() + " entries\n");
s.append("HandleMap has " + handleMap.size() + " entries\n");
s.append("TypeMap has " + handleMap.size() + " entries\n");
s.append("FileMap:\n");
for (Map.Entry<String,IProgramElement> fileMapEntry: fileMap.entrySet()) {
for (Map.Entry<String, IProgramElement> fileMapEntry : fileMap.entrySet()) {
s.append(fileMapEntry).append("\n");
}
s.append("TypeMap:\n");
for (Map.Entry<String,IProgramElement> typeMapEntry: typeMap.entrySet()) {
for (Map.Entry<String, IProgramElement> typeMapEntry : typeMap.entrySet()) {
s.append(typeMapEntry).append("\n");
}
s.append("HandleMap:\n");
for (Map.Entry<String,IProgramElement> handleMapEntry: handleMap.entrySet()) {
for (Map.Entry<String, IProgramElement> handleMapEntry : handleMap.entrySet()) {
s.append(handleMapEntry).append("\n");
}
return s.toString();
@@ -599,31 +599,32 @@ public class AspectJElementHierarchy implements IHierarchy {
public void flushFileMap() {
fileMap.clear();
}
public void forget(IProgramElement compilationUnitNode,IProgramElement typeNode) {
public void forget(IProgramElement compilationUnitNode, IProgramElement typeNode) {
String k = null;
synchronized (this) {
// handle map
// type map
for (Map.Entry<String,IProgramElement> typeMapEntry: typeMap.entrySet()) {
if (typeMapEntry.getValue()==typeNode) {
for (Map.Entry<String, IProgramElement> typeMapEntry : typeMap.entrySet()) {
if (typeMapEntry.getValue() == typeNode) {
k = typeMapEntry.getKey();
break;
}
}
if (k!=null) {
if (k != null) {
typeMap.remove(k);
}
}
if (compilationUnitNode!=null) {
if (compilationUnitNode != null) {
k = null;
for (Map.Entry<String,IProgramElement> entry: fileMap.entrySet()) {
if (entry.getValue()==compilationUnitNode) {
k = entry.getKey();break;
for (Map.Entry<String, IProgramElement> entry : fileMap.entrySet()) {
if (entry.getValue() == compilationUnitNode) {
k = entry.getKey();
break;
}
}
if (k!=null) {
if (k != null) {
fileMap.remove(k);
}
}
@@ -638,7 +639,10 @@ public class AspectJElementHierarchy implements IHierarchy {
k = handleMap.keySet();
for (String handle : k) {
IProgramElement ipe = handleMap.get(handle);
if (deletedFiles.contains(getCanonicalFilePath(ipe))) {
if (ipe == null) {
System.err.println("handleMap expectation not met, where is the IPE for " + handle);
}
if (ipe == null || deletedFiles.contains(getCanonicalFilePath(ipe))) {
forRemoval.add(handle);
}
}

Loading…
Cancel
Save