summaryrefslogtreecommitdiffstats
path: root/asm
diff options
context:
space:
mode:
authoraclement <aclement>2005-10-04 08:05:55 +0000
committeraclement <aclement>2005-10-04 08:05:55 +0000
commit45730680627912726919028374403612047c23e3 (patch)
tree8bddf056c74fb9b79bcd9970526e231502bb9a3c /asm
parent0fae66242efd3fd91dc7ace349cdcf7e5ebc2ade (diff)
downloadaspectj-45730680627912726919028374403612047c23e3.tar.gz
aspectj-45730680627912726919028374403612047c23e3.zip
Fix and tests for pr77269: incorrect structure model for inner types. (Patch from Helen Hawkins).
Diffstat (limited to 'asm')
-rw-r--r--asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
index cc95646cf..e1757981f 100644
--- a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
+++ b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
@@ -153,7 +153,7 @@ public class AspectJElementHierarchy implements IHierarchy {
// this searches each file for a class
for (Iterator it = packageNode.getChildren().iterator(); it.hasNext(); ) {
IProgramElement fileNode = (IProgramElement)it.next();
- IProgramElement cNode = findClassInNodes(fileNode.getChildren(), typeName);
+ IProgramElement cNode = findClassInNodes(fileNode.getChildren(), typeName, typeName);
if (cNode != null) {
ret = cNode;
typeMap.put(key,ret);
@@ -163,7 +163,7 @@ public class AspectJElementHierarchy implements IHierarchy {
return ret;
}
- private IProgramElement findClassInNodes(Collection nodes, String name) {
+ private IProgramElement findClassInNodes(Collection nodes, String name, String typeName) {
String baseName;
String innerName;
int dollar = name.indexOf('$');
@@ -179,9 +179,16 @@ public class AspectJElementHierarchy implements IHierarchy {
IProgramElement classNode = (IProgramElement)j.next();
if (baseName.equals(classNode.getName())) {
if (innerName == null) return classNode;
- else return findClassInNodes(classNode.getChildren(), innerName);
+ else return findClassInNodes(classNode.getChildren(), innerName, typeName);
} else if (name.equals(classNode.getName())) {
return classNode;
+ } else if (typeName.equals(classNode.getBytecodeSignature())) {
+ return classNode;
+ } else if (classNode.getChildren() != null && !classNode.getChildren().isEmpty()){
+ IProgramElement node = findClassInNodes(classNode.getChildren(),name, typeName);
+ if (node != null) {
+ return node;
+ }
}
}
return null;