Consistently apply camel case naming convention in server code
Change-Id: I213e4a58f58799d095baadd33921755e5b07f8f6
This commit is contained in:
committed by
David Ostrovsky
parent
ca2c7f5325
commit
4030c6f075
@@ -23,7 +23,7 @@ import com.google.gerrit.server.account.AccountInfo;
|
|||||||
public class AccountAssert {
|
public class AccountAssert {
|
||||||
|
|
||||||
public static void assertAccountInfo(TestAccount a, AccountInfo ai) {
|
public static void assertAccountInfo(TestAccount a, AccountInfo ai) {
|
||||||
assertTrue(a.id.get() == ai._account_id);
|
assertTrue(a.id.get() == ai._accountId);
|
||||||
assertEquals(a.fullName, ai.name);
|
assertEquals(a.fullName, ai.name);
|
||||||
assertEquals(a.email, ai.email);
|
assertEquals(a.email, ai.email);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest {
|
|||||||
protected void assertCurrentRevision(String changeId, int expectedNum,
|
protected void assertCurrentRevision(String changeId, int expectedNum,
|
||||||
ObjectId expectedId) throws IOException {
|
ObjectId expectedId) throws IOException {
|
||||||
ChangeInfo c = getChange(changeId, CURRENT_REVISION);
|
ChangeInfo c = getChange(changeId, CURRENT_REVISION);
|
||||||
assertEquals(expectedId.name(), c.current_revision);
|
assertEquals(expectedId.name(), c.currentRevision);
|
||||||
assertEquals(expectedNum, c.revisions.get(expectedId.name())._number);
|
assertEquals(expectedNum, c.revisions.get(expectedId.name())._number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,14 +87,14 @@ public class ListChangesOptionsIT extends AbstractDaemonTest {
|
|||||||
@Test
|
@Test
|
||||||
public void noRevisionOptions() throws Exception {
|
public void noRevisionOptions() throws Exception {
|
||||||
ChangeInfo c = getChange(changeId);
|
ChangeInfo c = getChange(changeId);
|
||||||
assertNull(c.current_revision);
|
assertNull(c.currentRevision);
|
||||||
assertNull(c.revisions);
|
assertNull(c.revisions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void currentRevision() throws Exception {
|
public void currentRevision() throws Exception {
|
||||||
ChangeInfo c = getChange(changeId, CURRENT_REVISION);
|
ChangeInfo c = getChange(changeId, CURRENT_REVISION);
|
||||||
assertEquals(commitId(2), c.current_revision);
|
assertEquals(commitId(2), c.currentRevision);
|
||||||
assertEquals(ImmutableSet.of(commitId(2)), c.revisions.keySet());
|
assertEquals(ImmutableSet.of(commitId(2)), c.revisions.keySet());
|
||||||
assertEquals(3, c.revisions.get(commitId(2))._number);
|
assertEquals(3, c.revisions.get(commitId(2))._number);
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ public class ListChangesOptionsIT extends AbstractDaemonTest {
|
|||||||
@Test
|
@Test
|
||||||
public void allRevisions() throws Exception {
|
public void allRevisions() throws Exception {
|
||||||
ChangeInfo c = getChange(changeId, ALL_REVISIONS);
|
ChangeInfo c = getChange(changeId, ALL_REVISIONS);
|
||||||
assertEquals(commitId(2), c.current_revision);
|
assertEquals(commitId(2), c.currentRevision);
|
||||||
assertEquals(ImmutableSet.of(commitId(0), commitId(1), commitId(2)),
|
assertEquals(ImmutableSet.of(commitId(0), commitId(1), commitId(2)),
|
||||||
c.revisions.keySet());
|
c.revisions.keySet());
|
||||||
assertEquals(1, c.revisions.get(commitId(0))._number);
|
assertEquals(1, c.revisions.get(commitId(0))._number);
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ public class AddRemoveGroupMembersIT extends AbstractDaemonTest {
|
|||||||
private void assertMembers(List<AccountInfo> ai, TestAccount... members) {
|
private void assertMembers(List<AccountInfo> ai, TestAccount... members) {
|
||||||
Map<Integer, AccountInfo> infoById = Maps.newHashMap();
|
Map<Integer, AccountInfo> infoById = Maps.newHashMap();
|
||||||
for (AccountInfo i : ai) {
|
for (AccountInfo i : ai) {
|
||||||
infoById.put(i._account_id, i);
|
infoById.put(i._accountId, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (TestAccount a : members) {
|
for (TestAccount a : members) {
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class AccountInfo {
|
|||||||
if (info == null) {
|
if (info == null) {
|
||||||
info = new AccountInfo(id);
|
info = new AccountInfo(id);
|
||||||
if (detailed) {
|
if (detailed) {
|
||||||
info._account_id = id.get();
|
info._accountId = id.get();
|
||||||
}
|
}
|
||||||
created.put(id, info);
|
created.put(id, info);
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ public class AccountInfo {
|
|||||||
|
|
||||||
public void put(AccountInfo info) {
|
public void put(AccountInfo info) {
|
||||||
if (detailed) {
|
if (detailed) {
|
||||||
info._account_id = info._id.get();
|
info._accountId = info._id.get();
|
||||||
}
|
}
|
||||||
provided.add(info);
|
provided.add(info);
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ public class AccountInfo {
|
|||||||
_id = id;
|
_id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer _account_id;
|
public Integer _accountId;
|
||||||
public String name;
|
public String name;
|
||||||
public String email;
|
public String email;
|
||||||
public String username;
|
public String username;
|
||||||
|
|||||||
@@ -308,11 +308,11 @@ public class ChangeJson {
|
|||||||
// list permitted labels, since users can't vote on those patch sets.
|
// list permitted labels, since users can't vote on those patch sets.
|
||||||
if (!limitToPsId.isPresent()
|
if (!limitToPsId.isPresent()
|
||||||
|| limitToPsId.get().equals(in.currentPatchSetId())) {
|
|| limitToPsId.get().equals(in.currentPatchSetId())) {
|
||||||
out.permitted_labels = permittedLabels(cd);
|
out.permittedLabels = permittedLabels(cd);
|
||||||
}
|
}
|
||||||
out.removable_reviewers = removableReviewers(cd, out.labels.values());
|
out.removableReviewers = removableReviewers(cd, out.labels.values());
|
||||||
}
|
}
|
||||||
if (options.contains(MESSAGES)) {
|
if (has(MESSAGES)) {
|
||||||
out.messages = messages(cd);
|
out.messages = messages(cd);
|
||||||
}
|
}
|
||||||
out.finish();
|
out.finish();
|
||||||
@@ -324,7 +324,7 @@ public class ChangeJson {
|
|||||||
if (out.revisions != null) {
|
if (out.revisions != null) {
|
||||||
for (Map.Entry<String, RevisionInfo> entry : out.revisions.entrySet()) {
|
for (Map.Entry<String, RevisionInfo> entry : out.revisions.entrySet()) {
|
||||||
if (entry.getValue().isCurrent) {
|
if (entry.getValue().isCurrent) {
|
||||||
out.current_revision = entry.getKey();
|
out.currentRevision = entry.getKey();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -959,11 +959,11 @@ public class ChangeJson {
|
|||||||
|
|
||||||
public Map<String, ActionInfo> actions;
|
public Map<String, ActionInfo> actions;
|
||||||
public Map<String, LabelInfo> labels;
|
public Map<String, LabelInfo> labels;
|
||||||
public Map<String, Collection<String>> permitted_labels;
|
public Map<String, Collection<String>> permittedLabels;
|
||||||
public Collection<AccountInfo> removable_reviewers;
|
public Collection<AccountInfo> removableReviewers;
|
||||||
public Collection<ChangeMessageInfo> messages;
|
public Collection<ChangeMessageInfo> messages;
|
||||||
|
|
||||||
public String current_revision;
|
public String currentRevision;
|
||||||
public Map<String, RevisionInfo> revisions;
|
public Map<String, RevisionInfo> revisions;
|
||||||
public Boolean _moreChanges;
|
public Boolean _moreChanges;
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class ListMembers implements RestReadView<GroupResource> {
|
|||||||
return ComparisonChain.start()
|
return ComparisonChain.start()
|
||||||
.compare(a.name, b.name, Ordering.natural().nullsFirst())
|
.compare(a.name, b.name, Ordering.natural().nullsFirst())
|
||||||
.compare(a.email, b.email, Ordering.natural().nullsFirst())
|
.compare(a.email, b.email, Ordering.natural().nullsFirst())
|
||||||
.compare(a._account_id, b._account_id, Ordering.natural().nullsFirst()).result();
|
.compare(a._accountId, b._accountId, Ordering.natural().nullsFirst()).result();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return memberInfos;
|
return memberInfos;
|
||||||
|
|||||||
Reference in New Issue
Block a user