diff options
author | aclement <aclement> | 2010-11-13 16:31:19 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-11-13 16:31:19 +0000 |
commit | 0156c1305007bb128eec80be7c6fd6b781fcf23d (patch) | |
tree | f841ae1a526737c468b734315c8f888dacd21ec9 /asm/src | |
parent | 9b2e89b52ba1a421839b18f9be3aaac523fcd665 (diff) | |
download | aspectj-0156c1305007bb128eec80be7c6fd6b781fcf23d.tar.gz aspectj-0156c1305007bb128eec80be7c6fd6b781fcf23d.zip |
330170: debug added
Diffstat (limited to 'asm/src')
-rw-r--r-- | asm/src/org/aspectj/asm/AsmManager.java | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/asm/src/org/aspectj/asm/AsmManager.java b/asm/src/org/aspectj/asm/AsmManager.java index 378d63e54..27f8ef2fa 100644 --- a/asm/src/org/aspectj/asm/AsmManager.java +++ b/asm/src/org/aspectj/asm/AsmManager.java @@ -622,30 +622,37 @@ public class AsmManager implements IStructureModel { } private String getTypeNameFromHandle(String handle, Map<String, String> cache) { - String typename = cache.get(handle); - if (typename != null) { + try { + String typename = cache.get(handle); + if (typename != null) { + return typename; + } + // inpath handle - but for which type? + // let's do it the slow way, we can optimize this with a cache perhaps + int hasPackage = handle.indexOf(HandleProviderDelimiter.PACKAGEFRAGMENT.getDelimiter()); + int typeLocation = handle.indexOf(HandleProviderDelimiter.TYPE.getDelimiter()); + if (typeLocation == -1) { + typeLocation = handle.indexOf(HandleProviderDelimiter.ASPECT_TYPE.getDelimiter()); + } + if (typeLocation == -1) { + // unexpected - time to give up + return ""; + } + StringBuffer qualifiedTypeNameFromHandle = new StringBuffer(); + if (hasPackage != -1) { + qualifiedTypeNameFromHandle.append(handle.substring(hasPackage + 1, handle.indexOf(HandleProviderDelimiter.CLASSFILE.getDelimiter(), hasPackage))); + qualifiedTypeNameFromHandle.append('.'); + } + qualifiedTypeNameFromHandle.append(handle.substring(typeLocation + 1)); + typename = qualifiedTypeNameFromHandle.toString(); + cache.put(handle, typename); return typename; - } - // inpath handle - but for which type? - // let's do it the slow way, we can optimize this with a cache perhaps - int hasPackage = handle.indexOf('<'); - int typeLocation = handle.indexOf('['); - if (typeLocation == -1) { - typeLocation = handle.indexOf('}'); - } - if (typeLocation == -1) { - // unexpected - time to give up + } catch (StringIndexOutOfBoundsException sioobe) { + // debug for 330170 + System.err.println("Handle processing problem, the handle is: "+handle); + sioobe.printStackTrace(System.err); return ""; } - StringBuffer qualifiedTypeNameFromHandle = new StringBuffer(); - if (hasPackage != -1) { - qualifiedTypeNameFromHandle.append(handle.substring(hasPackage + 1, handle.indexOf('(', hasPackage))); - qualifiedTypeNameFromHandle.append('.'); - } - qualifiedTypeNameFromHandle.append(handle.substring(typeLocation + 1)); - typename = qualifiedTypeNameFromHandle.toString(); - cache.put(handle, typename); - return typename; } /** |