From 9f80317172e217cf2cbee6d212ccfc2d94c0ecfb Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 17 Feb 2009 16:20:49 +0000 Subject: [PATCH] 264869: cope with badly formed source name attribute --- .../src/org/aspectj/weaver/ShadowMunger.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java b/org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java index 5cb5ca582..1b20c7c79 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java @@ -179,8 +179,14 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH if (binaryFile == null) { String s = getDeclaringType().getBinaryPath(); File f = getDeclaringType().getSourceLocation().getSourceFile(); + // Replace the source file suffix with .class int i = f.getPath().lastIndexOf('.'); - String path = f.getPath().substring(0, i) + ".class"; + String path = null; + if (i != -1) { + path = f.getPath().substring(0, i) + ".class"; + } else { + path = f.getPath() + ".class"; + } binaryFile = new File(s + "!" + path); } return binaryFile; -- 2.39.5