diff options
author | acolyer <acolyer> | 2003-02-26 16:19:14 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2003-02-26 16:19:14 +0000 |
commit | aa7e7a63ee3ac1ab1c3cab155539231aa0e42260 (patch) | |
tree | 0fe17bac83d0df4dedb4fefc920b663a20bd3d35 /asm | |
parent | 1da530069c8b755a7310e83dd05e5ba753d2085c (diff) | |
download | aspectj-aa7e7a63ee3ac1ab1c3cab155539231aa0e42260.tar.gz aspectj-aa7e7a63ee3ac1ab1c3cab155539231aa0e42260.zip |
Improved formatting of toString for LinkNodes
Diffstat (limited to 'asm')
-rw-r--r-- | asm/src/org/aspectj/asm/LinkNode.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/asm/src/org/aspectj/asm/LinkNode.java b/asm/src/org/aspectj/asm/LinkNode.java index 72f02cb1b..5f43f0426 100644 --- a/asm/src/org/aspectj/asm/LinkNode.java +++ b/asm/src/org/aspectj/asm/LinkNode.java @@ -44,11 +44,22 @@ public class LinkNode extends StructureNode { if (programElementNode.getProgramElementKind().equals(ProgramElementNode.Kind.ADVICE) || programElementNode.getProgramElementKind().equals(ProgramElementNode.Kind.INTRODUCTION) || programElementNode.getProgramElementKind().equals(ProgramElementNode.Kind.CODE)) { - return programElementNode.parent.toString() + ": " + programElementNode.getName(); + name = programElementNode.parent.toString() + ": " + programElementNode.getName(); + StructureNode grandparent = programElementNode.parent.parent; + if ( grandparent instanceof ProgramElementNode ) { + ProgramElementNode pe_grandparent = (ProgramElementNode)grandparent; + if ( pe_grandparent.getProgramElementKind().equals(ProgramElementNode.Kind.CLASS) || + pe_grandparent.getProgramElementKind().equals(ProgramElementNode.Kind.INTERFACE) + ) { + name = pe_grandparent.toString() + "." + name; + } + } + } else if (programElementNode.isMemberKind()) { - return programElementNode.parent.toString() + '.' + programElementNode.getName(); + name = programElementNode.parent.toString() + '.' + programElementNode.getName(); } else { - return programElementNode.toString(); + name = programElementNode.toString(); } + return name; } } |