Browse Source

Fix for: Bugzilla Bug 91090: declare warning with staticinitialization matching an aspect doesn't appear correctly. Ensured staticinitialization shadow source locations are always the type declaration line (including offset where we can).

tags/PRE_ANDY
aclement 19 years ago
parent
commit
be14796f56
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      weaver/src/org/aspectj/weaver/bcel/BcelShadow.java

+ 5
- 1
weaver/src/org/aspectj/weaver/bcel/BcelShadow.java View File

@@ -2722,7 +2722,11 @@ public class BcelShadow extends Shadow {
// System.err.println(this + ": " + range);
return getEnclosingClass().getType().getSourceLocation();
} else {
return getEnclosingClass().getType().getSourceContext().makeSourceLocation(sourceLine);
// For staticinitialization, if we have a nice offset, don't build a new source loc
if (getKind()==Shadow.StaticInitialization && getEnclosingClass().getType().getSourceLocation().getOffset()!=0)
return getEnclosingClass().getType().getSourceLocation();
else
return getEnclosingClass().getType().getSourceContext().makeSourceLocation(sourceLine);
}
}


Loading…
Cancel
Save