diff options
-rw-r--r-- | weaver/src/org/aspectj/weaver/Shadow.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/Shadow.java b/weaver/src/org/aspectj/weaver/Shadow.java index 1add44522..26f021298 100644 --- a/weaver/src/org/aspectj/weaver/Shadow.java +++ b/weaver/src/org/aspectj/weaver/Shadow.java @@ -187,6 +187,18 @@ public abstract class Shadow { return getSignature() .getParameterTypes().length; } + + /** + * Return name of the argument at position 'i' at this shadow. This does not + * make sense for all shadows - but can be useful in the case of, for example, + * method-execution. + * @return null if it cannot be determined + */ + public String getArgName(int i,World w) { + String [] names = getSignature().getParameterNames(w); + if (names==null || i>=names.length) return null; + return names[i]; + } public abstract UnresolvedType getEnclosingType(); |