From be14796f5643358760951c0650b6c879e29e73e7 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 13 Apr 2005 11:47:07 +0000 Subject: [PATCH] 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). --- weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index b015f6d3f..675286b16 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -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); } } -- 2.39.5