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/PatternSetTest.java | |||
Method name: void testCircularReferenceCheck()
|
Method name: void testCircularReferenceCheck()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | try {↵ | 1 | try {↵ | |
2 | f.getDir(project);↵ | 2 | p1.getIncludePatterns(project);↵ | |
3 | fail("Can make FileList a Reference to itself.");↵ | 3 | fail("Can make circular reference.");↵ | |
4 | } catch (BuildException be) {↵ | 4 | } catch (BuildException be) {↵ | |
5 | assertEquals("This data type contains a circular reference.",↵ | 5 | assertEquals("This data type contains a circular reference.",↵ | |
6 | be.getMessage());↵ | 6 | be.getMessage());↵ | |
7 | }↵ | 7 | }↵ | |
8 | try {↵ | 8 | try {↵ | |
9 | f.getFiles(project);↵ | 9 | p1.getExcludePatterns(project);↵ | |
10 | fail("Can make FileList a Reference to itself.");↵ | 10 | fail("Can make circular reference.");↵ | |
11 | } catch (BuildException be) {↵ | 11 | } catch (BuildException be) {↵ | |
12 | assertEquals("This data type contains a circular reference.",↵ | 12 | assertEquals("This data type contains a circular reference.",↵ | |
13 | be.getMessage());↵ | 13 | be.getMessage());↵ | |
14 | } | 14 |
| |
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.6 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 28 |
Number of mapped statements | 5 |
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) | 31.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | try | 19 | try | ||||||||||||||||||||||
5 | f.getDir(project); |
| | ||||||||||||||||||||||
|
| 20 | p1.getIncludePatterns(project); | ||||||||||||||||||||||
6 | fail("Can make FileList a Reference to itself."); |
| 21 | fail("Can make circular reference."); | |||||||||||||||||||||
7 | try | 22 | try | ||||||||||||||||||||||
8 | f.getFiles(project); |
| 23 | p1.getExcludePatterns(project); | |||||||||||||||||||||
9 | fail("Can make FileList a Reference to itself."); |
| 24 | fail("Can make circular 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 p1.getIncludePatterns(project); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement p1.getIncludePatterns(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 |
4 | Expression f.getFiles(project) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
5 | Expression p1.getExcludePatterns(project) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression f.getFiles(project) is a void method call, and thus it cannot be parameterized |
7 | Expression p1.getExcludePatterns(project) is a void method call, and thus it cannot be parameterized |
8 | Expression f cannot be unified with expression p1 , because common superclass org.apache.tools.ant.types.DataType does not declare member(s) public java.lang.String[] getFiles(org.apache.tools.ant.Project) , public java.lang.String[] getExcludePatterns(org.apache.tools.ant.Project) |
9 | The refactoring of the clones is infeasible, because classes org.apache.tools.ant.types.FileListTest and org.apache.tools.ant.types.PatternSetTest do not have a common superclass |