Iteration by entrySet() instead of keySet()

Change-Id: I7d4cbe10e42f6200a119c74982b8d000b3948e4f
This commit is contained in:
alex.ryazantsev
2013-11-05 06:01:29 +04:00
parent de1e455385
commit 9e5f632d0a
5 changed files with 15 additions and 13 deletions

View File

@@ -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++) {

View File

@@ -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());