]> source.dussan.org Git - aspectj.git/commitdiff
283657: fix
authoraclement <aclement>
Fri, 17 Jul 2009 21:29:55 +0000 (21:29 +0000)
committeraclement <aclement>
Fri, 17 Jul 2009 21:29:55 +0000 (21:29 +0000)
asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java

index 1772fbf19b0ee148632c742dc4632b3747777ace..074ab932131cc0acbfb8d689ba10d48fa5b1e628 100644 (file)
@@ -158,7 +158,33 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
                // TODO could optimize this code
                char[] byteCodeName = ipe.getBytecodeName().toCharArray();
 
-               if (ipe.getKind().isDeclareAnnotation()) {
+               if (ipe.getKind().isInterTypeMember()) {
+                       int count = 1;
+                       List kids = ipe.getParent().getChildren();
+                       int idx = 0;
+                       for (Iterator iterator = kids.iterator(); iterator.hasNext();) {
+                               IProgramElement object = (IProgramElement) iterator.next();
+                               if (object.equals(ipe)) {
+                                       break;
+                               }
+                               if (object.getKind().isInterTypeMember()) {
+                                       if (object.getName().equals(ipe.getName()) && getParameters(object).equals(getParameters(ipe))) {
+                                               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 (count > 1) {
+                               return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray());
+                       }
+               } else if (ipe.getKind().isDeclareAnnotation()) {
                        // look at peer declares
                        int count = 1;
                        List kids = ipe.getParent().getChildren();