diff options
author | Roel Spilker <r.spilker@gmail.com> | 2013-11-19 21:02:59 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2013-11-19 21:02:59 +0100 |
commit | 78b2d6919e35887940f9f11b6ae1731245739b83 (patch) | |
tree | 0dc305883c19a862a38669374c5614e26480d4b8 /test/core/src/lombok | |
parent | 5deb185591904d275cb06eea85c0d739587fc738 (diff) | |
parent | 83b7e77b0cce6cd5993b17f36164271accdd281c (diff) | |
download | lombok-78b2d6919e35887940f9f11b6ae1731245739b83.tar.gz lombok-78b2d6919e35887940f9f11b6ae1731245739b83.tar.bz2 lombok-78b2d6919e35887940f9f11b6ae1731245739b83.zip |
Merge branch 'master' of github.com:rzwitserloot/lombok
Conflicts:
src/delombok/lombok/delombok/DelombokApp.java
Diffstat (limited to 'test/core/src/lombok')
-rw-r--r-- | test/core/src/lombok/CompilerMessageMatcher.java | 14 | ||||
-rw-r--r-- | test/core/src/lombok/RunTestsViaEcj.java | 2 |
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(); |