aboutsummaryrefslogtreecommitdiffstats
path: root/asm
diff options
context:
space:
mode:
authoraclement <aclement>2008-09-19 15:44:13 +0000
committeraclement <aclement>2008-09-19 15:44:13 +0000
commitb1cb2a539d016d45d231a1839887cde965754ba9 (patch)
tree84a22c866d1caff0bc04792f5cd2a5c28b5aadf1 /asm
parent683a59bd5b0da421e2be74b2d4803c5dda22869d (diff)
downloadaspectj-b1cb2a539d016d45d231a1839887cde965754ba9.tar.gz
aspectj-b1cb2a539d016d45d231a1839887cde965754ba9.zip
247742: anonymous handles: c6
Diffstat (limited to 'asm')
-rw-r--r--asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java51
1 files changed, 37 insertions, 14 deletions
diff --git a/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java b/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java
index 8b35cfbf7..c39aa0fb4 100644
--- a/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java
+++ b/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java
@@ -98,7 +98,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
}
private String getParameters(IProgramElement ipe) {
- if (ipe.getParameterSignatures() == null || ipe.getParameterSignatures().isEmpty()) {
+ if (ipe.getParameterSignatures() == null || ipe.getParameterSignatures().isEmpty()) {
return "";
}
StringBuffer sb = new StringBuffer();
@@ -178,20 +178,43 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
// depends on previous children
int count = 1;
List kids = ipe.getParent().getChildren();
- for (Iterator iterator = kids.iterator(); iterator.hasNext();) {
- IProgramElement object = (IProgramElement) iterator.next();
- if (object.equals(ipe)) {
- break;
+ if (ipe.getName().endsWith("{..}")) {
+ // only depends on previous anonymous children, name irrelevant
+ for (Iterator iterator = kids.iterator(); iterator.hasNext();) {
+ IProgramElement object = (IProgramElement) iterator.next();
+ if (object.equals(ipe)) {
+ break;
+ }
+ if (object.getKind() == ipe.getKind()) {
+ if (object.getName().endsWith("{..}")) {
+ String existingHandle = object.getHandleIdentifier();
+ int suffixPosition = existingHandle.indexOf('!');
+ if (suffixPosition != -1) {
+ count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1;
+ } else {
+ if (count == 1) {
+ count = 2;
+ }
+ }
+ }
+ }
}
- if (object.getKind() == ipe.getKind()) {
- if (object.getName().equals(ipe.getName())) {
- String existingHandle = object.getHandleIdentifier();
- int suffixPosition = existingHandle.indexOf('!');
- if (suffixPosition != -1) {
- count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1;
- } else {
- if (count == 1) {
- count = 2;
+ } else {
+ for (Iterator iterator = kids.iterator(); iterator.hasNext();) {
+ IProgramElement object = (IProgramElement) iterator.next();
+ if (object.equals(ipe)) {
+ break;
+ }
+ if (object.getKind() == ipe.getKind()) {
+ if (object.getName().equals(ipe.getName())) {
+ String existingHandle = object.getHandleIdentifier();
+ int suffixPosition = existingHandle.indexOf('!');
+ if (suffixPosition != -1) {
+ count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1;
+ } else {
+ if (count == 1) {
+ count = 2;
+ }
}
}
}