File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsSelectorTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/DepthSelectorTest.java | |||
Method name: void testValidate()
|
Method name: void testValidate()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | try {↵ | 1 | try {↵ | |
2 | s.isSelected(basedir,filenames[0],files[0]);↵ | 2 | s.isSelected(basedir,filenames[0],files[0]);↵ | |
3 | fail("ContainsSelector did not check for required field 'text'↵ | 3 | fail("DepthSelector did not check for maximum being higher "↵ | |
4 | ");↵ | 4 | + "than minimum");↵ | |
5 | } catch (BuildException be1) {↵ | 5 | } catch (BuildException be2) {↵ | |
6 | assertEquals("The text attribute is required",↵ | 6 | assertEquals("The maximum depth is lower than the minimum.",↵ | |
7 | be1.getMessage());↵ | 7 | be2.getMessage());↵ | |
8 | }↵ | 8 | }↵ | |
9 | s = (ContainsSelector)getInstance(); | 9 | s = (DepthSelector)getInstance(); | |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
Number of mapped statements | 4 |
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) | 11.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | try |
| 8 | try | ||||||||||||||||
3 | s.isSelected(basedir, filenames[0], files[0]); |
| 9 | s.isSelected(basedir, filenames[0], files[0]); | ||||||||||||||||
4 | fail("ContainsSelector did not check for required field 'text'"); |
| 10 | fail("DepthSelector did not check for maximum being higher " + "than minimum"); | ||||||||||||||||
5 | s = (ContainsSelector)getInstance(); |
| 11 | s = (DepthSelector)getInstance(); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variable s with type org.apache.tools.ant.types.selectors.ContainsSelector , while Clone fragment #2 returns variable s with type org.apache.tools.ant.types.selectors.DepthSelector |