aboutsummaryrefslogtreecommitdiff
path: root/test/core
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2013-08-19 23:50:57 +0200
committerRoel Spilker <r.spilker@gmail.com>2013-08-19 23:50:57 +0200
commitbad93ae677622c79883f658a53484d455e36ce9a (patch)
treeb9b1b0d707531cfc285084490473c88fe931dc84 /test/core
parent132d603dd4e43f50555ef33bac290b1080dfc5fa (diff)
downloadlombok-bad93ae677622c79883f658a53484d455e36ce9a.tar.gz
lombok-bad93ae677622c79883f658a53484d455e36ce9a.tar.bz2
lombok-bad93ae677622c79883f658a53484d455e36ce9a.zip
Only look at the line number for errors and warnings.
Diffstat (limited to 'test/core')
-rw-r--r--test/core/src/lombok/CompilerMessageMatcher.java14
-rw-r--r--test/core/src/lombok/RunTestsViaEcj.java2
2 files changed, 6 insertions, 10 deletions
diff --git a/test/core/src/lombok/CompilerMessageMatcher.java b/test/core/src/lombok/CompilerMessageMatcher.java
index af12e199..db288749 100644
--- a/test/core/src/lombok/CompilerMessageMatcher.java
+++ b/test/core/src/lombok/CompilerMessageMatcher.java
@@ -38,30 +38,26 @@ public class CompilerMessageMatcher {
/** Line Number (starting at 1) */
private final long line;
- /** Position is either column number, OR position in file starting from the first byte. */
- private final long position;
private final Collection<String> messageParts;
- public CompilerMessageMatcher(long line, long position, String message) {
+ public CompilerMessageMatcher(long line, String message) {
this.line = line;
- this.position = position;
this.messageParts = Arrays.asList(message.split("\\s+"));
}
public static CompilerMessageMatcher asCompilerMessageMatcher(CompilerMessage message) {
- return new CompilerMessageMatcher(message.getLine(), message.getColumnOrPosition(), message.getMessage());
+ return new CompilerMessageMatcher(message.getLine(), message.getMessage());
}
@Override public String toString() {
StringBuilder parts = new StringBuilder();
for (String part : messageParts) parts.append(part).append(" ");
if (parts.length() > 0) parts.setLength(parts.length() - 1);
- return String.format("%d:%d %s", line, position, parts);
+ return String.format("%d %s", line, parts);
}
public boolean matches(CompilerMessage message) {
if (message.getLine() != this.line) return false;
- if (message.getColumnOrPosition() != this.position) return false;
for (String token : messageParts) {
if (!message.getMessage().contains(token)) return false;
}
@@ -78,12 +74,12 @@ public class CompilerMessageMatcher {
return out;
}
- private static final Pattern PATTERN = Pattern.compile("^(\\d+):(\\d+) (.*)$");
+ private static final Pattern PATTERN = Pattern.compile("^(\\d+) (.*)$");
private static CompilerMessageMatcher read(String line) {
line = line.trim();
if (line.isEmpty()) return null;
Matcher m = PATTERN.matcher(line);
if (!m.matches()) throw new IllegalArgumentException("Typo in test file: " + line);
- return new CompilerMessageMatcher(Integer.parseInt(m.group(1)), Integer.parseInt(m.group(2)), m.group(3));
+ return new CompilerMessageMatcher(Integer.parseInt(m.group(1)), m.group(2));
}
}
diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java
index f7294f1f..586c124a 100644
--- a/test/core/src/lombok/RunTestsViaEcj.java
+++ b/test/core/src/lombok/RunTestsViaEcj.java
@@ -112,7 +112,7 @@ public class RunTestsViaEcj extends AbstractRunTests {
CategorizedProblem[] problems = compilationResult.getAllProblems();
if (problems != null) for (CategorizedProblem p : problems) {
- messages.add(new CompilerMessage(p.getSourceLineNumber(), p.getSourceStart(), p.getSourceStart(), p.isError(), p.getMessage()));
+ messages.add(new CompilerMessage(p.getSourceLineNumber(), p.getSourceStart(), p.isError(), p.getMessage()));
}
CompilationUnitDeclaration cud = compilationUnit_.get();