aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authormkersten <mkersten>2003-08-14 17:18:34 +0000
committermkersten <mkersten>2003-08-14 17:18:34 +0000
commit56d4d719ba6e1ff20efe3f1003aa8eec8d5b88a2 (patch)
tree98aed82a88fcdef2d0aaf660ce44f9ec8bb8896d /weaver
parentb5d8b449c79cbedc82e03381cc459ae8c8ae9718 (diff)
downloadaspectj-56d4d719ba6e1ff20efe3f1003aa8eec8d5b88a2.tar.gz
aspectj-56d4d719ba6e1ff20efe3f1003aa8eec8d5b88a2.zip
Improved declare relationships. Implemented batch-build relationship clearing policy.
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/AsmAdviceRelationshipProvider.java36
1 files changed, 15 insertions, 21 deletions
diff --git a/weaver/src/org/aspectj/weaver/AsmAdviceRelationshipProvider.java b/weaver/src/org/aspectj/weaver/AsmAdviceRelationshipProvider.java
index 577957069..59f65ed8d 100644
--- a/weaver/src/org/aspectj/weaver/AsmAdviceRelationshipProvider.java
+++ b/weaver/src/org/aspectj/weaver/AsmAdviceRelationshipProvider.java
@@ -13,11 +13,10 @@
package org.aspectj.weaver;
-import java.io.IOException;
import java.util.*;
import org.aspectj.asm.*;
-import org.aspectj.asm.internal.*;
+import org.aspectj.asm.internal.ProgramElement;
import org.aspectj.bridge.*;
public class AsmAdviceRelationshipProvider {
@@ -40,28 +39,23 @@ public class AsmAdviceRelationshipProvider {
}
IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
IProgramElement targetNode = getNode(AsmManager.getDefault().getHierarchy(), shadow);
- try {
- if (advice.getSourceLocation() != null && targetNode != null) {
- String adviceHandle =
- advice.getSourceLocation().getSourceFile().getCanonicalPath()
- + IProgramElement.ID_DELIM + advice.getSourceLocation().getLine()
- + IProgramElement.ID_DELIM + advice.getSourceLocation().getColumn();
-
-
-
- if (targetNode != null) {
- String targetHandle = targetNode.getHandleIdentifier();
+ if (advice.getSourceLocation() != null && targetNode != null) {
+ String adviceHandle = ProgramElement.createHandleIdentifier(
+ advice.getSourceLocation().getSourceFile(),
+ advice.getSourceLocation().getLine(),
+ advice.getSourceLocation().getColumn());
+
+ if (targetNode != null) {
+ String targetHandle = targetNode.getHandleIdentifier();
+
+ IRelationship foreward = mapper.get(adviceHandle, IRelationship.Kind.ADVICE, ADVISES);
+ if (foreward != null) foreward.getTargets().add(targetHandle);
- IRelationship foreward = mapper.get(adviceHandle, IRelationship.Kind.ADVICE, ADVISES);
- if (foreward != null) foreward.getTargets().add(targetHandle);
-
- IRelationship back = mapper.get(targetHandle, IRelationship.Kind.ADVICE, ADVISED_BY);
- if (back != null) back.getTargets().add(adviceHandle);
- }
+ IRelationship back = mapper.get(targetHandle, IRelationship.Kind.ADVICE, ADVISED_BY);
+ if (back != null) back.getTargets().add(adviceHandle);
}
- } catch (IOException e) {
- e.printStackTrace();
}
+
}
}