File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/FileListTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java | |||
Method name: void testCircularReferenceCheck()
|
Method name: void testEmptyElementIfIsReference()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | f.setRefid(new Reference("dummy"));↵ | 1 | catalog2.setRefid(new Reference("catalog"));↵ | |
2 | try {↵ | 2 | try {↵ | |
3 | f.getDir(project);↵ | 3 | ↵ | |
4 | fail("Can make FileL↵ | 4 | catalog2.addConfiguredXMLCatalog(catalog);↵ | |
5 | ist a Reference to itself.");↵ | 5 | fail("Can add nested XMLCatalog to XMLCatalog that is a reference");↵ | |
6 | } catch (BuildException be) {↵ | 6 | } catch (BuildException be) {↵ | |
7 | assertEquals("This data type contains a circular reference.",↵ | 7 | assertEquals("You must not specify nested elements when using refid",↵ | |
8 | be.getMessage());↵ | 8 | be.getMessage());↵ | |
9 | } | 9 |
| |
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 | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 13.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | f.setRefid(new Reference("dummy")); |
| 10 | catalog2.setRefid(new Reference("catalog")); | ||||||||||||||||
4 | try |
| 11 | try | ||||||||||||||||
5 | f.getDir(project); |
| | |||||||||||||||||
|
| 12 | catalog2.addConfiguredXMLCatalog(catalog); | |||||||||||||||||
6 | fail("Can make FileList a Reference to itself."); |
| 13 | fail("Can add nested XMLCatalog to XMLCatalog that is a reference"); |
Row | Violation |
---|---|
1 | Unmatched statement f.getDir(project); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
2 | Unmatched statement catalog2.addConfiguredXMLCatalog(catalog); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement catalog2.addConfiguredXMLCatalog(catalog); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | The refactoring of the clones is infeasible, because classes org.apache.tools.ant.types.FileListTest and org.apache.tools.ant.types.XMLCatalogTest do not have a common superclass |