summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2009-04-06 15:45:15 +0000
committeraclement <aclement>2009-04-06 15:45:15 +0000
commit50603b3dd937263492cbb401a910c2626a55247f (patch)
tree0096596358ce126269b489d8f36a5081fe2a6ef7
parentc815a44c9f50fc044e5313e29a7d98a2bc2ae85b (diff)
downloadaspectj-50603b3dd937263492cbb401a910c2626a55247f.tar.gz
aspectj-50603b3dd937263492cbb401a910c2626a55247f.zip
guard against -1
-rw-r--r--weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java16
1 files changed, 10 insertions, 6 deletions
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());