Merge "Add missing trailing comma on array declarations"

This commit is contained in:
David Pursehouse 2016-04-13 12:57:17 +00:00 committed by Gerrit Code Review
commit e7484d719f
12 changed files with 29 additions and 24 deletions

View File

@ -151,7 +151,7 @@ public class GerritServer {
public Void call() throws Exception { public Void call() throws Exception {
int rc = daemon.main(new String[] { int rc = daemon.main(new String[] {
"-d", site.getPath(), "-d", site.getPath(),
"--headless", "--console-log", "--show-stack-trace"}); "--headless", "--console-log", "--show-stack-trace",});
if (rc != 0) { if (rc != 0) {
System.err.println("Failed to start Gerrit daemon"); System.err.println("Failed to start Gerrit daemon");
serverStarted.reset(); serverStarted.reset();
@ -172,7 +172,7 @@ public class GerritServer {
Init init = new Init(); Init init = new Init();
int rc = init.main(new String[] { int rc = init.main(new String[] {
"-d", tmp.getPath(), "--batch", "--no-auto-start", "-d", tmp.getPath(), "--batch", "--no-auto-start",
"--skip-plugins"}); "--skip-plugins",});
if (rc != 0) { if (rc != 0) {
throw new RuntimeException("Couldn't initialize site"); throw new RuntimeException("Couldn't initialize site");
} }

View File

@ -37,7 +37,7 @@ import java.util.TreeSet;
class Actions extends Composite { class Actions extends Composite {
private static final String[] CORE = { private static final String[] CORE = {
"abandon", "cherrypick", "followup", "hashtags", "publish", "abandon", "cherrypick", "followup", "hashtags", "publish",
"rebase", "restore", "revert", "submit", "topic", "/"}; "rebase", "restore", "revert", "submit", "topic", "/",};
interface Binder extends UiBinder<FlowPanel, Actions> {} interface Binder extends UiBinder<FlowPanel, Actions> {}
private static final Binder uiBinder = GWT.create(Binder.class); private static final Binder uiBinder = GWT.create(Binder.class);

View File

@ -32,7 +32,7 @@ public class Vim extends JavaScriptObject {
} }
for (String key : new String[] { for (String key : new String[] {
"Ctrl-C", "Ctrl-O", "Ctrl-P", "Ctrl-S", "Ctrl-C", "Ctrl-O", "Ctrl-P", "Ctrl-S",
"Ctrl-F", "Ctrl-B", "Ctrl-R"}) { "Ctrl-F", "Ctrl-B", "Ctrl-R",}) {
km.propagate(key); km.propagate(key);
} }
for (int i = 0; i <= 9; i++) { for (int i = 0; i <= 9; i++) {

View File

@ -212,7 +212,7 @@ class ProjectDigestFilter implements Filter {
private static final char[] LHEX = private static final char[] LHEX =
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', // {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', //
'a', 'b', 'c', 'd', 'e', 'f'}; 'a', 'b', 'c', 'd', 'e', 'f',};
private static String LHEX(byte[] bin) { private static String LHEX(byte[] bin) {
StringBuilder r = new StringBuilder(bin.length * 2); StringBuilder r = new StringBuilder(bin.length * 2);

View File

@ -134,7 +134,7 @@ public class JythonShell {
new Class[] { String.class, pyObject }, new Class[] { String.class, pyObject },
new Object[] { getDefaultBanner() + new Object[] { getDefaultBanner() +
" running for Gerrit " + com.google.gerrit.common.Version.getVersion(), " running for Gerrit " + com.google.gerrit.common.Version.getVersion(),
null }); null, });
} }
public void set(String key, Object content) { public void set(String key, Object content) {

View File

@ -105,22 +105,22 @@ class InitSshd implements InitStep {
System.err.print(" rsa..."); System.err.print(" rsa...");
System.err.flush(); System.err.flush();
Runtime.getRuntime().exec(new String[] {"ssh-keygen", // Runtime.getRuntime().exec(new String[] {"ssh-keygen",
"-q" /* quiet */, // "-q" /* quiet */,
"-t", "rsa", // "-t", "rsa",
"-P", "", // "-P", "",
"-C", comment, // "-C", comment,
"-f", site.ssh_rsa.toAbsolutePath().toString() // "-f", site.ssh_rsa.toAbsolutePath().toString(),
}).waitFor(); }).waitFor();
System.err.print(" dsa..."); System.err.print(" dsa...");
System.err.flush(); System.err.flush();
Runtime.getRuntime().exec(new String[] {"ssh-keygen", // Runtime.getRuntime().exec(new String[] {"ssh-keygen",
"-q" /* quiet */, // "-q" /* quiet */,
"-t", "dsa", // "-t", "dsa",
"-P", "", // "-P", "",
"-C", comment, // "-C", comment,
"-f", site.ssh_dsa.toAbsolutePath().toString() // "-f", site.ssh_dsa.toAbsolutePath().toString(),
}).waitFor(); }).waitFor();
} else { } else {

View File

@ -26,7 +26,7 @@ public class StringUtil {
{ "\\x00", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", { "\\x00", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a",
"\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f",
"\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", "\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17",
"\\x18", "\\x19", "\\x1a", "\\x1b", "\\x1c", "\\x1d", "\\x1e", "\\x1f" }; "\\x18", "\\x19", "\\x1a", "\\x1b", "\\x1c", "\\x1d", "\\x1e", "\\x1f", };
/** /**
* Escapes the input string so that all non-printable characters * Escapes the input string so that all non-printable characters

View File

@ -53,8 +53,12 @@ public class GitwebCgiConfig {
String cfgCgi = cfg.getString("gitweb", null, "cgi"); String cfgCgi = cfg.getString("gitweb", null, "cgi");
Path pkgCgi = Paths.get("/usr/lib/cgi-bin/gitweb.cgi"); Path pkgCgi = Paths.get("/usr/lib/cgi-bin/gitweb.cgi");
String[] resourcePaths = {"/usr/share/gitweb/static", "/usr/share/gitweb", String[] resourcePaths = {
"/var/www/static", "/var/www"}; "/usr/share/gitweb/static",
"/usr/share/gitweb",
"/var/www/static",
"/var/www",
};
Path cgi; Path cgi;
if (cfgCgi != null) { if (cfgCgi != null) {

View File

@ -60,7 +60,7 @@ public class IdentifiedUserTest {
private static final String[] TEST_CASES = { private static final String[] TEST_CASES = {
"", "",
"FirstName.LastName@Corporation.com", "FirstName.LastName@Corporation.com",
"!#$%&'+-/=.?^`{|}~@[IPv6:0123:4567:89AB:CDEF:0123:4567:89AB:CDEF]" "!#$%&'+-/=.?^`{|}~@[IPv6:0123:4567:89AB:CDEF:0123:4567:89AB:CDEF]",
}; };
@Before @Before

View File

@ -51,7 +51,7 @@ public class StringUtilTest {
"string with 'quotes'", "string with 'quotes'", "string with 'quotes'", "string with 'quotes'",
"C:\\Program Files\\MyProgram", "C:\\\\Program Files\\\\MyProgram", "C:\\Program Files\\MyProgram", "C:\\\\Program Files\\\\MyProgram",
"string\nwith\nnewlines", "string\\nwith\\nnewlines", "string\nwith\nnewlines", "string\\nwith\\nnewlines",
"string\twith\ttabs", "string\\twith\\ttabs" }; "string\twith\ttabs", "string\\twith\\ttabs", };
for (int i = 0; i < testPairs.length; i += 2) { for (int i = 0; i < testPairs.length; i += 2) {
assertEquals(StringUtil.escapeString(testPairs[i]), testPairs[i + 1]); assertEquals(StringUtil.escapeString(testPairs[i]), testPairs[i + 1]);
} }

View File

@ -156,6 +156,6 @@ public class BasicSerializationTest {
private static byte[] b(int a, int b, int c, int d, int e, int f, int g, int h) { private static byte[] b(int a, int b, int c, int d, int e, int f, int g, int h) {
return new byte[] {(byte) a, (byte) b, (byte) c, (byte) d, // return new byte[] {(byte) a, (byte) b, (byte) c, (byte) d, //
(byte) e, (byte) f, (byte) g, (byte) h}; (byte) e, (byte) f, (byte) g, (byte) h,};
} }
} }

View File

@ -96,6 +96,7 @@ edited to remove noisy warnings.
<module name="RedundantImport"/> <module name="RedundantImport"/>
<module name="RedundantModifier"/> <module name="RedundantModifier"/>
<module name="ExplicitInitialization"/> <module name="ExplicitInitialization"/>
<module name="ArrayTrailingComma"/>
</module> </module>
<module name="FileTabCharacter"> <module name="FileTabCharacter">
<property name="severity" value="ignore"/> <property name="severity" value="ignore"/>