Skip to content

Commit

Permalink
BcelObjectType: Add experimental code to set source file name for
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kriegaex committed Apr 13, 2024
1 parent 8249043 commit 9076beb
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit 9076beb

Please sign in to comment.