diff options
author | avasseur <avasseur> | 2005-09-28 12:50:29 +0000 |
---|---|---|
committer | avasseur <avasseur> | 2005-09-28 12:50:29 +0000 |
commit | 823947e4fd021bfb1f2cd92aade1f47c8ac982a2 (patch) | |
tree | b6e25195862537cf139d515ec39da6cff8d81a91 /weaver | |
parent | e24482630a4dc558528537c87dbd3165c078cf92 (diff) | |
download | aspectj-823947e4fd021bfb1f2cd92aade1f47c8ac982a2.tar.gz aspectj-823947e4fd021bfb1f2cd92aade1f47c8ac982a2.zip |
#107953 @AfterThrowing/Returning checks when extra formal is not bound
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java index 2896d9dc6..98d9d9632 100644 --- a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java +++ b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java @@ -16,6 +16,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; +import java.util.Arrays; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.Attribute; @@ -717,10 +718,9 @@ public class AtAjAttributes { } else { // check that thrownFormal exists as the last parameter in the advice String[] pNames = owningMethod.getParameterNames(); - if (pNames == null || pNames.length == 0 || !pNames[pNames.length -1].equals(returned)) { - throw new ReturningFormalNotDeclaredInAdviceSignatureException(returned); - } - + if (pNames == null || pNames.length == 0 || !Arrays.asList(pNames).contains(returned)) { + throw new ReturningFormalNotDeclaredInAdviceSignatureException(returned); + } } } @@ -815,7 +815,7 @@ public class AtAjAttributes { } else { // check that thrownFormal exists as the last parameter in the advice String[] pNames = owningMethod.getParameterNames(); - if (pNames == null || pNames.length == 0 || !pNames[pNames.length -1].equals(thrownFormal)) { + if (pNames == null || pNames.length == 0 || !Arrays.asList(pNames).contains(thrownFormal)) { throw new ThrownFormalNotDeclaredInAdviceSignatureException(thrownFormal); } } |