]> source.dussan.org Git - aspectj.git/commitdiff
don't match against synthetic constructor args
authoracolyer <acolyer>
Thu, 1 Sep 2005 12:38:05 +0000 (12:38 +0000)
committeracolyer <acolyer>
Thu, 1 Sep 2005 12:38:05 +0000 (12:38 +0000)
weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java

index 2fd1eb7b64a507891c66f22180c3bc8b8ff7b559..33bcb26fce32ff6986c9f258e469ff4e1698950a 100644 (file)
@@ -107,6 +107,14 @@ public class ArgsPointcut extends NameBindingPointcut {
                                System.arraycopy(argumentsToMatchAgainst, 0, argsSubset, 0, newArgLength);
                                argumentsToMatchAgainst = argsSubset;
                        }
+               } else if (shadow.getKind() == Shadow.ConstructorExecution) {           
+                       if (shadow.getMatchingSignature().getParameterTypes().length < argumentsToMatchAgainst.length) {
+                               // there are one or more synthetic args on the end, caused by non-public itd constructor 
+                               int newArgLength = shadow.getMatchingSignature().getParameterTypes().length;
+                               ResolvedType[] argsSubset = new ResolvedType[newArgLength];
+                               System.arraycopy(argumentsToMatchAgainst, 0, argsSubset, 0, newArgLength);
+                               argumentsToMatchAgainst = argsSubset;                           
+                       }
                }
                
                return argumentsToMatchAgainst;