for (int i = 0; i < params.length; i++) {
if (PREFIX_KEY.equals(params[i].getName())) {
prefix = params[i].getValue();
break;
}
}
if (params[i] != null) {
if (TAB_LENGTH_KEY.equals(params[i].getName())) {
tabLength =
new Integer(params[i].getValue()).intValue();
break;
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/PrefixLines.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/TabsToSpaces.java
|
Method name: void initialize()
|
|
Method name: void initialize()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for (int i = 0; i < params.length; i++) {↵ | | |
|
| | | 1 | if (params[i] != null) {↵
|
2 | if (PREFIX_KEY.equals(params[i].getName())) {↵ | | 2 | if (TAB_LENGTH_KEY.equals(params[i].getName())) {↵
|
3 | prefix = ↵ | | 3 | tabLength =↵
|
4 | params[i].getValue();↵ | | 4 | new Integer(params[i].getValue()↵
|
| | | 5 | ).intValue();↵
|
5 | break;↵ | | 6 | break;↵
|
6 | }↵ | | 7 | ↵
|
| | | 8 | }↵
|
7 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
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) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | if (PREFIX_KEY.equals(params[i].getName())) | | 5 | if (TAB_LENGTH_KEY.equals(params[i].getName())) |
5 | prefix = params[i].getValue(); | | | |
| | | 6 | tabLength = new Integer(params[i].getValue()).intValue(); |
6 | | | 7 | |
Precondition Violations (2)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |