diff options
author | jhugunin <jhugunin> | 2003-05-01 02:02:56 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-05-01 02:02:56 +0000 |
commit | abe705ad6b4926e7c02cf49b3ba033c320cf2b60 (patch) | |
tree | 3042add1ab561e4732132894e50aaeff85b1a34b | |
parent | 6f13b740e05074d74326294a5baa77db1dde215d (diff) | |
download | aspectj-abe705ad6b4926e7c02cf49b3ba033c320cf2b60.tar.gz aspectj-abe705ad6b4926e7c02cf49b3ba033c320cf2b60.zip |
fix for
Bugzilla Bug 37020
wrong line for method execution join point
(but points to first executable line rather than method declaration)
and
Bugzilla Bug 37021
source path wrong in declare warning on binary files
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelSourceContext.java | 6 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/Utility.java | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelSourceContext.java b/weaver/src/org/aspectj/weaver/bcel/BcelSourceContext.java index 72a7939e1..f8c4c3c9a 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelSourceContext.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelSourceContext.java @@ -29,6 +29,12 @@ public class BcelSourceContext implements ISourceContext { public BcelSourceContext(BcelObjectType inObject) { this.inObject = inObject; + sourceFileName = inObject.getJavaClass().getSourceFileName(); + + String pname = inObject.getResolvedTypeX().getPackageName(); + if (pname != null) { + sourceFileName = pname.replace('.', '/') + '/' + sourceFileName; + } } private File getSourceFile() { diff --git a/weaver/src/org/aspectj/weaver/bcel/Utility.java b/weaver/src/org/aspectj/weaver/bcel/Utility.java index 4d54a786e..402c85b2f 100644 --- a/weaver/src/org/aspectj/weaver/bcel/Utility.java +++ b/weaver/src/org/aspectj/weaver/bcel/Utility.java @@ -421,6 +421,8 @@ public class Utility { /** returns -1 if no source line attribute */ public static int getSourceLine(InstructionHandle ih) { + if (ih == null) return -1; + InstructionTargeter[] ts = ih.getTargeters(); if (ts != null) { for (int j = ts.length - 1; j >= 0; j--) { @@ -430,7 +432,7 @@ public class Utility { } } } - return -1; + return getSourceLine(ih.getNext()); } // assumes that there is no already extant source line tag. Otherwise we'll have to be better. |