File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/MapperTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/MapperTest.java | |||
Method name: void testNested()
|
Method name: void testChained()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | container.add(mapper3);↵ | 1 | chained.addConfiguredMapper(mapperCX);↵ | |
2 | FileNameMapper fileNameMapper = container.getImplementation();↵ | 2 | FileNameMapper fileNameMapper = chained.getImplementation();↵ | |
3 | String[] targets = fileNameMapper.mapFileName("fromfilename");↵ | 3 | String[] targets = fileNameMapper.mapFileName("a");↵ | |
4 | assertNotNull("no filenames mapped", targets);↵ | 4 | assertNotNull("no filenames mapped", targets);↵ | |
5 | assertEquals("wrong number of filenames mapped", 3, targets.length);↵ | 5 | assertEquals("wrong number of filenames mapped", 2, targets.length);↵ | |
6 | List list = Arrays.asList(targets);↵ | 6 | List list = Arrays.asList(targets);↵ | |
7 | assertTrue("cannot find expected target \"tofilename\"",↵ | 7 | assertTrue("cannot find expected target \"↵ | |
8 | list.contains("tofilename"));↵ | 8 | def\"", list.contains("def"));↵ | |
9 | assertTrue("cannot find expected target \"fromfilename\"",↵ | 9 | assertTrue("cannot find expected target \"↵ | |
10 | list.contains("fromfilename")); | 10 | ghi\"", list.contains("ghi")); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
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 | 40 |
Number of mapped statements | 8 |
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 | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13 | container.add(mapper3); |
| 26 | assertTrue("cannot find expected target \"def\"", list.contains("def")); | ||||||||||||||||||||||
14 | FileNameMapper fileNameMapper = container.getImplementation(); |
| 21 | FileNameMapper fileNameMapper = chained.getImplementation(); | ||||||||||||||||||||||
15 | String[] targets = fileNameMapper.mapFileName("fromfilename"); |
| 22 | String[] targets = fileNameMapper.mapFileName("a"); | ||||||||||||||||||||||
16 | assertNotNull("no filenames mapped", targets); | 23 | assertNotNull("no filenames mapped", targets); | |||||||||||||||||||||||
17 | assertEquals("wrong number of filenames mapped", 3, targets.length); |
| 24 | assertEquals("wrong number of filenames mapped", 2, targets.length); | ||||||||||||||||||||||
18 | List list = Arrays.asList(targets); | 25 | List list = Arrays.asList(targets); | |||||||||||||||||||||||
19 | assertTrue("cannot find expected target \"tofilename\"", list.contains("tofilename")); |
| 20 | chained.addConfiguredMapper(mapperCX); | ||||||||||||||||||||||
20 | assertTrue("cannot find expected target \"fromfilename\"", list.contains("fromfilename")); |
| 27 | assertTrue("cannot find expected target \"ghi\"", list.contains("ghi")); |
Row | Violation |
---|---|
1 | Expression assertTrue("cannot find expected target \"def\"",list.contains("def")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression container.add(mapper3) is a void method call, and thus it cannot be parameterized |
3 | Expression assertTrue("cannot find expected target \"def\"",list.contains("def")) is a void method call, and thus it cannot be parameterized |
4 | Expression assertTrue("cannot find expected target \"def\"",list.contains("def")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression container.add(mapper3) is a void method call, and thus it cannot be parameterized |
6 | Expression assertTrue("cannot find expected target \"def\"",list.contains("def")) is a void method call, and thus it cannot be parameterized |
7 | Expression assertTrue("cannot find expected target \"tofilename\"",list.contains("tofilename")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression assertTrue("cannot find expected target \"tofilename\"",list.contains("tofilename")) is a void method call, and thus it cannot be parameterized |
9 | Expression chained.addConfiguredMapper(mapperCX) is a void method call, and thus it cannot be parameterized |
10 | Expression assertTrue("cannot find expected target \"tofilename\"",list.contains("tofilename")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression assertTrue("cannot find expected target \"tofilename\"",list.contains("tofilename")) is a void method call, and thus it cannot be parameterized |
12 | Expression chained.addConfiguredMapper(mapperCX) is a void method call, and thus it cannot be parameterized |
13 | Clone fragment #1 returns variables list , while Clone fragment #2 returns variables |