From a1c251df1f0ade186946b18d68a16c10bcbc84f2 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 26 Apr 2011 16:10:56 +0000 Subject: [PATCH] 343001: testcode and fix: when faulting in binary aspects, fill in decp parents --- .../aspectj/weaver/model/AsmRelationshipProvider.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java b/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java index 6971cc9e0..3fe24739b 100644 --- a/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java +++ b/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java @@ -50,6 +50,7 @@ import org.aspectj.weaver.bcel.BcelTypeMunger; import org.aspectj.weaver.patterns.DeclareErrorOrWarning; import org.aspectj.weaver.patterns.DeclareParents; import org.aspectj.weaver.patterns.Pointcut; +import org.aspectj.weaver.patterns.TypePatternList; public class AsmRelationshipProvider { @@ -786,9 +787,19 @@ public class AsmRelationshipProvider { IProgramElement decpElement = new ProgramElement(model, "declare parents", IProgramElement.Kind.DECLARE_PARENTS, getBinarySourceLocation(decp.getDeclaringType(), decp.getSourceLocation()), Modifier.PUBLIC, null, Collections.EMPTY_LIST); + setParentTypesOnDeclareParentsNode(decp, decpElement); return decpElement; } + private static void setParentTypesOnDeclareParentsNode(DeclareParents decp, IProgramElement decpElement) { + TypePatternList tpl = decp.getParents(); + List parents = new ArrayList(); + for (int i = 0; i < tpl.size(); i++) { + parents.add(tpl.get(i).getExactType().getName().replaceAll("\\$", ".")); + } + decpElement.setParentTypes(parents); + } + public static String getHandle(AsmManager asm, Advice advice) { if (null == advice.handle) { ISourceLocation sl = advice.getSourceLocation(); -- 2.39.5