File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/util/GlobPatternMapperTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/util/GlobPatternMapperTest.java | |||
Method name: void testPreAndPostfix()
|
Method name: void testPreAndPostfix()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 8 | |||
1 | result = m.mapFileName("foo.baz.bar");↵ | |||
1 | assertNotNull("Should match foo*bar", result);↵ | 2 | assertNotNull("Should match foo*bar", result);↵ | |
2 | assertEquals("only one result for foo.bar", 1, result.length);↵ | 3 | assertEquals("only one result for foo.baz.bar", 1, result.length);↵ | |
3 | assertEquals("plonk.pling", result[0]);↵ | 4 | assertEquals("plonk.baz.pling", result[0]);↵ | |
4 | // and a little longer↵ | 5 | // and a little shorter↵ | |
5 | result = m.mapFileName("foo.baz.bar");↵ | 6 | result = m.mapFileName("foobar");↵ | |
6 | assertNotNull("Should match foo*bar", result);↵ | 7 | assertNotNull("Should match foo*bar", result);↵ | |
7 | assertEquals("only one result for foo.baz.bar", 1, result.length);↵ | 8 | assertEquals("only one result for foobar", 1, result.length);↵ | |
8 | assertEquals("plonk.baz.pling", result[0]); | 9 | assertEquals("plonkpling", result[0]); | |
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 in the same method |
Number of node comparisons | 39 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 9 | result = m.mapFileName("foo.baz.bar"); | ||||||||||||||||
6 | assertNotNull("Should match foo*bar", result); | 10 | assertNotNull("Should match foo*bar", result); | |||||||||||||||
7 | assertEquals("only one result for foo.bar", 1, result.length); |
| 12 | assertEquals("plonk.baz.pling", result[0]); | ||||||||||||||
8 | assertEquals("plonk.pling", result[0]); |
| 16 | assertEquals("plonkpling", result[0]); | ||||||||||||||
9 | result = m.mapFileName("foo.baz.bar"); |
| 13 | result = m.mapFileName("foobar"); | ||||||||||||||
10 | assertNotNull("Should match foo*bar", result); | 10 | assertNotNull("Should match foo*bar", result); | |||||||||||||||
11 | assertEquals("only one result for foo.baz.bar", 1, result.length); | 11 | assertEquals("only one result for foo.baz.bar", 1, result.length); | |||||||||||||||
| 14 | assertNotNull("Should match foo*bar", result); | ||||||||||||||||
12 | assertEquals("plonk.baz.pling", result[0]); |
| 15 | assertEquals("only one result for foobar", 1, result.length); |
Row | Violation |
---|---|
1 | Expression assertEquals("only one result for foo.bar",1,result.length) is a void method call, and thus it cannot be parameterized |
2 | Expression assertEquals("plonk.baz.pling",result[0]) is a void method call, and thus it cannot be parameterized |
3 | Expression assertEquals("plonk.baz.pling",result[0]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression assertEquals("only one result for foobar",1,result.length) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression assertEquals("plonk.baz.pling",result[0]) is a void method call, and thus it cannot be parameterized |
6 | Expression assertEquals("only one result for foobar",1,result.length) is a void method call, and thus it cannot be parameterized |
7 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables result |