]> source.dussan.org Git - aspectj.git/commitdiff
patches from 148190 #22
authoraclement <aclement>
Thu, 11 Jan 2007 11:29:50 +0000 (11:29 +0000)
committeraclement <aclement>
Thu, 11 Jan 2007 11:29:50 +0000 (11:29 +0000)
asm/src/org/aspectj/asm/AsmManager.java
asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java

index 4a972c8b8c5c66cb6272b9b2a2f1d0e6ce7fbba0..ba289446977ed50d014e1c8a78e8ee6add3e2616 100644 (file)
@@ -244,7 +244,11 @@ public class AsmManager {
     }
 
     private String genExternFilePath(String configFilePath) {
-        return configFilePath.substring(0, configFilePath.lastIndexOf(".lst")) + ".ajsym";
+       // sometimes don't have ".lst"
+       if (configFilePath.lastIndexOf(".lst") != -1) {
+                       configFilePath = configFilePath.substring(0,configFilePath.lastIndexOf(".lst"));
+               }
+        return configFilePath + ".ajsym";
     }
     
 //     public void setShouldSaveModel(boolean shouldSaveModel) {
index eb9ae4b5b00b153fa22a613f4cdeeb73dbaee6e0..712356e593952661a070ad8f658fceb2f9985822 100644 (file)
@@ -59,9 +59,13 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
                        String configFile = AsmManager.getDefault().getHierarchy().getConfigFile();
                        int start = configFile.lastIndexOf(File.separator);
                        int end = configFile.lastIndexOf(".lst");
-                       String fileName = configFile.substring(start + 1,end);
-                       ipe.setHandleIdentifier(fileName);
-                       return fileName;
+                       if (end != -1) {
+                               configFile = configFile.substring(start+1,end);
+                       } else {
+                               configFile = configFile.substring(start+1);
+                       }
+                       ipe.setHandleIdentifier(configFile);
+                       return configFile;
                }
                IProgramElement parent = ipe.getParent();
                if (parent != null &&