]> source.dussan.org Git - aspectj.git/commitdiff
guard against -1
authoraclement <aclement>
Mon, 6 Apr 2009 15:45:15 +0000 (15:45 +0000)
committeraclement <aclement>
Mon, 6 Apr 2009 15:45:15 +0000 (15:45 +0000)
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java

index 28e86f63f714eab70afca973a7c14c0b819145f6..e2aefd855ff8991626be615226f5887611739690 100644 (file)
@@ -202,13 +202,17 @@ public class AsmRelationshipProvider {
                                // (G.class
                                // could fix the binary path to only be blah.class bit
                                int dotClassPosition = bpath.lastIndexOf(".class");// what to do if -1
-                               int startPosition = dotClassPosition;
-                               char ch;
-                               while (startPosition>0 && ((ch=bpath.charAt(startPosition))!='/' && ch!='\\')) {
-                                       startPosition--;
+                               if (dotClassPosition==-1) {
+                                       phantomHandle.append(HandleProviderDelimiter.CLASSFILE.getDelimiter()).append("UNKNOWN.class");
+                               } else {
+                                       int startPosition = dotClassPosition;
+                                       char ch;
+                                       while (startPosition>0 && ((ch=bpath.charAt(startPosition))!='/' && ch!='\\')) {
+                                               startPosition--;
+                                       }
+                                       String classFile = bpath.substring(startPosition+1,dotClassPosition+6);
+                                       phantomHandle.append(HandleProviderDelimiter.CLASSFILE.getDelimiter()).append(classFile);
                                }
-                               String classFile = bpath.substring(startPosition+1,dotClassPosition+6);
-                               phantomHandle.append(HandleProviderDelimiter.CLASSFILE.getDelimiter()).append(classFile);
                                
                                // [G
                                phantomHandle.append(HandleProviderDelimiter.TYPE.getDelimiter()).append(onType.getClassName());