From: wisberg Date: Wed, 5 Mar 2003 22:04:08 +0000 (+0000) Subject: neglected commit for sourcelocation context X-Git-Tag: v1_1_0_RC1~62 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d8f3379560c450b80ca7851d798d6e6245832d82;p=aspectj.git neglected commit for sourcelocation context --- diff --git a/testing/src/org/aspectj/testing/xml/SoftSourceLocation.java b/testing/src/org/aspectj/testing/xml/SoftSourceLocation.java index 1276eb853..48d88db69 100644 --- a/testing/src/org/aspectj/testing/xml/SoftSourceLocation.java +++ b/testing/src/org/aspectj/testing/xml/SoftSourceLocation.java @@ -17,6 +17,7 @@ package org.aspectj.testing.xml; import java.io.File; import org.aspectj.bridge.ISourceLocation; +import org.aspectj.util.LangUtil; /** * Immutable source location. @@ -56,6 +57,7 @@ public class SoftSourceLocation implements ISourceLocation { // XXX endLine? private int line; private int column; private int endLine; + private String context; public SoftSourceLocation() { } @@ -74,6 +76,9 @@ public class SoftSourceLocation implements ISourceLocation { // XXX endLine? public int getEndLine() { return line; } + public String getContext() { + return context; + } public void setFile(String sourceFile) { this.sourceFile = new File(sourceFile); @@ -93,7 +98,10 @@ public class SoftSourceLocation implements ISourceLocation { // XXX endLine? public void setEndLine(String line) { this.endLine = convert(line); } - + + public void setContext(String context) { + this.context = context; + } private int convert(String in) { return Integer.valueOf(in).intValue(); @@ -103,11 +111,11 @@ public class SoftSourceLocation implements ISourceLocation { // XXX endLine? return null; } - /** @return String : file:line:column */ + /** @return String : {context\n}file:line:column */ public String toString() { - return getSourceFile().getPath() + ":" + getLine() + ":" + getColumn(); + return (null == context ? "" : context + LangUtil.EOL) + + getSourceFile().getPath() + + ":" + getLine() + + ":" + getColumn(); } - - //XXX making the build work again, Wes needs to implement the correct fix - public String getContext() { return null; } }