summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-11-08 18:12:37 +0000
committeracolyer <acolyer>2005-11-08 18:12:37 +0000
commitc439e326284d2ffdf4898a50a3d0d5f6a6e99ef1 (patch)
tree0d131ffd612e3e9c6283cf22d819b2967c8d963e /runtime
parent891dc1b9504abe3d85cebc941049a07ebe3bce32 (diff)
downloadaspectj-c439e326284d2ffdf4898a50a3d0d5f6a6e99ef1.tar.gz
aspectj-c439e326284d2ffdf4898a50a3d0d5f6a6e99ef1.zip
fix for pr104220 - poor toString implementations for adviceexecution join points.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/org/aspectj/lang/JoinPoint.java2
-rw-r--r--runtime/src/org/aspectj/runtime/reflect/AdviceSignatureImpl.java20
-rw-r--r--runtime/src/org/aspectj/runtime/reflect/StringMaker.java2
3 files changed, 19 insertions, 5 deletions
diff --git a/runtime/src/org/aspectj/lang/JoinPoint.java b/runtime/src/org/aspectj/lang/JoinPoint.java
index 5640786ba..a32e995cc 100644
--- a/runtime/src/org/aspectj/lang/JoinPoint.java
+++ b/runtime/src/org/aspectj/lang/JoinPoint.java
@@ -177,6 +177,6 @@ public interface JoinPoint {
static String INITIALIZATION = "initialization";
static String EXCEPTION_HANDLER = "exception-handler";
- static String ADVICE_EXECUTION = "advice-execution"; //??? consider this vs. pcd
+ static String ADVICE_EXECUTION = "adviceexecution";
}
diff --git a/runtime/src/org/aspectj/runtime/reflect/AdviceSignatureImpl.java b/runtime/src/org/aspectj/runtime/reflect/AdviceSignatureImpl.java
index 6bf899a22..a6fbc097b 100644
--- a/runtime/src/org/aspectj/runtime/reflect/AdviceSignatureImpl.java
+++ b/runtime/src/org/aspectj/runtime/reflect/AdviceSignatureImpl.java
@@ -15,6 +15,7 @@
package org.aspectj.runtime.reflect;
import java.lang.reflect.Method;
+import java.util.StringTokenizer;
import org.aspectj.lang.reflect.AdviceSignature;
@@ -43,19 +44,30 @@ class AdviceSignatureImpl extends CodeSignatureImpl implements AdviceSignature {
}
protected String createToString(StringMaker sm) {
- //XXX this signature needs a lot of work
- StringBuffer buf = new StringBuffer("ADVICE: ");
- buf.append(sm.makeModifiersString(getModifiers()));
+ StringBuffer buf = new StringBuffer();
+// buf.append(sm.makeModifiersString(getModifiers()));
if (sm.includeArgs) buf.append(sm.makeTypeName(getReturnType()));
if (sm.includeArgs) buf.append(" ");
buf.append(sm.makePrimaryTypeName(getDeclaringType(),getDeclaringTypeName()));
buf.append(".");
- buf.append(getName());
+ buf.append(toAdviceName(getName()));
sm.addSignature(buf, getParameterTypes());
sm.addThrows(buf, getExceptionTypes());
return buf.toString();
}
+ private String toAdviceName(String methodName) {
+ if (methodName.indexOf('$') == -1) return methodName;
+ StringTokenizer strTok = new StringTokenizer(methodName,"$");
+ while (strTok.hasMoreTokens()) {
+ String token = strTok.nextToken();
+ if ( token.startsWith("before") ||
+ token.startsWith("after") ||
+ token.startsWith("around") ) return token;
+ }
+ return methodName;
+ }
+
/* (non-Javadoc)
* @see org.aspectj.runtime.reflect.MemberSignatureImpl#createAccessibleObject()
*/
diff --git a/runtime/src/org/aspectj/runtime/reflect/StringMaker.java b/runtime/src/org/aspectj/runtime/reflect/StringMaker.java
index a2a1122c0..941bc822f 100644
--- a/runtime/src/org/aspectj/runtime/reflect/StringMaker.java
+++ b/runtime/src/org/aspectj/runtime/reflect/StringMaker.java
@@ -16,6 +16,8 @@ package org.aspectj.runtime.reflect;
import java.lang.reflect.Modifier;
+import org.aspectj.lang.JoinPoint;
+
class StringMaker {
boolean shortTypeNames = true;
boolean includeArgs = true;