Merge changes Ifafc51bd,I5bec2ed4

* changes:
  TabFile: Fix Eclipse warnings and code style
  VersionedAccountDestinations: Access createLoggerSink statically
This commit is contained in:
Saša Živkov 2015-09-07 09:13:15 +00:00 committed by Gerrit Code Review
commit 7539527136
2 changed files with 8 additions and 7 deletions

View File

@ -17,6 +17,7 @@ package com.google.gerrit.server.account;
import com.google.gerrit.reviewdb.client.Account; import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.RefNames; import com.google.gerrit.reviewdb.client.RefNames;
import com.google.gerrit.server.git.DestinationList; import com.google.gerrit.server.git.DestinationList;
import com.google.gerrit.server.git.TabFile;
import com.google.gerrit.server.git.ValidationError; import com.google.gerrit.server.git.ValidationError;
import com.google.gerrit.server.git.VersionedMetaData; import com.google.gerrit.server.git.VersionedMetaData;
@ -61,7 +62,7 @@ public class VersionedAccountDestinations extends VersionedMetaData {
String path = p.path; String path = p.path;
if (path.startsWith(prefix)) { if (path.startsWith(prefix)) {
String label = path.substring(prefix.length()); String label = path.substring(prefix.length());
ValidationError.Sink errors = destinations.createLoggerSink(path, log); ValidationError.Sink errors = TabFile.createLoggerSink(path, log);
destinations.parseLabel(label, readUTF8(path), errors); destinations.parseLabel(label, readUTF8(path), errors);
} }
} }

View File

@ -32,11 +32,11 @@ public class TabFile {
} }
public static Parser TRIM = new Parser() { public static Parser TRIM = new Parser() {
public String parse(String str) { @Override
return str.trim(); public String parse(String str) {
} return str.trim();
}; }
};
protected static class Row { protected static class Row {
public String left; public String left;
@ -50,7 +50,7 @@ public class TabFile {
protected static List<Row> parse(String text, String filename, Parser left, protected static List<Row> parse(String text, String filename, Parser left,
Parser right, ValidationError.Sink errors) throws IOException { Parser right, ValidationError.Sink errors) throws IOException {
List<Row> rows = new ArrayList<Row>(); List<Row> rows = new ArrayList<>();
BufferedReader br = new BufferedReader(new StringReader(text)); BufferedReader br = new BufferedReader(new StringReader(text));
String s; String s;
for (int lineNumber = 1; (s = br.readLine()) != null; lineNumber++) { for (int lineNumber = 1; (s = br.readLine()) != null; lineNumber++) {