for (int i=0;i<strings.length;i++){
if (i>0) {
sb.append(" ");
}
sb.append(strings[i]);
}
for (int i=0; i< size; i++){
if (i>0) {
sb.append(" ");
}
sb.append(((CLOption)clOptions.get(i)).toShortString());
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/HttpSSLProtocolSocketFactory.java
|
|
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/commons/cli/avalon/ClutilTestCase.java
|
Method name: String join(String[])
|
|
Method name: void check(String[], String)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for (int i=0;i<strings.length;i++){↵ | | 1 | for (int i=0; i< size; i++){↵
|
2 | if (i>0) {↵ | | 2 | if (i>0) {↵
|
3 | sb.append(" ");↵ | | 3 | sb.append(" ");↵
|
4 | }↵ | | 4 | }↵
|
5 | sb.append(strings[i]);↵ | | 5 | sb.append(((CLOption)clOptions.get(i)).toShortString()); ↵
|
6 | } | | 6 | }
|
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 |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 1.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | for (int i = 0; i < strings.length; i++) | | 6 | for (int i = 0; i < size; i++) |
3 | | | 7 | |
4 | | | 8 | |
5 | | | 9 | sb.append(((CLOption)clOptions.get(i)).toShortString()); |
Precondition Violations (2)
Row |
Violation |
1 | Expression strings[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression ((CLOption)clOptions.get(i)).toShortString() cannot be parameterized, because it has dependencies to/from statements that will be extracted |