diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-04-13 11:22:11 +0200 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-04-13 13:03:06 +0200 |
commit | a3f62b57ca9d7f1ef728b6c3647a613875057aee (patch) | |
tree | 3d0cf0348f9913298e5f0b8808e226bba9dceaef | |
parent | b48e5d71a9f8141ca4fb275a7e4bb99b389c5d37 (diff) | |
download | aspectj-a3f62b57ca9d7f1ef728b6c3647a613875057aee.tar.gz aspectj-a3f62b57ca9d7f1ef728b6c3647a613875057aee.zip |
BcelObjectType: Add experimental code to set source file name for
reference
Experimental code leading to undesired ripple effects elsewhere,
requiring more rework which now I do not feel inclined to invest to
perfect source file string representation for post-compile binary
classes and aspects.
Relates to #218.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
-rw-r--r-- | weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java index 7a40ed542..973d61b37 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java @@ -159,10 +159,19 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { // the only class in Java-1.4 with no superclasses isObject = (javaClass.getSuperclassNameIndex() == 0); ensureAspectJAttributesUnpacked(); - // if (sourceContext instanceof SourceContextImpl) { - // ((SourceContextImpl)sourceContext).setSourceFileName(javaClass. - // getSourceFileName()); - // } + + // Experimental code leading to undesired ripple effects elsewhere, requiring more rework + /* + final String fileName = javaClass.getFileName(); + final String sourceFileName = javaClass.getSourceFileName(); + if (fileName == null || !fileName.endsWith(".class")) + setSourcefilename(sourceFileName); + else if (sourceFileName == null || sourceFileName.isEmpty() || sourceFileName.endsWith(".class")) + setSourcefilename(fileName); + else + setSourcefilename(fileName + " (from " + sourceFileName + ")"); + */ + setSourcefilename(javaClass.getSourceFileName()); } |