diff options
Diffstat (limited to 'bridge/src')
-rw-r--r-- | bridge/src/org/aspectj/bridge/IMessage.java | 6 | ||||
-rw-r--r-- | bridge/src/org/aspectj/bridge/Message.java | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/bridge/src/org/aspectj/bridge/IMessage.java b/bridge/src/org/aspectj/bridge/IMessage.java index 7829633e9..b6050224e 100644 --- a/bridge/src/org/aspectj/bridge/IMessage.java +++ b/bridge/src/org/aspectj/bridge/IMessage.java @@ -76,6 +76,12 @@ public interface IMessage { /** Return the ID of the message where applicable, see IProblem for list of valid IDs */ int getID(); + /** Return the start position of the problem (inclusive), or -1 if unknown. */ + int getSourceStart(); + + /** Return the end position of the problem (inclusive), or -1 if unknown. */ + int getSourceEnd(); + /** @return Throwable associated with this message, or null if none */ Throwable getThrown(); diff --git a/bridge/src/org/aspectj/bridge/Message.java b/bridge/src/org/aspectj/bridge/Message.java index b568f9641..02ecbb820 100644 --- a/bridge/src/org/aspectj/bridge/Message.java +++ b/bridge/src/org/aspectj/bridge/Message.java @@ -32,6 +32,7 @@ public class Message implements IMessage { private final List/*SourceLocation*/ extraSourceLocations; private final boolean declared; // Is it a DEOW ? private final int id; + private final int sourceStart,sourceEnd; /** * Create a (compiler) error or warning message @@ -63,14 +64,16 @@ public class Message implements IMessage { */ public Message(String message, String details, IMessage.Kind kind, ISourceLocation sourceLocation, Throwable thrown, ISourceLocation[] extraSourceLocations) { - this(message,details,kind,sourceLocation,thrown,extraSourceLocations,false,0); + this(message,details,kind,sourceLocation,thrown,extraSourceLocations,false,0,-1,-1); } public Message(String message, String details, IMessage.Kind kind, ISourceLocation sLoc, Throwable thrown, ISourceLocation[] otherLocs, - boolean declared,int id) { + boolean declared,int id,int sourcestart,int sourceend) { this.details = details; this.id = id; + this.sourceStart = sourcestart; + this.sourceEnd = sourceend; this.message = ((message!=null) ? message : ((thrown==null) ? null : thrown.getMessage())); this.kind = kind; this.sourceLocation = sLoc; @@ -182,4 +185,11 @@ public class Message implements IMessage { return id; } + public int getSourceStart() { + return sourceStart; + } + + public int getSourceEnd() { + return sourceEnd; + } } |