File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java | |||
Method name: void testOrder1()
|
Method name: void testOrder2()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | Enumeration e = manifest.getSectionNames();↵ | 1 | Enumeration e = manifest.getSectionNames();↵ | |
2 | String section1 = (String)e.nextElement();↵ | 2 | String section1 = (String)e.nextElement();↵ | |
3 | String section2 = (String)e.nextElement();↵ | 3 | String section2 = (String)e.nextElement();↵ | |
4 | assertEquals("First section name unexpected", "Test1", section1);↵ | 4 | assertEquals("First section name unexpected", "Test2", section1);↵ | |
5 | assertEquals("Second section name unexpected", "Test2", section2);↵ | 5 | assertEquals("Second section name unexpected", "Test1", section2);↵ | |
6 | Manifest.Section section = manifest.getSection("Test1");↵ | 6 | Manifest.Section section = manifest.getSection("Test1");↵ | |
7 | e = section.getAttributeKeys();↵ | 7 | e = section.getAttributeKeys();↵ | |
8 | String attr1Key = (String)e.nextElement();↵ | 8 | String attr1Key = (String)e.nextElement();↵ | |
9 | String attr2Key = (String)e.nextElement();↵ | 9 | String attr2Key = (String)e.nextElement();↵ | |
10 | String attr1 = section.getAttribute(attr1Key).getName();↵ | 10 | String attr1 = section.getAttribute(attr1Key).getName();↵ | |
11 | String attr2 = section.getAttribute(attr2Key).getName();↵ | 11 | String attr2 = section.getAttribute(attr2Key).getName();↵ | |
12 | assertEquals("First attribute name unexpected", "TestAttr1", attr1); | 12 | assertEquals("First attribute name unexpected", "TestAttr2", attr1); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 74 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | Enumeration e = manifest.getSectionNames(); | 3 | Enumeration e = manifest.getSectionNames(); | |||||||||||
4 | String section1 = (String)e.nextElement(); | 4 | String section1 = (String)e.nextElement(); | |||||||||||
5 | String section2 = (String)e.nextElement(); | 5 | String section2 = (String)e.nextElement(); | |||||||||||
6 | assertEquals("First section name unexpected", "Test1", section1); |
| 6 | assertEquals("First section name unexpected", "Test2", section1); | ||||||||||
7 | assertEquals("Second section name unexpected", "Test2", section2); |
| 7 | assertEquals("Second section name unexpected", "Test1", section2); | ||||||||||
8 | Manifest.Section section = manifest.getSection("Test1"); | 8 | Manifest.Section section = manifest.getSection("Test1"); | |||||||||||
9 | e = section.getAttributeKeys(); | 9 | e = section.getAttributeKeys(); | |||||||||||
10 | String attr1Key = (String)e.nextElement(); | 10 | String attr1Key = (String)e.nextElement(); | |||||||||||
11 | String attr2Key = (String)e.nextElement(); | 11 | String attr2Key = (String)e.nextElement(); | |||||||||||
12 | String attr1 = section.getAttribute(attr1Key).getName(); | 12 | String attr1 = section.getAttribute(attr1Key).getName(); | |||||||||||
13 | String attr2 = section.getAttribute(attr2Key).getName(); | 13 | String attr2 = section.getAttribute(attr2Key).getName(); | |||||||||||
14 | assertEquals("First attribute name unexpected", "TestAttr1", attr1); |
| 14 | assertEquals("First attribute name unexpected", "TestAttr2", attr1); |
Row | Violation |
---|