diff options
author | aclement <aclement> | 2009-02-04 21:19:59 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-02-04 21:19:59 +0000 |
commit | 1ddce9bd6611ca86047af27ba04ce0e6849ede2c (patch) | |
tree | be8034d1b4ffba363966ceeefc03bcba0af44b1d /asm | |
parent | b8a9c0463f679c5cd681c724c5e9cf1518e1813b (diff) | |
download | aspectj-1ddce9bd6611ca86047af27ba04ce0e6849ede2c.tar.gz aspectj-1ddce9bd6611ca86047af27ba04ce0e6849ede2c.zip |
263666: missing counter for around advice differing in return type
Diffstat (limited to 'asm')
-rw-r--r-- | asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java b/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java index fb825fade..5f60331ba 100644 --- a/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java +++ b/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java @@ -156,6 +156,11 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { int count = 1; List kids = ipe.getParent().getChildren(); String ipeSig = ipe.getBytecodeSignature(); + // remove return type from the signature - it should not be included in the comparison + int idx = 0; + if (ipeSig != null && ((idx = ipeSig.indexOf(")")) != -1)) { + ipeSig = ipeSig.substring(0, idx); + } for (Iterator iterator = kids.iterator(); iterator.hasNext();) { IProgramElement object = (IProgramElement) iterator.next(); if (object.equals(ipe)) { @@ -164,6 +169,9 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { if (object.getKind() == ipe.getKind()) { if (object.getName().equals(ipe.getName())) { String sig1 = object.getBytecodeSignature(); + if (sig1 != null && (idx = sig1.indexOf(")")) != -1) { + sig1 = sig1.substring(0, idx); + } if (sig1 == null && ipeSig == null || (sig1 != null && sig1.equals(ipeSig))) { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.indexOf('!'); @@ -204,7 +212,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.lastIndexOf('!'); int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter - if (suffixPosition != -1 && lastSquareBracket<suffixPosition) { // pr260384 + if (suffixPosition != -1 && lastSquareBracket < suffixPosition) { // pr260384 count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1; } else { if (count == 1) { @@ -225,7 +233,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.lastIndexOf('!'); int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter - if (suffixPosition != -1 && lastSquareBracket<suffixPosition) { // pr260384 + if (suffixPosition != -1 && lastSquareBracket < suffixPosition) { // pr260384 count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1; } else { if (count == 1) { |