if (null != longOption) {
if (hasCharOption) {
sb.append('/');
}
sb.append("--");
sb.append(longOption);
}
if (null != name) {
if (needComma) {
sb.append(", ");
}
sb.append("--");
sb.append(name);
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/commons/cli/avalon/CLArgsParser.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/commons/cli/avalon/CLUtil.java
|
Method name: String describeDualOption(int)
|
|
Method name: StringBuffer describeOptions(CLOptionDescriptor[])
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (null != longOption) {↵ | | 1 | if (null != name) {↵
|
2 | if (hasCharOption) {↵ | | 2 | if (needComma) {↵
|
3 | sb.append('/');↵ | | 3 | sb.append(", ");↵
|
4 | }↵ | | 4 | }↵
|
|
5 | sb.append("--");↵ | | 5 | sb.append("--");↵
|
6 | sb.append(longOption);↵ | | 6 | sb.append(name);↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 2.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
11 | if (null != longOption) | | 19 | if (null != name) |
12 | | | 20 | |
13 | | | | |
| | | 21 | |
14 | | | 22 | |
15 | | | 23 | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement sb.append('/'); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement sb.append(", "); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |