]> source.dussan.org Git - aspectj.git/commitdiff
pr194314: broken LV table, return arg name at shadow (for shadows where it makes...
authoraclement <aclement>
Mon, 12 Nov 2007 22:21:21 +0000 (22:21 +0000)
committeraclement <aclement>
Mon, 12 Nov 2007 22:21:21 +0000 (22:21 +0000)
weaver/src/org/aspectj/weaver/Shadow.java

index 1add44522c0e6e6a687b98aeb7e2ad48b1b2b36e..26f021298764d76020bc49c9048f05f07534a68d 100644 (file)
@@ -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();