From: aclement Date: Thu, 9 Sep 2010 16:24:43 +0000 (+0000) Subject: 324804 X-Git-Tag: V1_6_10RC1~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6249672405e8d1303ea9087f35b72114586f0aad;p=aspectj.git 324804 --- diff --git a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java index 2f348fe02..d95fb5fbf 100644 --- a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java +++ b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java @@ -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 fileMapEntry: fileMap.entrySet()) { + for (Map.Entry fileMapEntry : fileMap.entrySet()) { s.append(fileMapEntry).append("\n"); } s.append("TypeMap:\n"); - for (Map.Entry typeMapEntry: typeMap.entrySet()) { + for (Map.Entry typeMapEntry : typeMap.entrySet()) { s.append(typeMapEntry).append("\n"); } s.append("HandleMap:\n"); - for (Map.Entry handleMapEntry: handleMap.entrySet()) { + for (Map.Entry 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 typeMapEntry: typeMap.entrySet()) { - if (typeMapEntry.getValue()==typeNode) { + for (Map.Entry 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 entry: fileMap.entrySet()) { - if (entry.getValue()==compilationUnitNode) { - k = entry.getKey();break; + for (Map.Entry 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); } }