Format java files with google-java-format
google-java-format was not run after squashing string concatenations in change I7348413ae. Change-Id: I30afb262cca64e7638657d59ebb81938c22f0242
This commit is contained in:
@@ -105,8 +105,7 @@ public class ActionsIT extends AbstractDaemonTest {
|
|||||||
assertThat(info.enabled).isNull();
|
assertThat(info.enabled).isNull();
|
||||||
assertThat(info.label).isEqualTo("Submit whole topic");
|
assertThat(info.label).isEqualTo("Submit whole topic");
|
||||||
assertThat(info.method).isEqualTo("POST");
|
assertThat(info.method).isEqualTo("POST");
|
||||||
assertThat(info.title)
|
assertThat(info.title).isEqualTo("This change depends on other changes which are not ready");
|
||||||
.isEqualTo("This change depends on other changes which are not ready");
|
|
||||||
} else {
|
} else {
|
||||||
noSubmitWholeTopicAssertions(actions, 1);
|
noSubmitWholeTopicAssertions(actions, 1);
|
||||||
|
|
||||||
|
@@ -85,8 +85,7 @@ public class ChangeReviewersIT extends AbstractDaemonTest {
|
|||||||
assertThat(result.input).isEqualTo(mediumGroup);
|
assertThat(result.input).isEqualTo(mediumGroup);
|
||||||
assertThat(result.confirm).isTrue();
|
assertThat(result.confirm).isTrue();
|
||||||
assertThat(result.error)
|
assertThat(result.error)
|
||||||
.contains(
|
.contains("has " + mediumGroupSize + " members. Do you want to add them all as reviewers?");
|
||||||
"has " + mediumGroupSize + " members. Do you want to add them all as reviewers?");
|
|
||||||
assertThat(result.reviewers).isNull();
|
assertThat(result.reviewers).isNull();
|
||||||
|
|
||||||
// Add medium group with confirmation.
|
// Add medium group with confirmation.
|
||||||
@@ -514,8 +513,7 @@ public class ChangeReviewersIT extends AbstractDaemonTest {
|
|||||||
assertThat(reviewerResult).isNotNull();
|
assertThat(reviewerResult).isNotNull();
|
||||||
assertThat(reviewerResult.confirm).isTrue();
|
assertThat(reviewerResult.confirm).isTrue();
|
||||||
assertThat(reviewerResult.error)
|
assertThat(reviewerResult.error)
|
||||||
.contains(
|
.contains("has " + mediumGroupSize + " members. Do you want to add them all as reviewers?");
|
||||||
"has " + mediumGroupSize + " members. Do you want to add them all as reviewers?");
|
|
||||||
|
|
||||||
// No labels should have changed, and no reviewers/CCs should have been added.
|
// No labels should have changed, and no reviewers/CCs should have been added.
|
||||||
c = gApi.changes().id(r.getChangeId()).get();
|
c = gApi.changes().id(r.getChangeId()).get();
|
||||||
|
@@ -126,8 +126,7 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
|
|||||||
|
|
||||||
/** Convert bare http:// and https:// URLs into <a href> tags. */
|
/** Convert bare http:// and https:// URLs into <a href> tags. */
|
||||||
public SafeHtml linkify() {
|
public SafeHtml linkify() {
|
||||||
final String part =
|
final String part = "(?:[a-zA-Z0-9$_+!*'%;:@=?#/~-]|&(?!lt;|gt;)|[.,](?!(?:\\s|$)))";
|
||||||
"(?:[a-zA-Z0-9$_+!*'%;:@=?#/~-]|&(?!lt;|gt;)|[.,](?!(?:\\s|$)))";
|
|
||||||
return replaceAll(
|
return replaceAll(
|
||||||
"(https?://" + part + "{2,}(?:[(]" + part + "*[)])*" + part + "*)",
|
"(https?://" + part + "{2,}(?:[(]" + part + "*[)])*" + part + "*)",
|
||||||
"<a href=\"$1\" target=\"_blank\" rel=\"nofollow\">$1</a>");
|
"<a href=\"$1\" target=\"_blank\" rel=\"nofollow\">$1</a>");
|
||||||
|
@@ -54,8 +54,7 @@ public class SafeHtml_ReplaceTest {
|
|||||||
o.replaceAll(repls(new RawFindReplace("(issue\\s(\\d+))", "<a href=\"?$2\">$1</a>")));
|
o.replaceAll(repls(new RawFindReplace("(issue\\s(\\d+))", "<a href=\"?$2\">$1</a>")));
|
||||||
assertThat(o).isNotSameAs(n);
|
assertThat(o).isNotSameAs(n);
|
||||||
assertThat(n.asString())
|
assertThat(n.asString())
|
||||||
.isEqualTo(
|
.isEqualTo("A\n<a href=\"?42\">issue 42</a>\n<a href=\"?9918\">issue 9918</a>\nB");
|
||||||
"A\n<a href=\"?42\">issue 42</a>\n<a href=\"?9918\">issue 9918</a>\nB");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -181,8 +181,7 @@ class ProjectBasicAuthFilter implements Filter {
|
|||||||
|
|
||||||
private boolean failAuthentication(Response rsp, String username) throws IOException {
|
private boolean failAuthentication(Response rsp, String username) throws IOException {
|
||||||
log.warn(
|
log.warn(
|
||||||
"Authentication failed for {}: password does not match the one stored in Gerrit",
|
"Authentication failed for {}: password does not match the one stored in Gerrit", username);
|
||||||
username);
|
|
||||||
rsp.sendError(SC_UNAUTHORIZED);
|
rsp.sendError(SC_UNAUTHORIZED);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -96,8 +96,7 @@ public abstract class SiteProgram extends AbstractProgram {
|
|||||||
/** Ensures we are running inside of a valid site, otherwise throws a Die. */
|
/** Ensures we are running inside of a valid site, otherwise throws a Die. */
|
||||||
protected void mustHaveValidSite() throws Die {
|
protected void mustHaveValidSite() throws Die {
|
||||||
if (!Files.exists(sitePath.resolve("etc").resolve("gerrit.config"))) {
|
if (!Files.exists(sitePath.resolve("etc").resolve("gerrit.config"))) {
|
||||||
throw die(
|
throw die("not a Gerrit site: '" + getSitePath() + "'\nPerhaps you need to run init first?");
|
||||||
"not a Gerrit site: '" + getSitePath() + "'\nPerhaps you need to run init first?");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -608,8 +608,7 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
|
|||||||
if (range == null) {
|
if (range == null) {
|
||||||
throw new BadRequestException(
|
throw new BadRequestException(
|
||||||
String.format(
|
String.format(
|
||||||
"A range must be given for the replacement of the robot comment on %s",
|
"A range must be given for the replacement of the robot comment on %s", commentPath));
|
||||||
commentPath));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -327,8 +327,7 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
|
|||||||
Change change = readOneReviewDbChange(db, id);
|
Change change = readOneReviewDbChange(db, id);
|
||||||
if (change == null) {
|
if (change == null) {
|
||||||
if (defaultStorage == PrimaryStorage.REVIEW_DB) {
|
if (defaultStorage == PrimaryStorage.REVIEW_DB) {
|
||||||
log.warn(
|
log.warn("skipping change {} found in project {} but not in ReviewDb", id, project);
|
||||||
"skipping change {} found in project {} but not in ReviewDb", id, project);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// TODO(dborowitz): See discussion in BatchUpdate#newChangeContext.
|
// TODO(dborowitz): See discussion in BatchUpdate#newChangeContext.
|
||||||
|
@@ -255,8 +255,7 @@ public class PluginLoader implements LifecycleListener {
|
|||||||
|
|
||||||
public void disablePlugins(Set<String> names) {
|
public void disablePlugins(Set<String> names) {
|
||||||
if (!isRemoteAdminEnabled()) {
|
if (!isRemoteAdminEnabled()) {
|
||||||
log.warn(
|
log.warn("Remote plugin administration is disabled, ignoring disablePlugins(" + names + ")");
|
||||||
"Remote plugin administration is disabled, ignoring disablePlugins(" + names + ")");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,8 +295,7 @@ public class PluginLoader implements LifecycleListener {
|
|||||||
|
|
||||||
public void enablePlugins(Set<String> names) throws PluginInstallException {
|
public void enablePlugins(Set<String> names) throws PluginInstallException {
|
||||||
if (!isRemoteAdminEnabled()) {
|
if (!isRemoteAdminEnabled()) {
|
||||||
log.warn(
|
log.warn("Remote plugin administration is disabled, ignoring enablePlugins(" + names + ")");
|
||||||
"Remote plugin administration is disabled, ignoring enablePlugins(" + names + ")");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,8 +52,7 @@ public abstract class QueryProcessor<T> {
|
|||||||
executionTime =
|
executionTime =
|
||||||
metricMaker.newTimer(
|
metricMaker.newTimer(
|
||||||
"query/query_latency",
|
"query/query_latency",
|
||||||
new Description(
|
new Description("Successful query latency, accumulated over the life of the process")
|
||||||
"Successful query latency, accumulated over the life of the process")
|
|
||||||
.setCumulative()
|
.setCumulative()
|
||||||
.setUnit(Description.Units.MILLISECONDS),
|
.setUnit(Description.Units.MILLISECONDS),
|
||||||
index);
|
index);
|
||||||
|
@@ -56,8 +56,7 @@ public class Schema_123 extends SchemaVersion {
|
|||||||
ListMultimap<Account.Id, Change.Id> imports =
|
ListMultimap<Account.Id, Change.Id> imports =
|
||||||
MultimapBuilder.hashKeys().arrayListValues().build();
|
MultimapBuilder.hashKeys().arrayListValues().build();
|
||||||
try (Statement stmt = ((JdbcSchema) db).getConnection().createStatement();
|
try (Statement stmt = ((JdbcSchema) db).getConnection().createStatement();
|
||||||
ResultSet rs =
|
ResultSet rs = stmt.executeQuery("SELECT account_id, change_id FROM starred_changes")) {
|
||||||
stmt.executeQuery("SELECT account_id, change_id FROM starred_changes")) {
|
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
Account.Id accountId = new Account.Id(rs.getInt(1));
|
Account.Id accountId = new Account.Id(rs.getInt(1));
|
||||||
Change.Id changeId = new Change.Id(rs.getInt(2));
|
Change.Id changeId = new Change.Id(rs.getInt(2));
|
||||||
|
@@ -807,10 +807,8 @@ public class ChangeBundleTest extends GerritBaseTests {
|
|||||||
b2 =
|
b2 =
|
||||||
new ChangeBundle(
|
new ChangeBundle(
|
||||||
c, messages(cm1), latest(c), approvals(), comments(), reviewers(), NOTE_DB);
|
c, messages(cm1), latest(c), approvals(), comments(), reviewers(), NOTE_DB);
|
||||||
assertDiffs(
|
assertDiffs(b1, b2, "ChangeMessages differ for Change.Id " + id + "\nOnly in A:\n " + cm2);
|
||||||
b1, b2, "ChangeMessages differ for Change.Id " + id + "\nOnly in A:\n " + cm2);
|
assertDiffs(b2, b1, "ChangeMessages differ for Change.Id " + id + "\nOnly in B:\n " + cm2);
|
||||||
assertDiffs(
|
|
||||||
b2, b1, "ChangeMessages differ for Change.Id " + id + "\nOnly in B:\n " + cm2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -1028,8 +1026,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
|||||||
new ChangeBundle(
|
new ChangeBundle(
|
||||||
c, messages(), patchSets(ps1, ps2), approvals(), comments(), reviewers(), REVIEW_DB);
|
c, messages(), patchSets(ps1, ps2), approvals(), comments(), reviewers(), REVIEW_DB);
|
||||||
|
|
||||||
assertDiffs(
|
assertDiffs(b1, b2, "PatchSet.Id sets differ: [] only in A; [" + c.getId() + ",1] only in B");
|
||||||
b1, b2, "PatchSet.Id sets differ: [] only in A; [" + c.getId() + ",1] only in B");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -97,8 +97,7 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
|||||||
+ "Status: new\n"
|
+ "Status: new\n"
|
||||||
+ "Subject: This is a test change\n");
|
+ "Subject: This is a test change\n");
|
||||||
assertParseFails("Update change\n\nPatch-set: 1\nStatus: OOPS\n");
|
assertParseFails("Update change\n\nPatch-set: 1\nStatus: OOPS\n");
|
||||||
assertParseFails(
|
assertParseFails("Update change\n\nPatch-set: 1\nStatus: NEW\nStatus: NEW\n");
|
||||||
"Update change\n\nPatch-set: 1\nStatus: NEW\nStatus: NEW\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -147,11 +146,9 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
|||||||
assertParseFails("Update change\n\nPatch-set: 1\nLabel: Label1=X\n");
|
assertParseFails("Update change\n\nPatch-set: 1\nLabel: Label1=X\n");
|
||||||
assertParseFails("Update change\n\nPatch-set: 1\nLabel: Label1 = 1\n");
|
assertParseFails("Update change\n\nPatch-set: 1\nLabel: Label1 = 1\n");
|
||||||
assertParseFails("Update change\n\nPatch-set: 1\nLabel: X+Y\n");
|
assertParseFails("Update change\n\nPatch-set: 1\nLabel: X+Y\n");
|
||||||
assertParseFails(
|
assertParseFails("Update change\n\nPatch-set: 1\nLabel: Label1 Other Account <2@gerrit>\n");
|
||||||
"Update change\n\nPatch-set: 1\nLabel: Label1 Other Account <2@gerrit>\n");
|
|
||||||
assertParseFails("Update change\n\nPatch-set: 1\nLabel: -Label!1\n");
|
assertParseFails("Update change\n\nPatch-set: 1\nLabel: -Label!1\n");
|
||||||
assertParseFails(
|
assertParseFails("Update change\n\nPatch-set: 1\nLabel: -Label!1 Other Account <2@gerrit>\n");
|
||||||
"Update change\n\nPatch-set: 1\nLabel: -Label!1 Other Account <2@gerrit>\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -233,8 +230,7 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
|||||||
+ "Patch-set: 1\n"
|
+ "Patch-set: 1\n"
|
||||||
+ "Topic:\n"
|
+ "Topic:\n"
|
||||||
+ "Subject: This is a test change\n");
|
+ "Subject: This is a test change\n");
|
||||||
assertParseFails(
|
assertParseFails("Update change\n\nPatch-set: 1\nTopic: Some Topic\nTopic: Other Topic");
|
||||||
"Update change\n\nPatch-set: 1\nTopic: Some Topic\nTopic: Other Topic");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -1396,8 +1396,7 @@ public class ChangeNotesTest extends AbstractChangeNotesTest {
|
|||||||
public void changeMessageWithMultipleParagraphs() throws Exception {
|
public void changeMessageWithMultipleParagraphs() throws Exception {
|
||||||
Change c = newChange();
|
Change c = newChange();
|
||||||
ChangeUpdate update = newUpdate(c, changeOwner);
|
ChangeUpdate update = newUpdate(c, changeOwner);
|
||||||
update.setChangeMessage(
|
update.setChangeMessage("Testing paragraph 1\n\nTesting paragraph 2\n\nTesting paragraph 3");
|
||||||
"Testing paragraph 1\n\nTesting paragraph 2\n\nTesting paragraph 3");
|
|
||||||
update.commit();
|
update.commit();
|
||||||
PatchSet.Id ps1 = c.currentPatchSetId();
|
PatchSet.Id ps1 = c.currentPatchSetId();
|
||||||
|
|
||||||
|
@@ -141,8 +141,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
|||||||
update.commit();
|
update.commit();
|
||||||
|
|
||||||
assertBodyEquals(
|
assertBodyEquals(
|
||||||
"Update patch set 1\n\nPatch-set: 1\nLabel: -Code-Review\n",
|
"Update patch set 1\n\nPatch-set: 1\nLabel: -Code-Review\n", update.getResult());
|
||||||
update.getResult());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -207,9 +206,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
|||||||
update.commit();
|
update.commit();
|
||||||
|
|
||||||
RevCommit commit = parseCommit(update.getResult());
|
RevCommit commit = parseCommit(update.getResult());
|
||||||
assertBodyEquals(
|
assertBodyEquals("Update patch set 1\n\nComment on the change.\n\nPatch-set: 1\n", commit);
|
||||||
"Update patch set 1\n\nComment on the change.\n\nPatch-set: 1\n",
|
|
||||||
commit);
|
|
||||||
|
|
||||||
PersonIdent author = commit.getAuthorIdent();
|
PersonIdent author = commit.getAuthorIdent();
|
||||||
assertThat(author.getName()).isEqualTo("Anonymous Coward (3)");
|
assertThat(author.getName()).isEqualTo("Anonymous Coward (3)");
|
||||||
@@ -273,8 +270,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
|||||||
public void changeMessageWithMultipleParagraphs() throws Exception {
|
public void changeMessageWithMultipleParagraphs() throws Exception {
|
||||||
Change c = newChange();
|
Change c = newChange();
|
||||||
ChangeUpdate update = newUpdate(c, changeOwner);
|
ChangeUpdate update = newUpdate(c, changeOwner);
|
||||||
update.setChangeMessage(
|
update.setChangeMessage("Testing paragraph 1\n\nTesting paragraph 2\n\nTesting paragraph 3");
|
||||||
"Testing paragraph 1\n\nTesting paragraph 2\n\nTesting paragraph 3");
|
|
||||||
update.commit();
|
update.commit();
|
||||||
|
|
||||||
assertBodyEquals(
|
assertBodyEquals(
|
||||||
@@ -383,8 +379,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
|||||||
update.setCurrentPatchSet();
|
update.setCurrentPatchSet();
|
||||||
update.commit();
|
update.commit();
|
||||||
|
|
||||||
assertBodyEquals(
|
assertBodyEquals("Update patch set 1\n\nPatch-set: 1\nCurrent: true\n", update.getResult());
|
||||||
"Update patch set 1\n\nPatch-set: 1\nCurrent: true\n", update.getResult());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private RevCommit parseCommit(ObjectId id) throws Exception {
|
private RevCommit parseCommit(ObjectId id) throws Exception {
|
||||||
|
@@ -101,11 +101,7 @@ public class UploadArchive extends AbstractGitCommand {
|
|||||||
)
|
)
|
||||||
private boolean level9;
|
private boolean level9;
|
||||||
|
|
||||||
@Argument(
|
@Argument(index = 0, required = true, usage = "The tree or commit to produce an archive for.")
|
||||||
index = 0,
|
|
||||||
required = true,
|
|
||||||
usage = "The tree or commit to produce an archive for."
|
|
||||||
)
|
|
||||||
private String treeIsh = "master";
|
private String treeIsh = "master";
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
|
Reference in New Issue
Block a user