if ("\'".equals(nextTok)) {
lastTokenHasBeenQuoted = true;
state = normal;
} else {
current.append(nextTok);
}
break;
if ("\"".equals(nextTok)) {
lastTokenHasBeenQuoted = true;
state = normal;
} else {
current.append(nextTok);
}
break;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Commandline.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Commandline.java
|
Method name: String[] translateCommandline(String)
|
|
Method name: String[] translateCommandline(String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if ("\'".equals(nextTok)) {↵ | | 1 | if ("\"".equals(nextTok)) {↵
|
2 | lastTokenHasBeenQuoted = true;↵ | | 2 | lastTokenHasBeenQuoted = true;↵
|
3 | state = normal;↵ | | 3 | state = normal;↵
|
4 | } else {↵ | | 4 | } else {↵
|
5 | current.append(nextTok);↵ | | 5 | current.append(nextTok);↵
|
6 | }↵ | | 6 | }↵
|
7 | break; | | 7 | break;
|
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 the same method |
Number of node comparisons | 19 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
15 | if ("\'".equals(nextTok)) | | 21 | if ("\"".equals(nextTok)) |
16 | lastTokenHasBeenQuoted = true; | | 22 | lastTokenHasBeenQuoted = true; |
17 | | | 23 | |
| | | | |
18 | | | 24 | |
19 | break; | | 25 | break; |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables state, lastTokenHasBeenQuoted , while Clone fragment #2 returns variables state, lastTokenHasBeenQuoted |