Squash redundant string concatenations introduced by google-java-format
Reformatting the code with google-java-format tool in change Id5f3c6de9 resulted in wrapped lines being unwrapped to the new 100 columns limit. In cases where the wrapped line was wrapped on a string concatenation, the resulting long line now includes redundant concatenations. See the upstream issue [1] for an example of this. Squash the redundant concatenations with: git ls-files | grep java$ | xargs sed -i '' 's/" + "//g' (note: this also resulted in a couple of unwanted changes; those are manually undone.) [1] https://github.com/google/google-java-format/issues/122 Change-Id: I7348413ae460c8c7a0b0c72dab0a1ae7275a2ec3
This commit is contained in:
parent
3872fccb4e
commit
1111684821
@ -59,7 +59,7 @@ class ConfigAnnotationParser {
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
"GerritConfig.name must be of the format" + " section.subsection.name or section.name");
|
||||
"GerritConfig.name must be of the format section.subsection.name or section.name");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1214,7 +1214,7 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
assertThat(msg.rcpt()).containsExactly(user.emailAddress);
|
||||
assertThat(msg.body()).contains(admin.fullName + " has removed a vote on this change.\n");
|
||||
assertThat(msg.body())
|
||||
.contains("Removed Code-Review+1 by " + user.fullName + " <" + user.email + ">" + "\n");
|
||||
.contains("Removed Code-Review+1 by " + user.fullName + " <" + user.email + ">\n");
|
||||
|
||||
Map<String, Short> m =
|
||||
gApi.changes().id(r.getChangeId()).reviewer(user.getId().toString()).votes();
|
||||
@ -2140,7 +2140,7 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
testRepo,
|
||||
"Ignore Verified",
|
||||
"rules.pl",
|
||||
"submit_rule(submit(CR)) :-\n" + " gerrit:max_with_block(-2, 2, 'Code-Review', CR).");
|
||||
"submit_rule(submit(CR)) :-\n gerrit:max_with_block(-2, 2, 'Code-Review', CR).");
|
||||
push2.to(RefNames.REFS_CONFIG);
|
||||
|
||||
change = gApi.changes().id(r.getChangeId()).get();
|
||||
|
@ -367,7 +367,7 @@ public class RevisionIT extends AbstractDaemonTest {
|
||||
PushOneCommit.Result r1 = createChange();
|
||||
|
||||
// Push another new change (change 2)
|
||||
String subject = "Test change\n\n" + "Change-Id: Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef";
|
||||
String subject = "Test change\n\nChange-Id: Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef";
|
||||
PushOneCommit push =
|
||||
pushFactory.create(
|
||||
db, admin.getIdent(), testRepo, subject, "another_file.txt", "another content");
|
||||
@ -559,7 +559,7 @@ public class RevisionIT extends AbstractDaemonTest {
|
||||
|
||||
exception.expect(BadRequestException.class);
|
||||
exception.expectMessage(
|
||||
"Cherry Pick: Parent 0 does not exist. Please" + " specify a parent in range [1, 2].");
|
||||
"Cherry Pick: Parent 0 does not exist. Please specify a parent in range [1, 2].");
|
||||
gApi.changes().id(mergeChangeResult.getChangeId()).current().cherryPick(cherryPickInput);
|
||||
}
|
||||
|
||||
@ -580,7 +580,7 @@ public class RevisionIT extends AbstractDaemonTest {
|
||||
|
||||
exception.expect(BadRequestException.class);
|
||||
exception.expectMessage(
|
||||
"Cherry Pick: Parent 3 does not exist. Please" + " specify a parent in range [1, 2].");
|
||||
"Cherry Pick: Parent 3 does not exist. Please specify a parent in range [1, 2].");
|
||||
gApi.changes().id(mergeChangeResult.getChangeId()).current().cherryPick(cherryPickInput);
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ public class RobotCommentsIT extends AbstractDaemonTest {
|
||||
exception.expect(BadRequestException.class);
|
||||
exception.expectMessage(
|
||||
String.format(
|
||||
"A description is required for the " + "suggested fix of the robot comment on %s",
|
||||
"A description is required for the suggested fix of the robot comment on %s",
|
||||
withFixRobotCommentInput.path));
|
||||
addRobotComment(changeId, withFixRobotCommentInput);
|
||||
}
|
||||
@ -256,7 +256,7 @@ public class RobotCommentsIT extends AbstractDaemonTest {
|
||||
exception.expect(BadRequestException.class);
|
||||
exception.expectMessage(
|
||||
String.format(
|
||||
"A file path must be given for the " + "replacement of the robot comment on %s",
|
||||
"A file path must be given for the replacement of the robot comment on %s",
|
||||
withFixRobotCommentInput.path));
|
||||
addRobotComment(changeId, withFixRobotCommentInput);
|
||||
}
|
||||
@ -301,7 +301,7 @@ public class RobotCommentsIT extends AbstractDaemonTest {
|
||||
exception.expect(BadRequestException.class);
|
||||
exception.expectMessage(
|
||||
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",
|
||||
withFixRobotCommentInput.path));
|
||||
addRobotComment(changeId, withFixRobotCommentInput);
|
||||
}
|
||||
@ -315,7 +315,7 @@ public class RobotCommentsIT extends AbstractDaemonTest {
|
||||
exception.expect(BadRequestException.class);
|
||||
exception.expectMessage(
|
||||
String.format(
|
||||
"Range (13:9 - 5:10) is not " + "valid for the replacement of the robot comment on %s",
|
||||
"Range (13:9 - 5:10) is not valid for the replacement of the robot comment on %s",
|
||||
withFixRobotCommentInput.path));
|
||||
addRobotComment(changeId, withFixRobotCommentInput);
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
||||
r1.assertOkStatus();
|
||||
r1.assertChange(Change.Status.NEW, null);
|
||||
r1.assertMessage(
|
||||
"New changes:\n" + " " + url + id1 + " " + r1.getCommit().getShortMessage() + "\n");
|
||||
"New changes:\n " + url + id1 + " " + r1.getCommit().getShortMessage() + "\n");
|
||||
|
||||
testRepo.reset(initialHead);
|
||||
String newMsg = r1.getCommit().getShortMessage() + " v2";
|
||||
@ -238,7 +238,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
||||
gApi.accounts().self().setWatchedProjects(projectsToWatch);
|
||||
|
||||
TestAccount user2 = accounts.user2();
|
||||
String pushSpec = "refs/for/master" + "%reviewer=" + user.email + ",cc=" + user2.email;
|
||||
String pushSpec = "refs/for/master%reviewer=" + user.email + ",cc=" + user2.email;
|
||||
|
||||
sender.clear();
|
||||
PushOneCommit.Result r = pushTo(pushSpec + ",notify=" + NotifyHandling.NONE);
|
||||
@ -991,7 +991,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
||||
}
|
||||
|
||||
private void testpushWithInvalidChangeId() throws Exception {
|
||||
createCommit(testRepo, "Message with invalid Change-Id\n" + "\n" + "Change-Id: X\n");
|
||||
createCommit(testRepo, "Message with invalid Change-Id\n\nChange-Id: X\n");
|
||||
pushForReviewRejected(testRepo, "invalid Change-Id line format in commit message footer");
|
||||
|
||||
ProjectConfig config = projectCache.checkedGet(project).getConfig();
|
||||
|
@ -320,7 +320,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT extends AbstractSubmoduleSu
|
||||
.getAdvertisedRef("refs/heads/master")
|
||||
.getObjectId();
|
||||
|
||||
assertWithMessage("submodule subscription update " + "should have made one commit")
|
||||
assertWithMessage("submodule subscription update should have made one commit")
|
||||
.that(superRepo.getRepository().resolve("origin/master^"))
|
||||
.isEqualTo(superPreviousId);
|
||||
}
|
||||
@ -403,7 +403,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT extends AbstractSubmoduleSu
|
||||
.getAdvertisedRef("refs/heads/master")
|
||||
.getObjectId();
|
||||
|
||||
assertWithMessage("submodule subscription update " + "should have made one commit")
|
||||
assertWithMessage("submodule subscription update should have made one commit")
|
||||
.that(superRepo.getRepository().resolve("origin/master^"))
|
||||
.isEqualTo(superPreviousId);
|
||||
}
|
||||
@ -450,7 +450,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT extends AbstractSubmoduleSu
|
||||
.getAdvertisedRef("refs/heads/master")
|
||||
.getObjectId();
|
||||
|
||||
assertWithMessage("submodule subscription update " + "should have made one commit")
|
||||
assertWithMessage("submodule subscription update should have made one commit")
|
||||
.that(superRepo.getRepository().resolve("origin/master^"))
|
||||
.isEqualTo(superPreviousId);
|
||||
}
|
||||
@ -492,7 +492,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT extends AbstractSubmoduleSu
|
||||
.getAdvertisedRef("refs/heads/master")
|
||||
.getObjectId();
|
||||
|
||||
assertWithMessage("submodule subscription update " + "should have made one commit")
|
||||
assertWithMessage("submodule subscription update should have made one commit")
|
||||
.that(superRepo.getRepository().resolve("origin/master^"))
|
||||
.isEqualTo(superPreviousId);
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ public class ActionsIT extends AbstractDaemonTest {
|
||||
assertThat(info.label).isEqualTo("Submit whole topic");
|
||||
assertThat(info.method).isEqualTo("POST");
|
||||
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 {
|
||||
noSubmitWholeTopicAssertions(actions, 1);
|
||||
|
||||
@ -307,7 +307,7 @@ public class ActionsIT extends AbstractDaemonTest {
|
||||
assertThat(info.title)
|
||||
.isEqualTo(
|
||||
String.format(
|
||||
"Submit patch set 1 and ancestors (%d changes " + "altogether) into master",
|
||||
"Submit patch set 1 and ancestors (%d changes altogether) into master",
|
||||
nrChanges));
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class ChangeReviewersIT extends AbstractDaemonTest {
|
||||
assertThat(result.confirm).isTrue();
|
||||
assertThat(result.error)
|
||||
.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();
|
||||
|
||||
// Add medium group with confirmation.
|
||||
@ -515,7 +515,7 @@ public class ChangeReviewersIT extends AbstractDaemonTest {
|
||||
assertThat(reviewerResult.confirm).isTrue();
|
||||
assertThat(reviewerResult.error)
|
||||
.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.
|
||||
c = gApi.changes().id(r.getChangeId()).get();
|
||||
|
@ -155,7 +155,7 @@ public class ConfigChangeIT extends AbstractDaemonTest {
|
||||
.asString();
|
||||
|
||||
// Append and push malformed project config
|
||||
String pattern = "[access]\n" + "\tinheritFrom = " + allProjects.get() + "\n";
|
||||
String pattern = "[access]\n\tinheritFrom = " + allProjects.get() + "\n";
|
||||
String doubleInherit = pattern + "\tinheritFrom = " + parent.get() + "\n";
|
||||
config = config.replace(pattern, doubleInherit);
|
||||
|
||||
|
@ -72,7 +72,7 @@ public class DeleteVoteIT extends AbstractDaemonTest {
|
||||
assertThat(msg.rcpt()).containsExactly(user.emailAddress);
|
||||
assertThat(msg.body()).contains(admin.fullName + " has removed a vote on this change.\n");
|
||||
assertThat(msg.body())
|
||||
.contains("Removed Code-Review+1 by " + user.fullName + " <" + user.email + ">" + "\n");
|
||||
.contains("Removed Code-Review+1 by " + user.fullName + " <" + user.email + ">\n");
|
||||
|
||||
endPoint =
|
||||
"/changes/"
|
||||
|
@ -393,7 +393,7 @@ public class SubmitByMergeIfNecessaryIT extends AbstractSubmitByMerge {
|
||||
createChange(
|
||||
repo3,
|
||||
"master",
|
||||
"some accompanying changes for change3a in another repo " + "tied together via topic",
|
||||
"some accompanying changes for change3a in another repo tied together via topic",
|
||||
"a.txt",
|
||||
"1",
|
||||
"a-topic-here");
|
||||
|
@ -204,7 +204,7 @@ public class PushTagIT extends AbstractDaemonTest {
|
||||
commit(user.getIdent(), "subject");
|
||||
|
||||
boolean createTag = tagName == null;
|
||||
tagName = MoreObjects.firstNonNull(tagName, "v1" + "_" + System.nanoTime());
|
||||
tagName = MoreObjects.firstNonNull(tagName, "v1_" + System.nanoTime());
|
||||
switch (tagType) {
|
||||
case LIGHTWEIGHT:
|
||||
break;
|
||||
|
@ -154,7 +154,7 @@ public class ConsistencyCheckerIT extends AbstractDaemonTest {
|
||||
assertProblems(
|
||||
ctl,
|
||||
null,
|
||||
problem("Invalid revision on patch set 1:" + " fooooooooooooooooooooooooooooooooooooooo"));
|
||||
problem("Invalid revision on patch set 1: fooooooooooooooooooooooooooooooooooooooo"));
|
||||
}
|
||||
|
||||
// No test for ref existing but object missing; InMemoryRepository won't let
|
||||
@ -170,7 +170,7 @@ public class ConsistencyCheckerIT extends AbstractDaemonTest {
|
||||
ctl,
|
||||
null,
|
||||
problem("Ref missing: " + ps.getId().toRefName()),
|
||||
problem("Object missing: patch set 2:" + " deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"));
|
||||
problem("Object missing: patch set 2: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -725,7 +725,7 @@ public class ConsistencyCheckerIT extends AbstractDaemonTest {
|
||||
testRepo
|
||||
.commit()
|
||||
.parent(parent)
|
||||
.message(commit.getShortMessage() + "\n" + "\n" + "Change-Id: " + badId + "\n")
|
||||
.message(commit.getShortMessage() + "\n\nChange-Id: " + badId + "\n")
|
||||
.create();
|
||||
testRepo.getRevWalk().parseBody(mergedAs);
|
||||
assertThat(mergedAs.getFooterLines(FooterConstants.CHANGE_ID)).containsExactly(badId);
|
||||
|
@ -572,7 +572,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> implements Per
|
||||
try (Statement s = c.conn.createStatement()) {
|
||||
long used = 0;
|
||||
try (ResultSet r =
|
||||
s.executeQuery("SELECT" + " SUM(OCTET_LENGTH(k) + OCTET_LENGTH(v))" + " FROM data")) {
|
||||
s.executeQuery("SELECT SUM(OCTET_LENGTH(k) + OCTET_LENGTH(v)) FROM data")) {
|
||||
used = r.next() ? r.getLong(1) : 0;
|
||||
}
|
||||
if (used <= maxSize) {
|
||||
|
@ -42,7 +42,7 @@ public class H2CacheTest {
|
||||
|
||||
TypeLiteral<String> keyType = new TypeLiteral<String>() {};
|
||||
SqlStore<String, Boolean> store =
|
||||
new SqlStore<>("jdbc:h2:mem:" + "Test_" + (++dbCnt), keyType, 1 << 20, 0);
|
||||
new SqlStore<>("jdbc:h2:mem:Test_" + (++dbCnt), keyType, 1 << 20, 0);
|
||||
impl = new H2CacheImpl<>(MoreExecutors.directExecutor(), store, keyType, mem);
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,7 @@ public class GerritPublicKeyChecker extends PublicKeyChecker {
|
||||
private static String missingUserIds(Set<String> allowedUserIds) {
|
||||
StringBuilder sb =
|
||||
new StringBuilder(
|
||||
"Key must contain a valid" + " certification for one of the following identities:\n");
|
||||
"Key must contain a valid certification for one of the following identities:\n");
|
||||
Iterator<String> sorted = allowedUserIds.stream().sorted().iterator();
|
||||
while (sorted.hasNext()) {
|
||||
sb.append(" ").append(sorted.next());
|
||||
|
@ -39,7 +39,7 @@ public class GpgModule extends FactoryModule {
|
||||
bindConstant().annotatedWith(EnableSignedPush.class).to(enableSignedPush);
|
||||
|
||||
if (configEnableSignedPush && !havePgp) {
|
||||
log.info("Bouncy Castle PGP not installed; signed push verification is" + " disabled");
|
||||
log.info("Bouncy Castle PGP not installed; signed push verification is disabled");
|
||||
}
|
||||
if (enableSignedPush) {
|
||||
install(new SignedPushModule());
|
||||
|
@ -229,7 +229,7 @@ public class GerritPublicKeyCheckerTest {
|
||||
assertProblems(
|
||||
checker.check(key.getPublicKey()),
|
||||
Status.BAD,
|
||||
"No identities found for user; check" + " http://test/#/settings/web-identities");
|
||||
"No identities found for user; check http://test/#/settings/web-identities");
|
||||
|
||||
checker = checkerFactory.create().setStore(store).disableTrust();
|
||||
assertProblems(
|
||||
|
@ -197,7 +197,7 @@ public class PublicKeyCheckerTest {
|
||||
add(validKeyWithoutExpiration());
|
||||
save();
|
||||
|
||||
assertProblems(k, "Key is revoked (key material has been compromised):" + " test6 compromised");
|
||||
assertProblems(k, "Key is revoked (key material has been compromised): test6 compromised");
|
||||
|
||||
PGPPublicKeyRing kr = removeRevokers(k.getPublicKeyRing());
|
||||
store.add(kr);
|
||||
@ -227,7 +227,7 @@ public class PublicKeyCheckerTest {
|
||||
TestKey k = add(revokedCompromisedKey());
|
||||
save();
|
||||
|
||||
assertProblems(k, "Key is revoked (key material has been compromised):" + " test6 compromised");
|
||||
assertProblems(k, "Key is revoked (key material has been compromised): test6 compromised");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -127,9 +127,9 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
|
||||
/** Convert bare http:// and https:// URLs into <a href> tags. */
|
||||
public SafeHtml linkify() {
|
||||
final String part =
|
||||
"(?:" + "[a-zA-Z0-9$_+!*'%;:@=?#/~-]" + "|&(?!lt;|gt;)" + "|[.,](?!(?:\\s|$))" + ")";
|
||||
"(?:[a-zA-Z0-9$_+!*'%;:@=?#/~-]|&(?!lt;|gt;)|[.,](?!(?:\\s|$)))";
|
||||
return replaceAll(
|
||||
"(https?://" + part + "{2,}" + "(?:[(]" + part + "*" + "[)])*" + part + "*" + ")",
|
||||
"(https?://" + part + "{2,}(?:[(]" + part + "*[)])*" + part + "*)",
|
||||
"<a href=\"$1\" target=\"_blank\" rel=\"nofollow\">$1</a>");
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class SafeHtml_ReplaceTest {
|
||||
assertThat(o).isNotSameAs(n);
|
||||
assertThat(n.asString())
|
||||
.isEqualTo(
|
||||
"A\n" + "<a href=\"?42\">issue 42</a>\n" + "<a href=\"?9918\">issue 9918</a>\n" + "B");
|
||||
"A\n<a href=\"?42\">issue 42</a>\n<a href=\"?9918\">issue 9918</a>\nB");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -32,7 +32,7 @@ public class SafeHtml_WikifyPreformatTest {
|
||||
final SafeHtml n = o.wikify();
|
||||
assertThat(o).isNotSameAs(n);
|
||||
assertThat(n.asString())
|
||||
.isEqualTo("<p>A</p>" + "<p>" + pre(" This is pre") + pre(" formatted") + "</p>");
|
||||
.isEqualTo("<p>A</p><p>" + pre(" This is pre") + pre(" formatted") + "</p>");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -72,7 +72,7 @@ public class SafeHtml_WikifyPreformatTest {
|
||||
final SafeHtml n = o.wikify();
|
||||
assertThat(o).isNotSameAs(n);
|
||||
assertThat(n.asString())
|
||||
.isEqualTo("<p>" + pre(" Q") + pre(" <R>") + pre(" S") + "</p>" + "<p>B</p>");
|
||||
.isEqualTo("<p>" + pre(" Q") + pre(" <R>") + pre(" S") + "</p><p>B</p>");
|
||||
}
|
||||
|
||||
private static SafeHtml html(String text) {
|
||||
|
@ -181,7 +181,7 @@ class ProjectBasicAuthFilter implements Filter {
|
||||
|
||||
private boolean failAuthentication(Response rsp, String username) throws IOException {
|
||||
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);
|
||||
rsp.sendError(SC_UNAUTHORIZED);
|
||||
return false;
|
||||
|
@ -71,7 +71,7 @@ public class WebSessionManager {
|
||||
if (sessionMaxAgeMillis < MINUTES.toMillis(5)) {
|
||||
log.warn(
|
||||
String.format(
|
||||
"cache.%s.maxAge is set to %d milliseconds;" + " it should be at least 5 minutes.",
|
||||
"cache.%s.maxAge is set to %d milliseconds; it should be at least 5 minutes.",
|
||||
CACHE_NAME, sessionMaxAgeMillis));
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class PrologShell extends AbstractProgram {
|
||||
com.google.gerrit.common.Version.getVersion());
|
||||
System.err.println();
|
||||
System.err.println(
|
||||
"(type Ctrl-D or \"halt.\" to exit," + " \"['path/to/file.pl'].\" to load a file)");
|
||||
"(type Ctrl-D or \"halt.\" to exit, \"['path/to/file.pl'].\" to load a file)");
|
||||
System.err.println();
|
||||
System.err.flush();
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ public class BaseInit extends SiteProgram {
|
||||
}
|
||||
return names;
|
||||
} catch (FileNotFoundException e) {
|
||||
log.warn("Couldn't find distribution archive location." + " No plugin will be installed");
|
||||
log.warn("Couldn't find distribution archive location. No plugin will be installed");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ class LibraryDownloader {
|
||||
|
||||
} else if (!ui.yesno(
|
||||
null /* force an answer */,
|
||||
"error: SHA-1 checksum does not match\n" + "Use %s anyway", //
|
||||
"error: SHA-1 checksum does not match\nUse %s anyway", //
|
||||
dst.getFileName())) {
|
||||
deleteDst();
|
||||
throw new Die("aborted by user");
|
||||
|
@ -97,7 +97,7 @@ public abstract class SiteProgram extends AbstractProgram {
|
||||
protected void mustHaveValidSite() throws Die {
|
||||
if (!Files.exists(sitePath.resolve("etc").resolve("gerrit.config"))) {
|
||||
throw die(
|
||||
"not a Gerrit site: '" + getSitePath() + "'\n" + "Perhaps you need to run init first?");
|
||||
"not a Gerrit site: '" + getSitePath() + "'\nPerhaps you need to run init first?");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -364,7 +364,7 @@ public class IdentifiedUser extends CurrentUser {
|
||||
if (user == null) {
|
||||
user = "";
|
||||
}
|
||||
user = user + "|" + "account-" + ua.getId().toString();
|
||||
user = user + "|account-" + ua.getId().toString();
|
||||
|
||||
return new PersonIdent(name, user + "@" + guessHost(), when, tz);
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public class StarredChangesUtil {
|
||||
static IllegalLabelException mutuallyExclusiveLabels(String label1, String label2) {
|
||||
return new IllegalLabelException(
|
||||
String.format(
|
||||
"The labels %s and %s are mutually exclusive." + " Only one of them can be set.",
|
||||
"The labels %s and %s are mutually exclusive. Only one of them can be set.",
|
||||
label1, label2));
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ public class CreateAccount implements RestModifyView<TopLevelResource, AccountIn
|
||||
|
||||
if (!username.matches(Account.USER_NAME_PATTERN)) {
|
||||
throw new BadRequestException(
|
||||
"Username '" + username + "'" + " must contain only letters, numbers, _, - or .");
|
||||
"Username '" + username + "' must contain only letters, numbers, _, - or .");
|
||||
}
|
||||
|
||||
Set<AccountGroup.Id> groups = parseGroups(input.groups);
|
||||
|
@ -53,7 +53,7 @@ public class DeleteWatchedProjects
|
||||
throws AuthException, UnprocessableEntityException, OrmException, IOException,
|
||||
ConfigInvalidException {
|
||||
if (self.get() != rsrc.getUser() && !self.get().getCapabilities().canAdministrateServer()) {
|
||||
throw new AuthException("It is not allowed to edit project watches " + "of other users");
|
||||
throw new AuthException("It is not allowed to edit project watches of other users");
|
||||
}
|
||||
if (input == null) {
|
||||
return Response.none();
|
||||
|
@ -52,7 +52,7 @@ public class GetWatchedProjects implements RestReadView<AccountResource> {
|
||||
public List<ProjectWatchInfo> apply(AccountResource rsrc)
|
||||
throws OrmException, AuthException, IOException, ConfigInvalidException {
|
||||
if (self.get() != rsrc.getUser() && !self.get().getCapabilities().canAdministrateServer()) {
|
||||
throw new AuthException("It is not allowed to list project watches " + "of other users");
|
||||
throw new AuthException("It is not allowed to list project watches of other users");
|
||||
}
|
||||
Account.Id accountId = rsrc.getUser().getAccountId();
|
||||
List<ProjectWatchInfo> projectWatchInfos = new ArrayList<>();
|
||||
|
@ -50,7 +50,7 @@ public class ChangeIdHandler extends OptionHandler<Change.Id> {
|
||||
final String[] tokens = token.split(",");
|
||||
if (tokens.length != 3) {
|
||||
throw new CmdLineException(
|
||||
owner, "change should be specified as " + "<project>,<branch>,<change-id>");
|
||||
owner, "change should be specified as <project>,<branch>,<change-id>");
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -57,7 +57,7 @@ public final class UniversalAuthBackend implements AuthBackend {
|
||||
|
||||
String msg =
|
||||
String.format(
|
||||
"Multiple AuthBackends attempted to handle request:" + " authUsers=%s authExs=%s",
|
||||
"Multiple AuthBackends attempted to handle request: authUsers=%s authExs=%s",
|
||||
authUsers, authExs);
|
||||
throw new AuthException(msg);
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ public class ChangeEdits
|
||||
@Option(
|
||||
name = "--base",
|
||||
aliases = {"-b"},
|
||||
usage = "whether to load the content on the base revision instead of the" + " change edit"
|
||||
usage = "whether to load the content on the base revision instead of the change edit"
|
||||
)
|
||||
private boolean base;
|
||||
|
||||
@ -478,7 +478,7 @@ public class ChangeEdits
|
||||
@Option(
|
||||
name = "--base",
|
||||
aliases = {"-b"},
|
||||
usage = "whether to load the message on the base revision instead" + " of the change edit"
|
||||
usage = "whether to load the message on the base revision instead of the change edit"
|
||||
)
|
||||
private boolean base;
|
||||
|
||||
|
@ -374,7 +374,7 @@ public class ConsistencyChecker {
|
||||
if (!rw.isMergedInto(commit, tip)) {
|
||||
problem(
|
||||
String.format(
|
||||
"Expected merged commit %s is not merged into" + " destination ref %s (%s)",
|
||||
"Expected merged commit %s is not merged into destination ref %s (%s)",
|
||||
commit.name(), change().getDest().get(), tip.name()));
|
||||
return;
|
||||
}
|
||||
@ -412,7 +412,7 @@ public class ConsistencyChecker {
|
||||
if (changeId != null && !changeId.equals(change().getKey().get())) {
|
||||
problem(
|
||||
String.format(
|
||||
"Expected merged commit %s has Change-Id: %s," + " but expected %s",
|
||||
"Expected merged commit %s has Change-Id: %s, but expected %s",
|
||||
commit.name(), changeId, change().getKey().get()));
|
||||
return;
|
||||
}
|
||||
|
@ -552,7 +552,7 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
|
||||
if (description == null) {
|
||||
throw new BadRequestException(
|
||||
String.format(
|
||||
"A description is required " + "for the suggested fix of the robot comment on %s",
|
||||
"A description is required for the suggested fix of the robot comment on %s",
|
||||
commentPath));
|
||||
}
|
||||
}
|
||||
@ -586,7 +586,7 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
|
||||
if (replacementPath == null) {
|
||||
throw new BadRequestException(
|
||||
String.format(
|
||||
"A file path must be given " + "for the replacement of the robot comment on %s",
|
||||
"A file path must be given for the replacement of the robot comment on %s",
|
||||
commentPath));
|
||||
}
|
||||
}
|
||||
@ -608,7 +608,7 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
|
||||
if (range == null) {
|
||||
throw new BadRequestException(
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ public class PreviewSubmit implements RestReadView<RevisionResource> {
|
||||
}
|
||||
} catch (LimitExceededException e) {
|
||||
throw new NotImplementedException(
|
||||
"The bundle is too big to " + "generate at the server");
|
||||
"The bundle is too big to generate at the server");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -164,7 +164,7 @@ public class RebaseUtil {
|
||||
throw new UnprocessableEntityException("Cannot rebase a change with multiple parents.");
|
||||
} else if (commit.getParentCount() == 0) {
|
||||
throw new UnprocessableEntityException(
|
||||
"Cannot rebase a change without any parents" + " (is this the initial commit?).");
|
||||
"Cannot rebase a change without any parents (is this the initial commit?).");
|
||||
}
|
||||
|
||||
RevId parentRev = new RevId(commit.getParent(0).name());
|
||||
@ -184,7 +184,7 @@ public class RebaseUtil {
|
||||
if (depChange.getStatus().isOpen()) {
|
||||
if (depPatchSet.getId().equals(depChange.currentPatchSetId())) {
|
||||
throw new ResourceConflictException(
|
||||
"Change is already based on the latest patch set of the" + " dependent change.");
|
||||
"Change is already based on the latest patch set of the dependent change.");
|
||||
}
|
||||
baseRev = cd.currentPatchSet().getRevision().get();
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ public class Submit
|
||||
cs = mergeSuperSet.get().completeChangeSet(db, cd.change(), resource.getControl().getUser());
|
||||
} catch (OrmException | IOException e) {
|
||||
throw new OrmRuntimeException(
|
||||
"Could not determine complete set of " + "changes to be submitted", e);
|
||||
"Could not determine complete set of changes to be submitted", e);
|
||||
}
|
||||
|
||||
int topicSize = 0;
|
||||
|
@ -111,7 +111,7 @@ public class ChangeEditModifier {
|
||||
Optional<ChangeEdit> changeEdit = lookupChangeEdit(changeControl);
|
||||
if (changeEdit.isPresent()) {
|
||||
throw new InvalidChangeOperationException(
|
||||
String.format("A change edit " + "already exists for change %s", changeControl.getId()));
|
||||
String.format("A change edit already exists for change %s", changeControl.getId()));
|
||||
}
|
||||
|
||||
PatchSet currentPatchSet = lookupCurrentPatchSet(changeControl);
|
||||
|
@ -150,7 +150,7 @@ public class EventFactory {
|
||||
try {
|
||||
a.commitMessage = changeDataFactory.create(db, change).commitMessage();
|
||||
} catch (Exception e) {
|
||||
log.error("Error while getting full commit message for" + " change " + a.number);
|
||||
log.error("Error while getting full commit message for change " + a.number);
|
||||
}
|
||||
a.url = getChangeUrl(change);
|
||||
a.owner = asAccountAttribute(change.getOwner());
|
||||
|
@ -93,7 +93,7 @@ public class BatchUpdateReviewDb extends ReviewDbWrapper {
|
||||
@Override
|
||||
public Change atomicUpdate(Change.Id key, AtomicUpdate<Change> update) {
|
||||
throw new UnsupportedOperationException(
|
||||
"do not call atomicUpdate; updateChange is always called within a" + " transaction");
|
||||
"do not call atomicUpdate; updateChange is always called within a transaction");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ public class MergeOp implements AutoCloseable {
|
||||
} else if (results.isEmpty()) {
|
||||
throw new IllegalStateException(
|
||||
String.format(
|
||||
"SubmitRuleEvaluator.evaluate for change %s " + "returned empty list for %s in %s",
|
||||
"SubmitRuleEvaluator.evaluate for change %s returned empty list for %s in %s",
|
||||
cd.getId(), patchSet.getId(), cd.change().getProject().get()));
|
||||
}
|
||||
|
||||
@ -733,7 +733,7 @@ public class MergeOp implements AutoCloseable {
|
||||
try {
|
||||
return orm.openRepo(project);
|
||||
} catch (NoSuchProjectException noProject) {
|
||||
logWarn("Project " + noProject.project() + " no longer exists, " + "abandoning open changes");
|
||||
logWarn("Project " + noProject.project() + " no longer exists, abandoning open changes");
|
||||
abandonAllOpenChangeForDeletedProject(noProject.project());
|
||||
} catch (IOException e) {
|
||||
throw new IntegrationException("Error opening project " + project, e);
|
||||
|
@ -236,7 +236,7 @@ public class MultiProgressMonitor {
|
||||
if (!done && workerFuture.isDone()) {
|
||||
// The worker may not have called end() explicitly, which is likely a
|
||||
// programming error.
|
||||
log.warn("MultiProgressMonitor worker did not call end()" + " before returning");
|
||||
log.warn("MultiProgressMonitor worker did not call end() before returning");
|
||||
end();
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ public class ReceiveCommits {
|
||||
UPDATE(
|
||||
"You are not allowed to perform this operation.\n"
|
||||
+ "To push into this reference you need 'Push' rights."),
|
||||
DELETE("You need 'Push' rights with the 'Force Push'\n" + "flag set to delete references."),
|
||||
DELETE("You need 'Push' rights with the 'Force Push'\nflag set to delete references."),
|
||||
DELETE_CHANGES("Cannot delete from '" + REFS_CHANGES + "'"),
|
||||
CODE_REVIEW(
|
||||
"You need 'Push' rights to upload code review requests.\n"
|
||||
@ -762,7 +762,7 @@ public class ReceiveCommits {
|
||||
String refName = replace.inputCommand.getRefName();
|
||||
checkState(
|
||||
NEW_PATCHSET.matcher(refName).matches(),
|
||||
"expected a new patch set command as input when creating %s;" + " got %s",
|
||||
"expected a new patch set command as input when creating %s; got %s",
|
||||
replace.cmd.getRefName(),
|
||||
refName);
|
||||
try {
|
||||
@ -2845,7 +2845,7 @@ public class ReceiveCommits {
|
||||
}
|
||||
|
||||
logDebug(
|
||||
"Auto-closing {} changes with existing patch sets and {} with" + " new patch sets",
|
||||
"Auto-closing {} changes with existing patch sets and {} with new patch sets",
|
||||
existingPatchSets,
|
||||
newPatchSets);
|
||||
bu.execute();
|
||||
|
@ -530,7 +530,7 @@ public class SubmoduleOp {
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new SubmoduleException(
|
||||
"Could not perform a revwalk to " + "create superproject commit message", e);
|
||||
"Could not perform a revwalk to create superproject commit message", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class MergeValidators {
|
||||
private static final String INVALID_CONFIG =
|
||||
"Change contains an invalid project configuration.";
|
||||
private static final String PARENT_NOT_FOUND =
|
||||
"Change contains an invalid project configuration:\n" + "Parent project does not exist.";
|
||||
"Change contains an invalid project configuration:\nParent project does not exist.";
|
||||
private static final String PLUGIN_VALUE_NOT_EDITABLE =
|
||||
"Change contains an invalid project configuration:\n"
|
||||
+ "One of the plugin configuration parameters is not editable.";
|
||||
|
@ -122,7 +122,7 @@ public class IndexedChangeQuery extends IndexedQuery<Change.Id, ChangeData>
|
||||
Predicate<ChangeData> pred = getChild(0);
|
||||
checkState(
|
||||
pred.isMatchable(),
|
||||
"match invoked, but child predicate %s " + "doesn't implement %s",
|
||||
"match invoked, but child predicate %s doesn't implement %s",
|
||||
pred,
|
||||
Matchable.class.getName());
|
||||
return pred.asMatchable().match(cd);
|
||||
|
@ -65,7 +65,7 @@ public class Pop3MailReceiver extends MailReceiver {
|
||||
try {
|
||||
try {
|
||||
if (!pop3.login(mailSettings.username, mailSettings.password)) {
|
||||
log.error("Could not login to POP3 email server." + " Check username and password");
|
||||
log.error("Could not login to POP3 email server. Check username and password");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
|
@ -207,7 +207,7 @@ public abstract class ChangeEmail extends NotificationEmail {
|
||||
}
|
||||
|
||||
public String getChangeMessageThreadId() throws EmailException {
|
||||
return velocify("<gerrit.${change.createdOn.time}.$change.key.get()" + "@$email.gerritHost>");
|
||||
return velocify("<gerrit.${change.createdOn.time}.$change.key.get()@$email.gerritHost>");
|
||||
}
|
||||
|
||||
/** Format the sender's "cover letter", {@link #getCoverLetter()}. */
|
||||
|
@ -192,7 +192,7 @@ public class SmtpEmailSender implements EmailSender {
|
||||
setMissingHeader(
|
||||
hdrs,
|
||||
"Content-Type",
|
||||
"multipart/alternative; " + "boundary=\"" + boundary + "\"; " + "charset=UTF-8");
|
||||
"multipart/alternative; boundary=\"" + boundary + "\"; charset=UTF-8");
|
||||
encodedBody = buildMultipartBody(boundary, textBody, htmlBody);
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ public abstract class AbstractChangeUpdate {
|
||||
checkArgument(c.revId != null, "RevId required for comment: %s", c);
|
||||
checkArgument(
|
||||
c.author.getId().equals(getAccountId()),
|
||||
"The author for the following comment does not match the author of" + " this %s (%s): %s",
|
||||
"The author for the following comment does not match the author of this %s (%s): %s",
|
||||
getClass().getSimpleName(),
|
||||
getAccountId(),
|
||||
c);
|
||||
|
@ -166,7 +166,7 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
|
||||
checkNotNull(change, "change %s not found in ReviewDb", changeId);
|
||||
checkArgument(
|
||||
change.getProject().equals(project),
|
||||
"passed project %s when creating ChangeNotes for %s, but actual" + " project is %s",
|
||||
"passed project %s when creating ChangeNotes for %s, but actual project is %s",
|
||||
project,
|
||||
changeId,
|
||||
change.getProject());
|
||||
@ -216,7 +216,7 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
|
||||
private ChangeNotes createFromChangeOnlyWhenNoteDbDisabled(Change change) throws OrmException {
|
||||
checkState(
|
||||
!args.migration.readChanges(),
|
||||
"do not call" + " createFromChangeWhenNoteDbDisabled when NoteDb is enabled");
|
||||
"do not call createFromChangeWhenNoteDbDisabled when NoteDb is enabled");
|
||||
return new ChangeNotes(args, change).load();
|
||||
}
|
||||
|
||||
@ -327,14 +327,14 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
|
||||
if (change == null) {
|
||||
if (defaultStorage == PrimaryStorage.REVIEW_DB) {
|
||||
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;
|
||||
}
|
||||
// TODO(dborowitz): See discussion in BatchUpdate#newChangeContext.
|
||||
change = newNoteDbOnlyChange(project, id);
|
||||
} else if (!change.getProject().equals(project)) {
|
||||
log.error(
|
||||
"skipping change {} found in project {} " + "because ReviewDb change has project {}",
|
||||
"skipping change {} found in project {} because ReviewDb change has project {}",
|
||||
id,
|
||||
project,
|
||||
change.getProject());
|
||||
|
@ -527,7 +527,7 @@ public class NoteDbUpdateManager implements AutoCloseable {
|
||||
private MismatchedStateException(Change.Id id, NoteDbChangeState expectedState) {
|
||||
super(
|
||||
String.format(
|
||||
"cannot apply NoteDb updates for change %s;" + " change meta ref does not match %s",
|
||||
"cannot apply NoteDb updates for change %s; change meta ref does not match %s",
|
||||
id, expectedState.getChangeMetaId().name()));
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class ChangeMessageEvent extends Event {
|
||||
Change.Status.ABANDONED, Pattern.compile("^Abandoned(\n.*)*$"),
|
||||
Change.Status.MERGED,
|
||||
Pattern.compile(
|
||||
"^Change has been successfully" + " (merged|cherry-picked|rebased|pushed).*$"),
|
||||
"^Change has been successfully (merged|cherry-picked|rebased|pushed).*$"),
|
||||
Change.Status.NEW, Pattern.compile("^Restored(\n.*)*$"));
|
||||
|
||||
private static final Pattern TOPIC_SET_REGEXP = Pattern.compile("^Topic set to (.+)$");
|
||||
|
@ -194,7 +194,7 @@ public class PluginLoader implements LifecycleListener {
|
||||
if (!originalName.equals(name)) {
|
||||
log.warn(
|
||||
String.format(
|
||||
"Plugin provides its own name: <%s>," + " use it instead of the input name: <%s>",
|
||||
"Plugin provides its own name: <%s>, use it instead of the input name: <%s>",
|
||||
name, originalName));
|
||||
}
|
||||
|
||||
@ -256,7 +256,7 @@ public class PluginLoader implements LifecycleListener {
|
||||
public void disablePlugins(Set<String> names) {
|
||||
if (!isRemoteAdminEnabled()) {
|
||||
log.warn(
|
||||
"Remote plugin administration is disabled," + " ignoring disablePlugins(" + names + ")");
|
||||
"Remote plugin administration is disabled, ignoring disablePlugins(" + names + ")");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ public class PluginLoader implements LifecycleListener {
|
||||
public void enablePlugins(Set<String> names) throws PluginInstallException {
|
||||
if (!isRemoteAdminEnabled()) {
|
||||
log.warn(
|
||||
"Remote plugin administration is disabled," + " ignoring enablePlugins(" + names + ")");
|
||||
"Remote plugin administration is disabled, ignoring enablePlugins(" + names + ")");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class CheckMergeability implements RestReadView<BranchResource> {
|
||||
@Option(
|
||||
name = "--strategy",
|
||||
metaVar = "STRATEGY",
|
||||
usage = "name of the merge strategy, refer to " + "org.eclipse.jgit.merge.MergeStrategy"
|
||||
usage = "name of the merge strategy, refer to org.eclipse.jgit.merge.MergeStrategy"
|
||||
)
|
||||
public void setStrategy(String strategy) {
|
||||
this.strategy = strategy;
|
||||
|
@ -107,7 +107,7 @@ public class SetAccess implements RestModifyView<ProjectResource, ProjectAccessI
|
||||
checkGlobalCapabilityPermissions(config.getName());
|
||||
} else if (!projectControl.controlForRef(section.getName()).isOwner()) {
|
||||
throw new AuthException(
|
||||
"You are not allowed to edit permissions" + "for ref: " + section.getName());
|
||||
"You are not allowed to edit permissionsfor ref: " + section.getName());
|
||||
}
|
||||
}
|
||||
// Perform addition checks
|
||||
@ -122,7 +122,7 @@ public class SetAccess implements RestModifyView<ProjectResource, ProjectAccessI
|
||||
throw new BadRequestException("invalid section name");
|
||||
}
|
||||
if (!projectControl.controlForRef(name).isOwner()) {
|
||||
throw new AuthException("You are not allowed to edit permissions" + "for ref: " + name);
|
||||
throw new AuthException("You are not allowed to edit permissionsfor ref: " + name);
|
||||
}
|
||||
RefPattern.validate(name);
|
||||
}
|
||||
@ -273,12 +273,12 @@ public class SetAccess implements RestModifyView<ProjectResource, ProjectAccessI
|
||||
|
||||
if (!allProjects.equals(projectName)) {
|
||||
throw new BadRequestException(
|
||||
"Cannot edit global capabilities " + "for projects other than " + allProjects.get());
|
||||
"Cannot edit global capabilities for projects other than " + allProjects.get());
|
||||
}
|
||||
|
||||
if (!identifiedUser.get().getCapabilities().canAdministrateServer()) {
|
||||
throw new AuthException(
|
||||
"Editing global capabilities " + "requires " + GlobalCapability.ADMINISTRATE_SERVER);
|
||||
"Editing global capabilities requires " + GlobalCapability.ADMINISTRATE_SERVER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ public class SubmitRuleEvaluator {
|
||||
// whether or not that is actually possible given the permissions.
|
||||
return ruleError(
|
||||
String.format(
|
||||
"Submit rule '%s' for change %s of %s has " + "no solution.",
|
||||
"Submit rule '%s' for change %s of %s has no solution.",
|
||||
getSubmitRuleName(), cd.getId(), getProjectName()));
|
||||
}
|
||||
|
||||
@ -362,7 +362,7 @@ public class SubmitRuleEvaluator {
|
||||
private List<SubmitRecord> invalidResult(Term rule, Term record, String reason) {
|
||||
return ruleError(
|
||||
String.format(
|
||||
"Submit rule %s for change %s of %s output " + "invalid result: %s%s",
|
||||
"Submit rule %s for change %s of %s output invalid result: %s%s",
|
||||
rule,
|
||||
cd.getId(),
|
||||
getProjectName(),
|
||||
|
@ -86,7 +86,7 @@ public class AndPredicate<T> extends Predicate<T> implements Matchable<T> {
|
||||
for (Predicate<T> c : children) {
|
||||
checkState(
|
||||
c.isMatchable(),
|
||||
"match invoked, but child predicate %s " + "doesn't implement %s",
|
||||
"match invoked, but child predicate %s doesn't implement %s",
|
||||
c,
|
||||
Matchable.class.getName());
|
||||
if (!c.asMatchable().match(object)) {
|
||||
|
@ -67,7 +67,7 @@ public class NotPredicate<T> extends Predicate<T> implements Matchable<T> {
|
||||
public boolean match(final T object) throws OrmException {
|
||||
checkState(
|
||||
that.isMatchable(),
|
||||
"match invoked, but child predicate %s " + "doesn't implement %s",
|
||||
"match invoked, but child predicate %s doesn't implement %s",
|
||||
that,
|
||||
Matchable.class.getName());
|
||||
return !that.asMatchable().match(object);
|
||||
|
@ -86,7 +86,7 @@ public class OrPredicate<T> extends Predicate<T> implements Matchable<T> {
|
||||
for (final Predicate<T> c : children) {
|
||||
checkState(
|
||||
c.isMatchable(),
|
||||
"match invoked, but child predicate %s " + "doesn't implement %s",
|
||||
"match invoked, but child predicate %s doesn't implement %s",
|
||||
c,
|
||||
Matchable.class.getName());
|
||||
if (c.asMatchable().match(object)) {
|
||||
|
@ -53,7 +53,7 @@ public abstract class QueryProcessor<T> {
|
||||
metricMaker.newTimer(
|
||||
"query/query_latency",
|
||||
new Description(
|
||||
"Successful query latency," + " accumulated over the life of the process")
|
||||
"Successful query latency, accumulated over the life of the process")
|
||||
.setCumulative()
|
||||
.setUnit(Description.Units.MILLISECONDS),
|
||||
index);
|
||||
|
@ -668,7 +668,7 @@ public class ChangeData {
|
||||
if (project == null) {
|
||||
checkState(
|
||||
!notesMigration.readChanges(),
|
||||
"should not have created " + " ChangeData without a project when NoteDb is enabled");
|
||||
"should not have created ChangeData without a project when NoteDb is enabled");
|
||||
project = change().getProject();
|
||||
}
|
||||
return project;
|
||||
|
@ -151,7 +151,7 @@ public class Schema_106 extends SchemaVersion {
|
||||
} catch (IOException e) {
|
||||
throw new IOException(
|
||||
String.format(
|
||||
"ERROR: Failed to create reflog file for the" + " %s branch in repository %s",
|
||||
"ERROR: Failed to create reflog file for the %s branch in repository %s",
|
||||
RefNames.REFS_CONFIG, project.get()));
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public class Schema_123 extends SchemaVersion {
|
||||
MultimapBuilder.hashKeys().arrayListValues().build();
|
||||
try (Statement stmt = ((JdbcSchema) db).getConnection().createStatement();
|
||||
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()) {
|
||||
Account.Id accountId = new Account.Id(rs.getInt(1));
|
||||
Change.Id changeId = new Change.Id(rs.getInt(2));
|
||||
|
@ -29,7 +29,7 @@ public class Schema_94 extends SchemaVersion {
|
||||
@Override
|
||||
protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException {
|
||||
try (Statement stmt = newStatement(db)) {
|
||||
stmt.execute("CREATE INDEX patch_sets_byRevision" + " ON patch_sets (revision)");
|
||||
stmt.execute("CREATE INDEX patch_sets_byRevision ON patch_sets (revision)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class Schema_98 extends SchemaVersion {
|
||||
|
||||
@Override
|
||||
protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException {
|
||||
ui.message("Migrate user preference showUserInReview to " + "reviewCategoryStrategy");
|
||||
ui.message("Migrate user preference showUserInReview to reviewCategoryStrategy");
|
||||
try (Statement stmt = newStatement(db)) {
|
||||
stmt.executeUpdate(
|
||||
"UPDATE accounts SET "
|
||||
|
@ -71,7 +71,7 @@ public class GerritCommonTest extends PrologTestCase {
|
||||
PrologEnvironment env = envFactory.create(machine);
|
||||
setUpEnvironment(env);
|
||||
|
||||
String script = "loopy :- b(5).\n" + "b(N) :- N > 0, !, S = N - 1, b(S).\n" + "b(_) :- true.\n";
|
||||
String script = "loopy :- b(5).\nb(N) :- N > 0, !, S = N - 1, b(S).\nb(_) :- true.\n";
|
||||
|
||||
SymbolTerm nameTerm = SymbolTerm.create("testReductionLimit");
|
||||
JavaObjectTerm inTerm =
|
||||
|
@ -87,7 +87,7 @@ public class HashtagsTest {
|
||||
|
||||
@Test
|
||||
public void hashtagsWithAccentedCharacters() throws Exception {
|
||||
String commitMessage = "Jag #måste #öva på min #Svenska!\n\n" + "Jag behöver en #läkare.";
|
||||
String commitMessage = "Jag #måste #öva på min #Svenska!\n\nJag behöver en #läkare.";
|
||||
assertThat(HashtagsUtil.extractTags(commitMessage))
|
||||
.containsExactlyElementsIn(Sets.newHashSet("måste", "öva", "Svenska", "läkare"));
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ public class ProjectConfigTest extends LocalDiskRepositoryTestCase {
|
||||
ProjectConfig cfg = read(rev);
|
||||
assertThat(cfg.getValidationErrors()).hasSize(1);
|
||||
assertThat(Iterables.getOnlyElement(cfg.getValidationErrors()).getMessage())
|
||||
.isEqualTo("project.config: Invalid defaultValue \"-2\" " + "for label \"CustomLabel\"");
|
||||
.isEqualTo("project.config: Invalid defaultValue \"-2\" for label \"CustomLabel\"");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -62,11 +62,11 @@ public class MetadataParserTest {
|
||||
b.subject("");
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append(toFooterWithDelimiter(MetadataName.CHANGE_ID) + "cid" + "\r\n");
|
||||
stringBuilder.append("> " + toFooterWithDelimiter(MetadataName.PATCH_SET) + "1" + "\n");
|
||||
stringBuilder.append(toFooterWithDelimiter(MetadataName.MESSAGE_TYPE) + "comment" + "\n");
|
||||
stringBuilder.append(toFooterWithDelimiter(MetadataName.CHANGE_ID) + "cid\r\n");
|
||||
stringBuilder.append("> " + toFooterWithDelimiter(MetadataName.PATCH_SET) + "1\n");
|
||||
stringBuilder.append(toFooterWithDelimiter(MetadataName.MESSAGE_TYPE) + "comment\n");
|
||||
stringBuilder.append(
|
||||
toFooterWithDelimiter(MetadataName.TIMESTAMP) + "Tue, 25 Oct 2016 02:11:35 -0700" + "\r\n");
|
||||
toFooterWithDelimiter(MetadataName.TIMESTAMP) + "Tue, 25 Oct 2016 02:11:35 -0700\r\n");
|
||||
b.textContent(stringBuilder.toString());
|
||||
|
||||
Address author = new Address("Diffy", "test@gerritcodereview.com");
|
||||
@ -92,10 +92,10 @@ public class MetadataParserTest {
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append(
|
||||
"<div id\"someid\">" + toFooterWithDelimiter(MetadataName.CHANGE_ID) + "cid" + "</div>");
|
||||
stringBuilder.append("<div>" + toFooterWithDelimiter(MetadataName.PATCH_SET) + "1" + "</div>");
|
||||
"<div id\"someid\">" + toFooterWithDelimiter(MetadataName.CHANGE_ID) + "cid</div>");
|
||||
stringBuilder.append("<div>" + toFooterWithDelimiter(MetadataName.PATCH_SET) + "1</div>");
|
||||
stringBuilder.append(
|
||||
"<div>" + toFooterWithDelimiter(MetadataName.MESSAGE_TYPE) + "comment" + "</div>");
|
||||
"<div>" + toFooterWithDelimiter(MetadataName.MESSAGE_TYPE) + "comment</div>");
|
||||
stringBuilder.append(
|
||||
"<div>"
|
||||
+ toFooterWithDelimiter(MetadataName.TIMESTAMP)
|
||||
|
@ -72,7 +72,7 @@ public class AttachmentMessage extends RawMailMessage {
|
||||
System.out.println("\uD83D\uDE1B test");
|
||||
MailMessage.Builder expect = MailMessage.builder();
|
||||
expect
|
||||
.id("<CAM7sg=3meaAVUxW3KXeJEVs8sv_ADw1BnvpcHHiYVR2TQQi__w" + "@mail.gmail.com>")
|
||||
.id("<CAM7sg=3meaAVUxW3KXeJEVs8sv_ADw1BnvpcHHiYVR2TQQi__w@mail.gmail.com>")
|
||||
.from(new Address("Patrick Hiesel", "hiesel@google.com"))
|
||||
.addTo(new Address("Patrick Hiesel", "hiesel@google.com"))
|
||||
.textContent("Contains unwanted attachment")
|
||||
|
@ -96,7 +96,7 @@ public class HtmlMimeMessage extends RawMailMessage {
|
||||
.addTo(new Address("Patrick Hiesel", "hiesel@google.com"))
|
||||
.textContent(textContent)
|
||||
.htmlContent(unencodedHtmlContent)
|
||||
.subject("Change in gerrit[master]: Implement " + "receiver class structure and bindings")
|
||||
.subject("Change in gerrit[master]: Implement receiver class structure and bindings")
|
||||
.addAdditionalHeader("MIME-Version: 1.0")
|
||||
.dateReceived(new DateTime(2016, 10, 25, 9, 11, 35, 0, DateTimeZone.UTC));
|
||||
return expect.build();
|
||||
|
@ -123,10 +123,10 @@ public class SimpleTextMessage extends RawMailMessage {
|
||||
.addCc(new Address("Jonathan Nieder", "jrn@google.com"))
|
||||
.addCc(new Address("Patrick Hiesel", "hiesel@google.com"))
|
||||
.textContent(textContent)
|
||||
.subject("Change in gerrit[master]: (Re)enable voting" + " buttons for merged changes")
|
||||
.subject("Change in gerrit[master]: (Re)enable voting buttons for merged changes")
|
||||
.dateReceived(new DateTime(2016, 10, 25, 9, 11, 35, 0, DateTimeZone.UTC))
|
||||
.addAdditionalHeader(
|
||||
"Authentication-Results: mx.google.com; " + "dkim=pass header.i=@google.com;")
|
||||
"Authentication-Results: mx.google.com; dkim=pass header.i=@google.com;")
|
||||
.addAdditionalHeader(
|
||||
"In-Reply-To: <gerrit.1477487889000.Iba501e00bee"
|
||||
+ "77be3bd0ced72f88fd04ba0accaed@gerrit-review.googlesource.com>")
|
||||
|
@ -121,7 +121,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
b1,
|
||||
b2,
|
||||
"changeId differs for Changes: {" + id1 + "} != {" + id2 + "}",
|
||||
"createdOn differs for Changes:" + " {2009-09-30 17:00:00.0} != {2009-09-30 17:00:06.0}",
|
||||
"createdOn differs for Changes: {2009-09-30 17:00:00.0} != {2009-09-30 17:00:06.0}",
|
||||
"effective last updated time differs for Changes:"
|
||||
+ " {2009-09-30 17:00:00.0} != {2009-09-30 17:00:06.0}");
|
||||
}
|
||||
@ -310,7 +310,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
ChangeBundle b2 =
|
||||
new ChangeBundle(
|
||||
c2, messages(), patchSets(), approvals(), comments(), reviewers(), REVIEW_DB);
|
||||
assertDiffs(b1, b2, "topic differs for Change.Id " + c1.getId() + ":" + " {} != {null}");
|
||||
assertDiffs(b1, b2, "topic differs for Change.Id " + c1.getId() + ": {} != {null}");
|
||||
|
||||
// Topic ignored if ReviewDb is empty and NoteDb is null.
|
||||
b1 =
|
||||
@ -328,7 +328,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
b2 =
|
||||
new ChangeBundle(
|
||||
c2, messages(), patchSets(), approvals(), comments(), reviewers(), REVIEW_DB);
|
||||
assertDiffs(b1, b2, "topic differs for Change.Id " + c1.getId() + ":" + " {} != {null}");
|
||||
assertDiffs(b1, b2, "topic differs for Change.Id " + c1.getId() + ": {} != {null}");
|
||||
|
||||
// Null is not equal to a non-empty string.
|
||||
Change c3 = clone(c1);
|
||||
@ -339,7 +339,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
b2 =
|
||||
new ChangeBundle(
|
||||
c2, messages(), patchSets(), approvals(), comments(), reviewers(), NOTE_DB);
|
||||
assertDiffs(b1, b2, "topic differs for Change.Id " + c1.getId() + ":" + " {topic} != {null}");
|
||||
assertDiffs(b1, b2, "topic differs for Change.Id " + c1.getId() + ": {topic} != {null}");
|
||||
|
||||
// Null is equal to a string that is all whitespace.
|
||||
Change c4 = clone(c1);
|
||||
@ -368,7 +368,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
ChangeBundle b2 =
|
||||
new ChangeBundle(
|
||||
c2, messages(), patchSets(), approvals(), comments(), reviewers(), REVIEW_DB);
|
||||
assertDiffs(b1, b2, "topic differs for Change.Id " + c1.getId() + ":" + " { abc } != {abc}");
|
||||
assertDiffs(b1, b2, "topic differs for Change.Id " + c1.getId() + ": { abc } != {abc}");
|
||||
|
||||
// Leading whitespace in ReviewDb topic is ignored.
|
||||
b1 =
|
||||
@ -389,7 +389,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
b2 =
|
||||
new ChangeBundle(
|
||||
c3, messages(), patchSets(), approvals(), comments(), reviewers(), NOTE_DB);
|
||||
assertDiffs(b1, b2, "topic differs for Change.Id " + c1.getId() + ":" + " { abc } != {cba}");
|
||||
assertDiffs(b1, b2, "topic differs for Change.Id " + c1.getId() + ": { abc } != {cba}");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -492,7 +492,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
assertDiffs(
|
||||
b1,
|
||||
b2,
|
||||
"subject differs for Change.Id " + c1.getId() + ":" + " {Change subject} != {Change sub}");
|
||||
"subject differs for Change.Id " + c1.getId() + ": {Change subject} != {Change sub}");
|
||||
|
||||
// ReviewDb has shorter subject, allowed.
|
||||
b1 =
|
||||
@ -512,7 +512,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
assertDiffs(
|
||||
b1,
|
||||
b2,
|
||||
"subject differs for Change.Id " + c1.getId() + ":" + " {Change subject} != {Change sub}");
|
||||
"subject differs for Change.Id " + c1.getId() + ": {Change subject} != {Change sub}");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -645,7 +645,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
assertDiffs(
|
||||
b1,
|
||||
b2,
|
||||
"currentPatchSetId differs for Change.Id " + c1.getId() + ":" + " {1} != {0}",
|
||||
"currentPatchSetId differs for Change.Id " + c1.getId() + ": {1} != {0}",
|
||||
"subject differs for Change.Id "
|
||||
+ c1.getId()
|
||||
+ ":"
|
||||
@ -808,9 +808,9 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
new ChangeBundle(
|
||||
c, messages(cm1), latest(c), approvals(), comments(), reviewers(), NOTE_DB);
|
||||
assertDiffs(
|
||||
b1, b2, "ChangeMessages differ for Change.Id " + id + "\n" + "Only 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 + "\n" + "Only in B:\n " + cm2);
|
||||
b2, b1, "ChangeMessages differ for Change.Id " + id + "\nOnly in B:\n " + cm2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -1029,7 +1029,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
c, messages(), patchSets(ps1, ps2), approvals(), comments(), reviewers(), REVIEW_DB);
|
||||
|
||||
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
|
||||
@ -1200,8 +1200,8 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
b1,
|
||||
b2,
|
||||
"ChangeMessage.Key sets differ: [] only in A; [" + cm2.getKey() + "] only in B",
|
||||
"PatchSet.Id sets differ:" + " [] only in A; [" + ps2.getId() + "] only in B",
|
||||
"PatchSetApproval.Key sets differ:" + " [] only in A; [" + a2.getKey() + "] only in B");
|
||||
"PatchSet.Id sets differ: [] only in A; [" + ps2.getId() + "] only in B",
|
||||
"PatchSetApproval.Key sets differ: [] only in A; [" + a2.getKey() + "] only in B");
|
||||
|
||||
// One NoteDb.
|
||||
b1 =
|
||||
@ -1219,9 +1219,9 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
assertDiffs(
|
||||
b1,
|
||||
b2,
|
||||
"ChangeMessages differ for Change.Id " + c.getId() + "\n" + "Only in B:\n " + cm2,
|
||||
"PatchSet.Id sets differ:" + " [] only in A; [" + ps2.getId() + "] only in B",
|
||||
"PatchSetApproval.Key sets differ:" + " [] only in A; [" + a2.getKey() + "] only in B");
|
||||
"ChangeMessages differ for Change.Id " + c.getId() + "\nOnly in B:\n " + cm2,
|
||||
"PatchSet.Id sets differ: [] only in A; [" + ps2.getId() + "] only in B",
|
||||
"PatchSetApproval.Key sets differ: [] only in A; [" + a2.getKey() + "] only in B");
|
||||
|
||||
// Both NoteDb.
|
||||
b1 =
|
||||
@ -1239,9 +1239,9 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
assertDiffs(
|
||||
b1,
|
||||
b2,
|
||||
"ChangeMessages differ for Change.Id " + c.getId() + "\n" + "Only in B:\n " + cm2,
|
||||
"PatchSet.Id sets differ:" + " [] only in A; [" + ps2.getId() + "] only in B",
|
||||
"PatchSetApproval.Key sets differ:" + " [] only in A; [" + a2.getKey() + "] only in B");
|
||||
"ChangeMessages differ for Change.Id " + c.getId() + "\nOnly in B:\n " + cm2,
|
||||
"PatchSet.Id sets differ: [] only in A; [" + ps2.getId() + "] only in B",
|
||||
"PatchSetApproval.Key sets differ: [] only in A; [" + a2.getKey() + "] only in B");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -1265,7 +1265,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
new ChangeBundle(
|
||||
c, messages(), patchSets(ps2), approvals(), comments(), reviewers(), REVIEW_DB);
|
||||
assertDiffs(
|
||||
b1, b2, "description differs for PatchSet.Id " + ps1.getId() + ":" + " { abc } != {abc}");
|
||||
b1, b2, "description differs for PatchSet.Id " + ps1.getId() + ": { abc } != {abc}");
|
||||
|
||||
// Whitespace in ReviewDb description is ignored.
|
||||
b1 =
|
||||
@ -1287,7 +1287,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
new ChangeBundle(
|
||||
c, messages(), patchSets(ps3), approvals(), comments(), reviewers(), NOTE_DB);
|
||||
assertDiffs(
|
||||
b1, b2, "description differs for PatchSet.Id " + ps1.getId() + ":" + " { abc } != {cba}");
|
||||
b1, b2, "description differs for PatchSet.Id " + ps1.getId() + ": { abc } != {cba}");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -1617,7 +1617,7 @@ public class ChangeBundleTest extends GerritBaseTests {
|
||||
new ChangeBundle(c, messages(), latest(c), approvals(), comments(), r2, REVIEW_DB);
|
||||
assertNoDiffs(b1, b1);
|
||||
assertNoDiffs(b2, b2);
|
||||
assertDiffs(b1, b2, "reviewer sets differ:" + " [1] only in A;" + " [2] only in B");
|
||||
assertDiffs(b1, b2, "reviewer sets differ: [1] only in A; [2] only in B");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -57,7 +57,7 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
||||
+ "Subject: This is a test change\n");
|
||||
assertParseFails(
|
||||
writeCommit(
|
||||
"Update change\n" + "\n" + "Patch-set: 1\n",
|
||||
"Update change\n\nPatch-set: 1\n",
|
||||
new PersonIdent(
|
||||
"Change Owner",
|
||||
"owner@example.com",
|
||||
@ -65,12 +65,12 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
||||
serverIdent.getTimeZone())));
|
||||
assertParseFails(
|
||||
writeCommit(
|
||||
"Update change\n" + "\n" + "Patch-set: 1\n",
|
||||
"Update change\n\nPatch-set: 1\n",
|
||||
new PersonIdent(
|
||||
"Change Owner", "x@gerrit", serverIdent.getWhen(), serverIdent.getTimeZone())));
|
||||
assertParseFails(
|
||||
writeCommit(
|
||||
"Update change\n" + "\n" + "Patch-set: 1\n",
|
||||
"Update change\n\nPatch-set: 1\n",
|
||||
new PersonIdent(
|
||||
"Change\n\u1234<Owner>",
|
||||
"\n\nx<@>\u0002gerrit",
|
||||
@ -96,9 +96,9 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
||||
+ "Patch-set: 1\n"
|
||||
+ "Status: new\n"
|
||||
+ "Subject: This is a test change\n");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Status: OOPS\n");
|
||||
assertParseFails("Update change\n\nPatch-set: 1\nStatus: OOPS\n");
|
||||
assertParseFails(
|
||||
"Update change\n" + "\n" + "Patch-set: 1\n" + "Status: NEW\n" + "Status: NEW\n");
|
||||
"Update change\n\nPatch-set: 1\nStatus: NEW\nStatus: NEW\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -110,8 +110,8 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
||||
+ "Change-id: I577fb248e474018276351785930358ec0450e9f7\n"
|
||||
+ "Patch-set: 1\n"
|
||||
+ "Subject: This is a test change\n");
|
||||
assertParseFails("Update change\n" + "\n");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Patch-set: 1\n");
|
||||
assertParseFails("Update change\n\n");
|
||||
assertParseFails("Update change\n\nPatch-set: 1\nPatch-set: 1\n");
|
||||
assertParseSucceeds(
|
||||
"Update change\n"
|
||||
+ "\n"
|
||||
@ -119,7 +119,7 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
||||
+ "Change-id: I577fb248e474018276351785930358ec0450e9f7\n"
|
||||
+ "Patch-set: 1\n"
|
||||
+ "Subject: This is a test change\n");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: x\n");
|
||||
assertParseFails("Update change\n\nPatch-set: x\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -144,14 +144,14 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
||||
+ "Label: -Label1\n"
|
||||
+ "Label: -Label1 Other Account <2@gerrit>\n"
|
||||
+ "Subject: This is a test change\n");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Label: Label1=X\n");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Label: Label1 = 1\n");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Label: X+Y\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: X+Y\n");
|
||||
assertParseFails(
|
||||
"Update change\n" + "\n" + "Patch-set: 1\n" + "Label: Label1 Other Account <2@gerrit>\n");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Label: -Label!1\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" + "\n" + "Patch-set: 1\n" + "Label: -Label!1 Other Account <2@gerrit>\n");
|
||||
"Update change\n\nPatch-set: 1\nLabel: -Label!1 Other Account <2@gerrit>\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -169,8 +169,8 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
||||
+ "Submitted-with: NOT_READY\n"
|
||||
+ "Submitted-with: OK: Verified: Change Owner <1@gerrit>\n"
|
||||
+ "Submitted-with: NEED: Alternative-Code-Review\n");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Submitted-with: OOPS\n");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Submitted-with: NEED: X+Y\n");
|
||||
assertParseFails("Update change\n\nPatch-set: 1\nSubmitted-with: OOPS\n");
|
||||
assertParseFails("Update change\n\nPatch-set: 1\nSubmitted-with: NEED: X+Y\n");
|
||||
assertParseFails(
|
||||
"Update change\n"
|
||||
+ "\n"
|
||||
@ -212,7 +212,7 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
||||
+ "Reviewer: Change Owner <1@gerrit>\n"
|
||||
+ "CC: Other Account <2@gerrit>\n"
|
||||
+ "Subject: This is a test change\n");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Reviewer: 1@gerrit\n");
|
||||
assertParseFails("Update change\n\nPatch-set: 1\nReviewer: 1@gerrit\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -234,7 +234,7 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
||||
+ "Topic:\n"
|
||||
+ "Subject: This is a test change\n");
|
||||
assertParseFails(
|
||||
"Update change\n" + "\n" + "Patch-set: 1\n" + "Topic: Some Topic\n" + "Topic: Other Topic");
|
||||
"Update change\n\nPatch-set: 1\nTopic: Some Topic\nTopic: Other Topic");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -453,10 +453,10 @@ public class ChangeNotesParserTest extends AbstractChangeNotesTest {
|
||||
|
||||
@Test
|
||||
public void currentPatchSet() throws Exception {
|
||||
assertParseSucceeds("Update change\n" + "\n" + "Patch-set: 1\n" + "Current: true");
|
||||
assertParseSucceeds("Update change\n" + "\n" + "Patch-set: 1\n" + "Current: tRUe");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Current: false");
|
||||
assertParseFails("Update change\n" + "\n" + "Patch-set: 1\n" + "Current: blah");
|
||||
assertParseSucceeds("Update change\n\nPatch-set: 1\nCurrent: true");
|
||||
assertParseSucceeds("Update change\n\nPatch-set: 1\nCurrent: tRUe");
|
||||
assertParseFails("Update change\n\nPatch-set: 1\nCurrent: false");
|
||||
assertParseFails("Update change\n\nPatch-set: 1\nCurrent: blah");
|
||||
}
|
||||
|
||||
private RevCommit writeCommit(String body) throws Exception {
|
||||
|
@ -1376,7 +1376,7 @@ public class ChangeNotesTest extends AbstractChangeNotesTest {
|
||||
public void changeMessageWithTrailingDoubleNewline() throws Exception {
|
||||
Change c = newChange();
|
||||
ChangeUpdate update = newUpdate(c, changeOwner);
|
||||
update.setChangeMessage("Testing trailing double newline\n" + "\n");
|
||||
update.setChangeMessage("Testing trailing double newline\n\n");
|
||||
update.commit();
|
||||
PatchSet.Id ps1 = c.currentPatchSetId();
|
||||
|
||||
@ -1385,7 +1385,7 @@ public class ChangeNotesTest extends AbstractChangeNotesTest {
|
||||
assertThat(changeMessages).hasSize(1);
|
||||
|
||||
ChangeMessage cm1 = Iterables.getOnlyElement(changeMessages.get(ps1));
|
||||
assertThat(cm1.getMessage()).isEqualTo("Testing trailing double newline\n" + "\n");
|
||||
assertThat(cm1.getMessage()).isEqualTo("Testing trailing double newline\n\n");
|
||||
assertThat(cm1.getAuthor()).isEqualTo(changeOwner.getAccount().getId());
|
||||
}
|
||||
|
||||
@ -1394,7 +1394,7 @@ public class ChangeNotesTest extends AbstractChangeNotesTest {
|
||||
Change c = newChange();
|
||||
ChangeUpdate update = newUpdate(c, changeOwner);
|
||||
update.setChangeMessage(
|
||||
"Testing paragraph 1\n" + "\n" + "Testing paragraph 2\n" + "\n" + "Testing paragraph 3");
|
||||
"Testing paragraph 1\n\nTesting paragraph 2\n\nTesting paragraph 3");
|
||||
update.commit();
|
||||
PatchSet.Id ps1 = c.currentPatchSetId();
|
||||
|
||||
|
@ -84,7 +84,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
||||
public void changeMessageCommitFormatSimple() throws Exception {
|
||||
Change c = TestChanges.newChange(project, changeOwner.getAccountId(), 1);
|
||||
ChangeUpdate update = newUpdate(c, changeOwner);
|
||||
update.setChangeMessage("Just a little code change.\n" + "How about a new line");
|
||||
update.setChangeMessage("Just a little code change.\nHow about a new line");
|
||||
update.commit();
|
||||
assertThat(update.getRefName()).isEqualTo("refs/changes/01/1/meta");
|
||||
|
||||
@ -141,7 +141,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
||||
update.commit();
|
||||
|
||||
assertBodyEquals(
|
||||
"Update patch set 1\n" + "\n" + "Patch-set: 1\n" + "Label: -Code-Review\n",
|
||||
"Update patch set 1\n\nPatch-set: 1\nLabel: -Code-Review\n",
|
||||
update.getResult());
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
||||
|
||||
RevCommit commit = parseCommit(update.getResult());
|
||||
assertBodyEquals(
|
||||
"Update patch set 1\n" + "\n" + "Comment on the change.\n" + "\n" + "Patch-set: 1\n",
|
||||
"Update patch set 1\n\nComment on the change.\n\nPatch-set: 1\n",
|
||||
commit);
|
||||
|
||||
PersonIdent author = commit.getAuthorIdent();
|
||||
@ -247,7 +247,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
||||
update.commit();
|
||||
|
||||
assertBodyEquals(
|
||||
"Update patch set 1\n" + "\n" + "Patch-set: 1\n" + "Reviewer: Change Owner <1@gerrit>\n",
|
||||
"Update patch set 1\n\nPatch-set: 1\nReviewer: Change Owner <1@gerrit>\n",
|
||||
update.getResult());
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
||||
public void changeMessageWithTrailingDoubleNewline() throws Exception {
|
||||
Change c = newChange();
|
||||
ChangeUpdate update = newUpdate(c, changeOwner);
|
||||
update.setChangeMessage("Testing trailing double newline\n" + "\n");
|
||||
update.setChangeMessage("Testing trailing double newline\n\n");
|
||||
update.commit();
|
||||
|
||||
assertBodyEquals(
|
||||
@ -274,7 +274,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
||||
Change c = newChange();
|
||||
ChangeUpdate update = newUpdate(c, changeOwner);
|
||||
update.setChangeMessage(
|
||||
"Testing paragraph 1\n" + "\n" + "Testing paragraph 2\n" + "\n" + "Testing paragraph 3");
|
||||
"Testing paragraph 1\n\nTesting paragraph 2\n\nTesting paragraph 3");
|
||||
update.commit();
|
||||
|
||||
assertBodyEquals(
|
||||
@ -384,7 +384,7 @@ public class CommitMessageOutputTest extends AbstractChangeNotesTest {
|
||||
update.commit();
|
||||
|
||||
assertBodyEquals(
|
||||
"Update patch set 1\n" + "\n" + "Patch-set: 1\n" + "Current: true\n", update.getResult());
|
||||
"Update patch set 1\n\nPatch-set: 1\nCurrent: true\n", update.getResult());
|
||||
}
|
||||
|
||||
private RevCommit parseCommit(ObjectId id) throws Exception {
|
||||
|
@ -245,7 +245,7 @@ public class CommitMsgHookTest extends HookTestCase {
|
||||
"\n"
|
||||
+ //
|
||||
"Change-Id: Id0b4f42d3d6fc1569595c9b97cb665e738486f5d\n", //
|
||||
call("a\n" + "\n" + "b\n"));
|
||||
call("a\n\nb\n"));
|
||||
|
||||
assertEquals(
|
||||
"a\n"
|
||||
@ -257,7 +257,7 @@ public class CommitMsgHookTest extends HookTestCase {
|
||||
"\n"
|
||||
+ //
|
||||
"Change-Id: I7d237b20058a0f46cc3f5fabc4a0476877289d75\n", //
|
||||
call("a\n" + "\n" + "b\nc\nd\ne\n"));
|
||||
call("a\n\nb\nc\nd\ne\n"));
|
||||
|
||||
assertEquals(
|
||||
"a\n"
|
||||
@ -273,7 +273,7 @@ public class CommitMsgHookTest extends HookTestCase {
|
||||
"\n"
|
||||
+ //
|
||||
"Change-Id: I382e662f47bf164d6878b7fe61637873ab7fa4e8\n", //
|
||||
call("a\n" + "\n" + "b\nc\nd\ne\n" + "\n" + "f\ng\nh\n"));
|
||||
call("a\n\nb\nc\nd\ne\n\nf\ng\nh\n"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -286,7 +286,7 @@ public class CommitMsgHookTest extends HookTestCase {
|
||||
"Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n"
|
||||
+ //
|
||||
SOB1, //
|
||||
call("a\n" + "\n" + SOB1));
|
||||
call("a\n\n" + SOB1));
|
||||
|
||||
assertEquals(
|
||||
"a\n"
|
||||
@ -298,7 +298,7 @@ public class CommitMsgHookTest extends HookTestCase {
|
||||
SOB1
|
||||
+ //
|
||||
SOB2, //
|
||||
call("a\n" + "\n" + SOB1 + SOB2));
|
||||
call("a\n\n" + SOB1 + SOB2));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -319,7 +319,7 @@ public class CommitMsgHookTest extends HookTestCase {
|
||||
"Change-Id: I382e662f47bf164d6878b7fe61637873ab7fa4e8\n"
|
||||
+ //
|
||||
SOB1, //
|
||||
call("a\n" + "\n" + "b\nc\nd\ne\n" + "\n" + "f\ng\nh\n" + "\n" + SOB1));
|
||||
call("a\n\nb\nc\nd\ne\n\nf\ng\nh\n\n" + SOB1));
|
||||
|
||||
assertEquals(
|
||||
"a\n"
|
||||
|
@ -61,7 +61,7 @@ public class InMemoryDatabase implements SchemaFactory<ReviewDb> {
|
||||
private static synchronized DataSource newDataSource() throws SQLException {
|
||||
final Properties p = new Properties();
|
||||
p.setProperty("driver", org.h2.Driver.class.getName());
|
||||
p.setProperty("url", "jdbc:h2:mem:" + "Test_" + (++dbCnt));
|
||||
p.setProperty("url", "jdbc:h2:mem:Test_" + (++dbCnt));
|
||||
return new SimpleDataSource(p);
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ final class CreateProjectCommand extends SshCommand {
|
||||
name = "--branch",
|
||||
aliases = {"-b"},
|
||||
metaVar = "BRANCH",
|
||||
usage = "initial branch name\n" + "(default: master)"
|
||||
usage = "initial branch name\n(default: master)"
|
||||
)
|
||||
private List<String> branch;
|
||||
|
||||
|
@ -141,7 +141,7 @@ public class ReviewCommand extends SshCommand {
|
||||
|
||||
@Option(
|
||||
name = "--strict-labels",
|
||||
usage = "Strictly check if the labels " + "specified can be applied to the given patch set(s)"
|
||||
usage = "Strictly check if the labels specified can be applied to the given patch set(s)"
|
||||
)
|
||||
private boolean strictLabels;
|
||||
|
||||
|
@ -155,7 +155,7 @@ final class SetAccountCommand extends SshCommand {
|
||||
throw die("--active and --inactive options are mutually exclusive.");
|
||||
}
|
||||
if (clearHttpPassword && !Strings.isNullOrEmpty(httpPassword)) {
|
||||
throw die("--http-password and --clear-http-password options are " + "mutually exclusive.");
|
||||
throw die("--http-password and --clear-http-password options are mutually exclusive.");
|
||||
}
|
||||
if (addSshKeys.contains("-") && deleteSshKeys.contains("-")) {
|
||||
throw die("Only one option may use the stdin");
|
||||
|
@ -54,7 +54,7 @@ final class SetProjectCommand extends SshCommand {
|
||||
@Option(
|
||||
name = "--submit-type",
|
||||
aliases = {"-t"},
|
||||
usage = "project submit type\n" + "(default: MERGE_IF_NECESSARY)"
|
||||
usage = "project submit type\n(default: MERGE_IF_NECESSARY)"
|
||||
)
|
||||
private SubmitType submitType;
|
||||
|
||||
|
@ -90,7 +90,7 @@ final class ShowQueue extends SshCommand {
|
||||
"%-8s %-12s %-12s %-4s %s\n", //
|
||||
"Task", "State", "StartTime", "", "Command"));
|
||||
stdout.print(
|
||||
"----------------------------------------------" + "--------------------------------\n");
|
||||
"------------------------------------------------------------------------------\n");
|
||||
|
||||
List<TaskInfo> tasks;
|
||||
try {
|
||||
@ -163,7 +163,7 @@ final class ShowQueue extends SshCommand {
|
||||
}
|
||||
}
|
||||
stdout.print(
|
||||
"----------------------------------------------" + "--------------------------------\n");
|
||||
"------------------------------------------------------------------------------\n");
|
||||
stdout.print(" " + tasks.size() + " tasks");
|
||||
if (threadPoolSize > 0) {
|
||||
stdout.print(", " + threadPoolSize + " worker threads");
|
||||
|
@ -104,7 +104,7 @@ public class UploadArchive extends AbstractGitCommand {
|
||||
@Argument(
|
||||
index = 0,
|
||||
required = true,
|
||||
usage = "The tree or commit to " + "produce an archive for."
|
||||
usage = "The tree or commit to produce an archive for."
|
||||
)
|
||||
private String treeIsh = "master";
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class LfsPluginAuthCommand extends SshCommand {
|
||||
LfsSshPluginAuth pluginAuth = auth.get();
|
||||
if (pluginAuth == null) {
|
||||
throw new Failure(
|
||||
1, "Server configuration error:" + " LFS auth over SSH is not properly configured.");
|
||||
1, "Server configuration error: LFS auth over SSH is not properly configured.");
|
||||
}
|
||||
|
||||
stdout.print(pluginAuth.authenticate(user.get(), args));
|
||||
|
@ -49,7 +49,7 @@ class SitePathFromSystemConfigProvider implements Provider<Path> {
|
||||
throw new OrmException("system_config table is empty");
|
||||
default:
|
||||
throw new OrmException(
|
||||
"system_config must have exactly 1 row;" + " found " + all.size() + " rows instead");
|
||||
"system_config must have exactly 1 row; found " + all.size() + " rows instead");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user