Skip to content

Commit a3f62b5

Browse files
committedApr 13, 2024
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>
1 parent b48e5d7 commit a3f62b5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed
 

‎weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java

+13-4
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,19 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
159159
// the only class in Java-1.4 with no superclasses
160160
isObject = (javaClass.getSuperclassNameIndex() == 0);
161161
ensureAspectJAttributesUnpacked();
162-
// if (sourceContext instanceof SourceContextImpl) {
163-
// ((SourceContextImpl)sourceContext).setSourceFileName(javaClass.
164-
// getSourceFileName());
165-
// }
162+
163+
// Experimental code leading to undesired ripple effects elsewhere, requiring more rework
164+
/*
165+
final String fileName = javaClass.getFileName();
166+
final String sourceFileName = javaClass.getSourceFileName();
167+
if (fileName == null || !fileName.endsWith(".class"))
168+
setSourcefilename(sourceFileName);
169+
else if (sourceFileName == null || sourceFileName.isEmpty() || sourceFileName.endsWith(".class"))
170+
setSourcefilename(fileName);
171+
else
172+
setSourcefilename(fileName + " (from " + sourceFileName + ")");
173+
*/
174+
166175
setSourcefilename(javaClass.getSourceFileName());
167176
}
168177

0 commit comments

Comments
 (0)
Please sign in to comment.