Upgrade to google-java-format 1.5

Change-Id: I8e0270efad021e69b1a127cf3175626d26381bdb
This commit is contained in:
David Pursehouse 2018-04-17 15:18:17 +02:00
parent 33ce3bf5be
commit 4ec5ef6bd2
30 changed files with 54 additions and 53 deletions

View File

@ -1025,7 +1025,7 @@ public class ChangeIT extends AbstractDaemonTest {
String oldETag = rsrc.getETag();
Timestamp oldTs = rsrc.getChange().getLastUpdatedOn();
//create a group named "ab" with one user: testUser
// create a group named "ab" with one user: testUser
TestAccount testUser = accounts.create("abcd", "abcd@test.com", "abcd");
String testGroup = createGroupWithRealName("ab");
GroupApi groupApi = gApi.groups().id(testGroup);
@ -1069,7 +1069,7 @@ public class ChangeIT extends AbstractDaemonTest {
String oldETag = rsrc.getETag();
Timestamp oldTs = rsrc.getChange().getLastUpdatedOn();
//create a group named "kobe" with one user: lee
// create a group named "kobe" with one user: lee
TestAccount testUser = accounts.create("kobebryant", "kobebryant@test.com", "kobebryant");
TestAccount myGroupUser = accounts.create("lee", "lee@test.com", "lee");
@ -1078,7 +1078,7 @@ public class ChangeIT extends AbstractDaemonTest {
groupApi.description("test group");
groupApi.addMembers(myGroupUser.fullName);
//ensure that user "user" is not in the group
// ensure that user "user" is not in the group
groupApi.removeMembers(testUser.fullName);
AddReviewerInput in = new AddReviewerInput();

View File

@ -486,19 +486,19 @@ public class ChangeRebuilderIT extends AbstractDaemonTest {
//// BatchUpdate transaction, but it was rebuilt during read for the
//// subsequent reindex. Thus it's impossible to actually observe an
//// out-of-date state in the caller.
//assertChangeUpToDate(true, id);
// assertChangeUpToDate(true, id);
//// Check that the bundles are equal.
//ChangeNotes notes = notesFactory.create(dbProvider.get(), project, id);
//ChangeBundle actual = ChangeBundle.fromNotes(commentsUtil, notes);
//ChangeBundle expected = bundleReader.fromReviewDb(getUnwrappedDb(), id);
//assertThat(actual.differencesFrom(expected)).isEmpty();
//assertThat(
// ChangeNotes notes = notesFactory.create(dbProvider.get(), project, id);
// ChangeBundle actual = ChangeBundle.fromNotes(commentsUtil, notes);
// ChangeBundle expected = bundleReader.fromReviewDb(getUnwrappedDb(), id);
// assertThat(actual.differencesFrom(expected)).isEmpty();
// assertThat(
// Iterables.transform(
// notes.getChangeMessages(),
// ChangeMessage::getMessage))
// .contains(msg);
//assertThat(actual.getChange().getTopic()).isEqualTo(topic);
// assertThat(actual.getChange().getTopic()).isEqualTo(topic);
}
@Test

View File

@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
public class SshCommandsIT extends AbstractDaemonTest {
private static final Logger log = LoggerFactory.getLogger(SshCommandsIT.class);
//TODO: It would be better to dynamically generate this list
// TODO: It would be better to dynamically generate this list
private static final Map<String, List<String>> COMMANDS =
ImmutableMap.of(
Commands.ROOT,

View File

@ -34,7 +34,7 @@ public class DynamicSetTest {
@Test
public void containsWithEmpty() throws Exception {
DynamicSet<Integer> ds = new DynamicSet<>();
assertThat(ds.contains(2)).isFalse(); //See above comment about ds.contains
assertThat(ds.contains(2)).isFalse(); // See above comment about ds.contains
}
@Test
@ -42,7 +42,7 @@ public class DynamicSetTest {
DynamicSet<Integer> ds = new DynamicSet<>();
ds.add(2);
assertThat(ds.contains(2)).isTrue(); //See above comment about ds.contains
assertThat(ds.contains(2)).isTrue(); // See above comment about ds.contains
}
@Test
@ -50,7 +50,7 @@ public class DynamicSetTest {
DynamicSet<Integer> ds = new DynamicSet<>();
ds.add(2);
assertThat(ds.contains(3)).isFalse(); //See above comment about ds.contains
assertThat(ds.contains(3)).isFalse(); // See above comment about ds.contains
}
@Test
@ -59,7 +59,7 @@ public class DynamicSetTest {
ds.add(2);
ds.add(4);
assertThat(ds.contains(4)).isTrue(); //See above comment about ds.contains
assertThat(ds.contains(4)).isTrue(); // See above comment about ds.contains
}
@Test
@ -68,7 +68,7 @@ public class DynamicSetTest {
ds.add(2);
ds.add(4);
assertThat(ds.contains(3)).isFalse(); //See above comment about ds.contains
assertThat(ds.contains(3)).isFalse(); // See above comment about ds.contains
}
@Test
@ -82,12 +82,12 @@ public class DynamicSetTest {
ds.add(6);
// At first, 4 is contained.
assertThat(ds.contains(4)).isTrue(); //See above comment about ds.contains
assertThat(ds.contains(4)).isTrue(); // See above comment about ds.contains
// Then we remove 4.
handle.remove();
// And now 4 should no longer be contained.
assertThat(ds.contains(4)).isFalse(); //See above comment about ds.contains
assertThat(ds.contains(4)).isFalse(); // See above comment about ds.contains
}
}

View File

@ -283,7 +283,7 @@ public class ProjectBranchesScreen extends PaginatedProjectScreen {
new ConfirmationCallback() {
@Override
public void onOk() {
//do nothing
// do nothing
}
});
confirmationDialog.center();

View File

@ -287,7 +287,7 @@ public class ProjectTagsScreen extends PaginatedProjectScreen {
new ConfirmationCallback() {
@Override
public void onOk() {
//do nothing
// do nothing
}
});
confirmationDialog.center();

View File

@ -75,8 +75,8 @@ public class StaticModule extends ServletModule {
ImmutableList.of("/", "/c/*", "/q/*", "/x/*", "/admin/*", "/dashboard/*", "/settings/*");
// TODO(dborowitz): These fragments conflict with the REST API
// namespace, so they will need to use a different path.
//"/groups/*",
//"/projects/*");
// "/groups/*",
// "/projects/*");
//
/**

View File

@ -60,7 +60,7 @@ public class LogFileCompressor implements Runnable {
@Override
public void start() {
//compress log once and then schedule compression every day at 11:00pm
// compress log once and then schedule compression every day at 11:00pm
queue.getDefaultQueue().execute(compressor);
ZoneId zone = ZoneId.systemDefault();
LocalDateTime now = LocalDateTime.now(zone);

View File

@ -183,7 +183,7 @@ public final class PatchSet {
@Column(id = 6, notNull = false, length = Integer.MAX_VALUE)
protected String groups;
//DELETED id = 7 (pushCertficate)
// DELETED id = 7 (pushCertficate)
/** Certificate sent with a push that created this patch set. */
@Column(id = 8, notNull = false, length = Integer.MAX_VALUE)

View File

@ -58,7 +58,7 @@ public class StoredValue<T> {
public T get(Prolog engine) {
T obj = getOrNull(engine);
if (obj == null) {
//unless createValue() is overridden, will return null
// unless createValue() is overridden, will return null
obj = createValue(engine);
if (obj == null) {
throw new SystemException("No " + key + " available");

View File

@ -73,7 +73,7 @@ public class ReviewerRecommender {
new double[] {
BASE_REVIEWER_WEIGHT, BASE_OWNER_WEIGHT, BASE_COMMENT_WEIGHT,
};
private static final long PLUGIN_QUERY_TIMEOUT = 500; //ms
private static final long PLUGIN_QUERY_TIMEOUT = 500; // ms
private final ChangeQueryBuilder changeQueryBuilder;
private final Config config;

View File

@ -112,7 +112,8 @@ public class AccountManager {
ExternalId.Key key = ExternalId.Key.create(SCHEME_USERNAME, who.getUserName());
ExternalId existingId = findExternalId(db, key);
if (existingId != null) {
// An inconsistency is detected in the database, having a record for scheme "username:"
// An inconsistency is detected in the database, having a record for scheme
// "username:"
// but no record for scheme "gerrit:". Try to recover by linking
// "gerrit:" identity to the existing account.
log.warn(

View File

@ -234,7 +234,7 @@ public class Submit
if (msg != null) {
throw new ResourceConflictException(msg.getMessage());
}
//$FALL-THROUGH$
// $FALL-THROUGH$
case ABANDONED:
case DRAFT:
default:

View File

@ -104,7 +104,7 @@ public class ProjectConfigEntry {
this(displayName, defaultValue, null);
}
//For inheritable boolean use 'LIST' type with InheritableBoolean
// For inheritable boolean use 'LIST' type with InheritableBoolean
public ProjectConfigEntry(String displayName, boolean defaultValue, String description) {
this(
displayName,

View File

@ -1367,7 +1367,7 @@ public class ReceiveCommits {
if (!hashtag.isEmpty()) {
hashtags.add(hashtag);
}
//TODO(dpursehouse): validate hashtags
// TODO(dpursehouse): validate hashtags
}
MagicBranchInput(ReceiveCommand cmd, LabelTypes labelTypes, NotesMigration notesMigration) {
@ -2885,7 +2885,7 @@ public class ReceiveCommits {
try {
r.put(cd.change().getKey(), cd.notes());
} catch (NoSuchChangeException e) {
//Ignore deleted change
// Ignore deleted change
}
}
return r;

View File

@ -440,7 +440,7 @@ public class SubmoduleOp {
commit.setTreeId(newTreeId);
commit.setParentIds(currentCommit.getParents());
if (verboseSuperProject != VerboseSuperprojectUpdate.FALSE) {
//TODO:czhen handle cherrypick footer
// TODO:czhen handle cherrypick footer
commit.setMessage(currentCommit.getFullMessage() + "\n\n* submodules:\n" + msgbuf.toString());
} else {
commit.setMessage(currentCommit.getFullMessage());

View File

@ -428,8 +428,8 @@ public class WorkQueue {
@Override
public String toString() {
//This is a workaround to be able to print a proper name when the task
//is wrapped into a TrustedListenableFutureTask.
// This is a workaround to be able to print a proper name when the task
// is wrapped into a TrustedListenableFutureTask.
try {
if (runnable
.getClass()

View File

@ -411,7 +411,7 @@ public abstract class ChangeEmail extends NotificationEmail {
authors.add(patchSetInfo.getCommitter().getAccount());
}
}
//$FALL-THROUGH$
// $FALL-THROUGH$
case OWNER_REVIEWERS:
case OWNER:
authors.add(change.getOwner());

View File

@ -55,7 +55,7 @@ public abstract class NewChangeSender extends ChangeEmail {
case ALL:
default:
add(RecipientType.CC, extraCC);
//$FALL-THROUGH$
// $FALL-THROUGH$
case OWNER_REVIEWERS:
add(RecipientType.TO, reviewers);
break;

View File

@ -396,7 +396,7 @@ public class SmtpEmailSender implements EmailSender {
try {
client.disconnect();
} catch (IOException e2) {
//Ignored
// Ignored
}
}
if (e instanceof EmailException) {

View File

@ -232,7 +232,7 @@ public class ChangeNotesCache {
+ P
+ ident // author
+ P
+ ident //realAuthor
+ ident // realAuthor
+ P
+ T // writtenOn
+ 2 // side

View File

@ -670,9 +670,9 @@ class ChangeNotesParser {
int changeMessageStart;
if (raw[subjectEnd] == '\n') {
changeMessageStart = subjectEnd + 2; //\n\n ends paragraph
changeMessageStart = subjectEnd + 2; // \n\n ends paragraph
} else if (raw[subjectEnd] == '\r') {
changeMessageStart = subjectEnd + 4; //\r\n\r\n ends paragraph
changeMessageStart = subjectEnd + 4; // \r\n\r\n ends paragraph
} else {
return;
}

View File

@ -154,7 +154,7 @@ public class CreateBranch implements RestModifyView<ProjectResource, BranchInput
}
refPrefix = RefUtil.getRefPrefix(refPrefix);
}
//$FALL-THROUGH$
// $FALL-THROUGH$
case FORCED:
case IO_FAILURE:
case NOT_ATTEMPTED:

View File

@ -244,7 +244,7 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
value,
v.getKey()));
}
//$FALL-THROUGH$
// $FALL-THROUGH$
case STRING:
cfg.setString(v.getKey(), value);
break;

View File

@ -66,7 +66,8 @@ public class Schema_105 extends SchemaVersion {
private Set<String> listChangesIndexes(JdbcSchema schema) throws SQLException {
// List of all changes indexes ever created or dropped, found with the
// following command:
// find g* -name \*.sql | xargs git log -i -p -S' index changes_' | grep -io ' index changes_\w*' | cut -d' ' -f3 | tr A-Z a-z | sort -u
// find g* -name \*.sql | xargs git log -i -p -S' index changes_' | grep -io ' index
// changes_\w*' | cut -d' ' -f3 | tr A-Z a-z | sort -u
// Used rather than listIndexes as we're not sure whether it might include
// primary key indexes.
Set<String> allChanges =

View File

@ -34,6 +34,6 @@ public interface RepoOnlyOp {
*
* @param ctx context
*/
//TODO(dborowitz): Support async operations?
// TODO(dborowitz): Support async operations?
default void postUpdate(Context ctx) throws Exception {}
}

View File

@ -75,14 +75,14 @@ public class IntraLineLoaderTest {
String b = "multi\nlinemulti\nline\n";
assertThat(intraline(a, b)).isEqualTo(wordEdit(10, 10, 6, 16));
// better would be:
//assertThat(intraline(a, b)).isEqualTo(wordEdit(6, 6, 6, 16));
// assertThat(intraline(a, b)).isEqualTo(wordEdit(6, 6, 6, 16));
// or the equivalent:
//assertThat(intraline(a, b)).isEqualTo(ref()
// assertThat(intraline(a, b)).isEqualTo(ref()
// .common("multi\n").insert("linemulti\n").common("line\n").edits
//);
// );
}
//TODO: expected failure
// TODO: expected failure
// the current code does not work on the first line
// and the insert marker is in the wrong location
@Test(expected = AssertionError.class)
@ -93,7 +93,7 @@ public class IntraLineLoaderTest {
.isEqualTo(ref().insert(" ").common(" abc\n").insert(" ").common(" def\n").edits);
}
//TODO: expected failure
// TODO: expected failure
// the current code does not work on the first line
@Test(expected = AssertionError.class)
public void preferDeleteAtLineBreak() throws Exception {

View File

@ -186,7 +186,7 @@ public class InMemoryModule extends FactoryModule {
return CanonicalWebUrlProvider.class;
}
});
//Replacement of DiffExecutorModule to not use thread pool in the tests
// Replacement of DiffExecutorModule to not use thread pool in the tests
install(
new AbstractModule() {
@Override

View File

@ -66,8 +66,7 @@ public class SetLoggingLevelCommand extends SshCommand {
reset();
} else {
for (Enumeration<Logger> logger = LogManager.getCurrentLoggers();
logger.hasMoreElements();
) {
logger.hasMoreElements(); ) {
Logger log = logger.nextElement();
if (name == null || log.getName().contains(name)) {
log.setLevel(Level.toLevel(level.name()));

View File

@ -17,7 +17,7 @@
set -eu
# Keep this version in sync with dev-contributing.txt.
VERSION=${1:-1.3}
VERSION=${1:-1.5}
case "$VERSION" in
1.3)