aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten <mkersten>2005-04-21 17:00:18 +0000
committermkersten <mkersten>2005-04-21 17:00:18 +0000
commit7a613809e63e1a3320a7598e8d7381e70c717adc (patch)
treecdfefbf184c8888fc0cab28c9e4c11cec2bee449
parent7a639d019a9b04b3eb7af97a7a2975cbbf72e0cf (diff)
downloadaspectj-7a613809e63e1a3320a7598e8d7381e70c717adc.tar.gz
aspectj-7a613809e63e1a3320a7598e8d7381e70c717adc.zip
Fixed bug#91912 added softens / softened by relationship to ASM
-rw-r--r--asm/src/org/aspectj/asm/IRelationship.java11
-rw-r--r--weaver/src/org/aspectj/weaver/AsmRelationshipProvider.java27
2 files changed, 24 insertions, 14 deletions
diff --git a/asm/src/org/aspectj/asm/IRelationship.java b/asm/src/org/aspectj/asm/IRelationship.java
index 4a33d4fb0..41c25ba74 100644
--- a/asm/src/org/aspectj/asm/IRelationship.java
+++ b/asm/src/org/aspectj/asm/IRelationship.java
@@ -38,8 +38,6 @@ public interface IRelationship extends Serializable {
*/
public static class Kind implements Serializable {
- public static final Kind DECLARE_WARNING = new Kind("declare warning");
- public static final Kind DECLARE_ERROR = new Kind("declare error");
public static final Kind ADVICE_AROUND = new Kind("around advice");
public static final Kind ADVICE_AFTERRETURNING = new Kind("after returning advice");
public static final Kind ADVICE_AFTERTHROWING = new Kind("after throwing advice");
@@ -47,11 +45,14 @@ public interface IRelationship extends Serializable {
public static final Kind ADVICE_BEFORE = new Kind("before advice");
public static final Kind ADVICE = new Kind("advice");
public static final Kind DECLARE = new Kind("declare");
- public static final Kind DECLARE_INTER_TYPE = new Kind("inter-type declaration");
- public static final Kind USES_POINTCUT = new Kind("uses pointcut");
+ public static final Kind DECLARE_WARNING = new Kind("declare warning");
+ public static final Kind DECLARE_ERROR = new Kind("declare error");
+ public static final Kind DECLARE_SOFT = new Kind("declare soft");
+ public static final Kind DECLARE_INTER_TYPE = new Kind("inter-type declaration");
+ public static final Kind USES_POINTCUT = new Kind("uses pointcut");
public static final Kind[] ALL = {
- DECLARE_WARNING, DECLARE_ERROR,
+ DECLARE_WARNING, DECLARE_ERROR, DECLARE_SOFT,
ADVICE_AROUND,ADVICE_AFTERRETURNING,ADVICE_AFTERTHROWING,ADVICE_AFTER,ADVICE_BEFORE,
ADVICE, DECLARE, DECLARE_INTER_TYPE, USES_POINTCUT };
diff --git a/weaver/src/org/aspectj/weaver/AsmRelationshipProvider.java b/weaver/src/org/aspectj/weaver/AsmRelationshipProvider.java
index 7a1bbba43..8d3f38169 100644
--- a/weaver/src/org/aspectj/weaver/AsmRelationshipProvider.java
+++ b/weaver/src/org/aspectj/weaver/AsmRelationshipProvider.java
@@ -40,7 +40,9 @@ public class AsmRelationshipProvider {
public static final String ADVISED_BY = "advised by";
public static final String DECLARES_ON = "declares on";
public static final String DECLAREDY_BY = "declared by";
- public static final String MATCHED_BY = "matched by";
+ public static final String SOFTENS = "softens";
+ public static final String SOFTENED_BY = "softened by";
+ public static final String MATCHED_BY = "matched by";
public static final String MATCHES_DECLARE = "matches declare";
public static final String INTER_TYPE_DECLARES = "declared on";
public static final String INTER_TYPE_DECLARED_BY = "aspect declarations";
@@ -205,14 +207,21 @@ public class AsmRelationshipProvider {
if (adviceHandle != null && targetNode != null) {
if (targetNode != null) {
- String targetHandle = targetNode.getHandleIdentifier();
-
- IRelationship foreward = mapper.get(adviceHandle, IRelationship.Kind.ADVICE, ADVISES,runtimeTest,true);
- if (foreward != null) foreward.addTarget(targetHandle);//foreward.getTargets().add(targetHandle);
-
- IRelationship back = mapper.get(targetHandle, IRelationship.Kind.ADVICE, ADVISED_BY,runtimeTest,true);
- if (back != null) back.addTarget(adviceHandle);//back.getTargets().add(adviceHandle);
- }
+ String targetHandle = targetNode.getHandleIdentifier();
+ if (advice.getKind().equals(AdviceKind.Softener)) {
+ IRelationship foreward = mapper.get(adviceHandle, IRelationship.Kind.DECLARE_SOFT, SOFTENS,runtimeTest,true);
+ if (foreward != null) foreward.addTarget(targetHandle);//foreward.getTargets().add(targetHandle);
+
+ IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE, SOFTENED_BY,runtimeTest,true);
+ if (back != null) back.addTarget(adviceHandle);//back.getTargets().add(adviceHandle);
+ } else {
+ IRelationship foreward = mapper.get(adviceHandle, IRelationship.Kind.ADVICE, ADVISES,runtimeTest,true);
+ if (foreward != null) foreward.addTarget(targetHandle);//foreward.getTargets().add(targetHandle);
+
+ IRelationship back = mapper.get(targetHandle, IRelationship.Kind.ADVICE, ADVISED_BY,runtimeTest,true);
+ if (back != null) back.addTarget(adviceHandle);//back.getTargets().add(adviceHandle);
+ }
+ }
}
}