diff options
author | aclement <aclement> | 2009-02-04 20:21:31 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-02-04 20:21:31 +0000 |
commit | f8ab145f9ba1edea907db7a78a7c3ff25cd28e4d (patch) | |
tree | 000e5c2b2a79663b18335589f7208cbe50010140 | |
parent | f8979069c23d3e1f430c8a553ca332486f62671c (diff) | |
download | aspectj-f8ab145f9ba1edea907db7a78a7c3ff25cd28e4d.tar.gz aspectj-f8ab145f9ba1edea907db7a78a7c3ff25cd28e4d.zip |
263487: test and fix
-rw-r--r-- | asm/src/org/aspectj/asm/AsmManager.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/asm/src/org/aspectj/asm/AsmManager.java b/asm/src/org/aspectj/asm/AsmManager.java index b67cfb4f4..1ddfd6c5e 100644 --- a/asm/src/org/aspectj/asm/AsmManager.java +++ b/asm/src/org/aspectj/asm/AsmManager.java @@ -831,7 +831,7 @@ public class AsmManager implements IStructureModel { throw new RuntimeException("target can't be null!"); if (type == null) throw new RuntimeException("type can't be null!"); - if (target.getKind().isSourceFile()) { + if (target.getKind().isSourceFile() || target.getKind().isFile()) { // isFile() covers pr263487 // @AJ aspect with broken relationship endpoint - we couldn't find // the real // endpoint (the declare parents or ITD or similar) so defaulted to @@ -854,10 +854,16 @@ public class AsmManager implements IStructureModel { return false; return (target.getSourceLocation().getSourceFile().equals(type.getSourceLocation().getSourceFile())); } - while (!containingType.getKind().isType()) { - // System.err.println("Checked: "+containingType.getKind()+" "+ - // containingType); - containingType = containingType.getParent(); + try { + while (!containingType.getKind().isType()) { + containingType = containingType.getParent(); + } + } catch (Throwable t) { + // Example: + // java.lang.RuntimeException: Exception whilst walking up from target X.class kind=(file) + // hid=(=importProb/binaries<x(X.class) + throw new RuntimeException("Exception whilst walking up from target " + target.toLabelString() + " kind=(" + + target.getKind() + ") hid=(" + target.getHandleIdentifier() + ")", t); } return (type.equals(containingType)); } |