From: aclement Date: Mon, 6 Apr 2009 15:45:15 +0000 (+0000) Subject: guard against -1 X-Git-Tag: V1_6_5~90 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=50603b3dd937263492cbb401a910c2626a55247f;p=aspectj.git guard against -1 --- diff --git a/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java b/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java index 28e86f63f..e2aefd855 100644 --- a/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java +++ b/weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java @@ -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());