File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java | |||
Method name: void execute()
|
Method name: void testRootFilesInIndex()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if (currentToken.equals("Client:")) {↵ | 1 | if (line.equals("foo")) {↵ | |
2 | client = true;↵ | 2 | foundFoo = true;↵ | |
3 | } else if (currentToken.equals("Server:")) {↵ | 3 | } else if (line.equals("sub")) {↵ | |
4 | server = true;↵ | 4 | foundSub = true;↵ | |
5 | } else if (currentToken.equals("(CVS)")) {↵ | 5 | } else if (line.equals("sub/foo")) {↵ | |
6 | cvs = true;↵ | 6 | foundSubFoo = true;↵ | |
7 | } | 7 | } | |
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.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 28 |
Number of mapped statements | 6 |
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) | 2.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14 | if (currentToken.equals("Client:")) |
| 13 | if (line.equals("foo")) | |||||||||||||
15 | client = true; |
| 14 | foundFoo = true; | |||||||||||||
16 | else if (currentToken.equals("Server:")) |
| 15 | else if (line.equals("sub")) | |||||||||||||
17 | server = true; |
| 16 | foundSub = true; | |||||||||||||
18 | else if (currentToken.equals("(CVS)")) |
| 17 | else if (line.equals("sub/foo")) | |||||||||||||
19 | cvs = true; |
| 18 | foundSubFoo = true; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables client, cvs, server , while Clone fragment #2 returns variables foundSub, foundSubFoo, foundFoo |
2 | The refactoring of the clones is infeasible, because classes org.apache.tools.ant.taskdefs.cvslib.CvsVersion and org.apache.tools.ant.taskdefs.JarTest do not have a common superclass |