]> source.dussan.org Git - aspectj.git/commitdiff
260384: NumberFormatException
authoraclement <aclement>
Tue, 13 Jan 2009 17:38:10 +0000 (17:38 +0000)
committeraclement <aclement>
Tue, 13 Jan 2009 17:38:10 +0000 (17:38 +0000)
asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java

index d212926bbde3590f21478d054ce8a8dd854341a1..fb825fade81a7bab9b88869f27eaa0cf04a9be24 100644 (file)
@@ -202,8 +202,9 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
                                        if (object.getKind() == ipe.getKind()) {
                                                if (object.getName().endsWith("{..}")) {
                                                        String existingHandle = object.getHandleIdentifier();
-                                                       int suffixPosition = existingHandle.indexOf('!');
-                                                       if (suffixPosition != -1) {
+                                                       int suffixPosition = existingHandle.lastIndexOf('!');
+                                                       int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter
+                                                       if (suffixPosition != -1 && lastSquareBracket<suffixPosition) { // pr260384
                                                                count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1;
                                                        } else {
                                                                if (count == 1) {
@@ -222,8 +223,9 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
                                        if (object.getKind() == ipe.getKind()) {
                                                if (object.getName().equals(ipe.getName())) {
                                                        String existingHandle = object.getHandleIdentifier();
-                                                       int suffixPosition = existingHandle.indexOf('!');
-                                                       if (suffixPosition != -1) {
+                                                       int suffixPosition = existingHandle.lastIndexOf('!');
+                                                       int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter
+                                                       if (suffixPosition != -1 && lastSquareBracket<suffixPosition) { // pr260384
                                                                count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1;
                                                        } else {
                                                                if (count == 1) {