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
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() {
/** 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--) {
}
}
}
- return -1;
+ return getSourceLine(ih.getNext());
}
// assumes that there is no already extant source line tag. Otherwise we'll have to be better.