diff options
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/src/org/aspectj/bridge/ISourceLocation.java | 9 | ||||
-rw-r--r-- | bridge/src/org/aspectj/bridge/SourceLocation.java | 10 |
2 files changed, 19 insertions, 0 deletions
diff --git a/bridge/src/org/aspectj/bridge/ISourceLocation.java b/bridge/src/org/aspectj/bridge/ISourceLocation.java index e5c745797..502db15a7 100644 --- a/bridge/src/org/aspectj/bridge/ISourceLocation.java +++ b/bridge/src/org/aspectj/bridge/ISourceLocation.java @@ -64,4 +64,13 @@ public interface ISourceLocation { /** @return String application-specific context for source */ String getContext(); + /** + * In the cases where getSourceFile().getName() returns a class file + * (for example when we have a binary aspect) this should return the + * name of the source file (for example BinaryAspect.aj) + * + * @return the name of the source file + */ + String getSourceFileName(); + } diff --git a/bridge/src/org/aspectj/bridge/SourceLocation.java b/bridge/src/org/aspectj/bridge/SourceLocation.java index bc0c47171..e68a45f89 100644 --- a/bridge/src/org/aspectj/bridge/SourceLocation.java +++ b/bridge/src/org/aspectj/bridge/SourceLocation.java @@ -60,6 +60,7 @@ public class SourceLocation implements ISourceLocation, java.io.Serializable { private int offset; private final String context; private boolean noColumn; + private String sourceFileName; /** * Same as SourceLocation(file, line, line, 0), @@ -103,6 +104,11 @@ public class SourceLocation implements ISourceLocation, java.io.Serializable { this.context = context; } + public SourceLocation(File file, int line, int endLine, int column, String context, String sourceFileName) { + this(file,line,endLine,column,context); + this.sourceFileName = sourceFileName; + } + public File getSourceFile() { return sourceFile; } @@ -156,6 +162,10 @@ public class SourceLocation implements ISourceLocation, java.io.Serializable { public int getOffset() { return offset;} public void setOffset(int i) { offset=i;} + public String getSourceFileName() { + return sourceFileName; + } + } |