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