Iteration by entrySet() instead of keySet()
Change-Id: I7d4cbe10e42f6200a119c74982b8d000b3948e4f
This commit is contained in:
@@ -551,10 +551,10 @@ public class ChangeJson {
|
||||
Maps.newHashMapWithExpectedSize(labels.size());
|
||||
|
||||
if (detailed) {
|
||||
for (String name : labels.keySet()) {
|
||||
for (Map.Entry<String, LabelInfo> entry : labels.entrySet()) {
|
||||
ApprovalInfo ai = approvalInfo(accountId, 0, null);
|
||||
byLabel.put(name, ai);
|
||||
labels.get(name).addApproval(ai);
|
||||
byLabel.put(entry.getKey(), ai);
|
||||
entry.getValue().addApproval(ai);
|
||||
}
|
||||
}
|
||||
for (PatchSetApproval psa : current.get(accountId)) {
|
||||
|
@@ -311,8 +311,8 @@ public class PatchListLoader extends CacheLoader<PatchListKey, PatchList> {
|
||||
MergeFormatter fmt = new MergeFormatter();
|
||||
Map<String, MergeResult<? extends Sequence>> r = m.getMergeResults();
|
||||
Map<String, ObjectId> resolved = new HashMap<String, ObjectId>();
|
||||
for (String path : r.keySet()) {
|
||||
MergeResult<? extends Sequence> p = r.get(path);
|
||||
for (Map.Entry<String, MergeResult<? extends Sequence>> entry : r.entrySet()) {
|
||||
MergeResult<? extends Sequence> p = entry.getValue();
|
||||
TemporaryBuffer buf = new TemporaryBuffer.LocalFile(10 * 1024 * 1024);
|
||||
try {
|
||||
fmt.formatMerge(buf, p, "BASE", oursName, theirsName, "UTF-8");
|
||||
@@ -320,7 +320,7 @@ public class PatchListLoader extends CacheLoader<PatchListKey, PatchList> {
|
||||
|
||||
InputStream in = buf.openInputStream();
|
||||
try {
|
||||
resolved.put(path, ins.insert(Constants.OBJ_BLOB, buf.length(), in));
|
||||
resolved.put(entry.getKey(), ins.insert(Constants.OBJ_BLOB, buf.length(), in));
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
|
@@ -349,8 +349,9 @@ public class PluginLoader implements LifecycleListener {
|
||||
syncDisabledPlugins(jars);
|
||||
|
||||
Map<String, File> activePlugins = filterDisabled(jars);
|
||||
for (String name : activePlugins.keySet()) {
|
||||
File jar = activePlugins.get(name);
|
||||
for (Map.Entry<String, File> entry : activePlugins.entrySet()) {
|
||||
String name = entry.getKey();
|
||||
File jar = entry.getValue();
|
||||
FileSnapshot brokenTime = broken.get(name);
|
||||
if (brokenTime != null && !brokenTime.isModified(jar)) {
|
||||
continue;
|
||||
|
@@ -186,9 +186,9 @@ public class CommentsTest extends TestCase {
|
||||
assertNotNull(actual);
|
||||
assertEquals(expected.size(), actual.size());
|
||||
assertEquals(expected.keySet(), actual.keySet());
|
||||
for (String filename : expected.keySet()) {
|
||||
List<PatchLineComment> expectedComments = expected.get(filename);
|
||||
List<CommentInfo> actualComments = actual.get(filename);
|
||||
for (Map.Entry<String, ArrayList<PatchLineComment>> entry : expected.entrySet()) {
|
||||
List<PatchLineComment> expectedComments = entry.getValue();
|
||||
List<CommentInfo> actualComments = actual.get(entry.getKey());
|
||||
assertNotNull(actualComments);
|
||||
assertEquals(expectedComments.size(), actualComments.size());
|
||||
for (int i = 0; i < expectedComments.size(); i++) {
|
||||
|
@@ -200,8 +200,9 @@ public class SubmoduleSectionParserTest extends LocalDiskRepositoryTestCase {
|
||||
expect(bbc.getSubsections("submodule"))
|
||||
.andReturn(sectionsToReturn.keySet());
|
||||
|
||||
for (final String id : sectionsToReturn.keySet()) {
|
||||
final SubmoduleSection section = sectionsToReturn.get(id);
|
||||
for (Map.Entry<String, SubmoduleSection> entry : sectionsToReturn.entrySet()) {
|
||||
String id = entry.getKey();
|
||||
final SubmoduleSection section = entry.getValue();
|
||||
expect(bbc.getString("submodule", id, "url")).andReturn(section.getUrl());
|
||||
expect(bbc.getString("submodule", id, "path")).andReturn(
|
||||
section.getPath());
|
||||
|
Reference in New Issue
Block a user