From 41fefd58f8b716468b2bdba2335eb921e5eb3a7b Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 11 Jan 2007 11:29:50 +0000 Subject: [PATCH] patches from 148190 #22 --- asm/src/org/aspectj/asm/AsmManager.java | 6 +++++- .../aspectj/asm/internal/JDTLikeHandleProvider.java | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/asm/src/org/aspectj/asm/AsmManager.java b/asm/src/org/aspectj/asm/AsmManager.java index 4a972c8b8..ba2894469 100644 --- a/asm/src/org/aspectj/asm/AsmManager.java +++ b/asm/src/org/aspectj/asm/AsmManager.java @@ -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) { diff --git a/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java b/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java index eb9ae4b5b..712356e59 100644 --- a/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java +++ b/asm/src/org/aspectj/asm/internal/JDTLikeHandleProvider.java @@ -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 && -- 2.39.5