while (pos < str.length()) {
ch = str.charAt(pos);
if (ch == '<') {
result.append("<");
} else if (ch == '>') {
result.append(">");
} else {
result.append(ch);
}
pos++;
}
while (pos < str.length()) {
ch = str.charAt(pos);
if (ch == '<') {
result.append("<");
} else if (ch == '>') {
result.append(">");
} else {
result.append(ch);
}
pos++;
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/util/ToolTipFactory.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/contact/list/HeaderItemToolTipFactory.java
|
Method name: String convert(String)
|
|
Method name: String convert(String)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | while (pos < str.length()) {↵ | | 1 | while (pos < str.length()) {↵
|
2 | ch = str.charAt(pos);↵ | | 2 | ch = str.charAt(pos);↵
|
|
3 | if (ch == '<') {↵ | | 3 | if (ch == '<') {↵
|
4 | result.append("<");↵ | | 4 | result.append("<");↵
|
5 | } else if (ch == '>') {↵ | | 5 | } else if (ch == '>') {↵
|
6 | result.append(">");↵ | | 6 | result.append(">");↵
|
7 | } else {↵ | | 7 | } else {↵
|
8 | result.append(ch);↵ | | 8 | result.append(ch);↵
|
9 | }↵ | | 9 | }↵
|
|
10 | pos++;↵ | | 10 | pos++;↵
|
11 | } | | 11 | }
|
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 29 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 8 |
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.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | while (pos < str.length()) | | 6 | while (pos < str.length()) |
7 | | | 7 | |
8 | | | 8 | |
9 | | | 9 | |
10 | | | 10 | |
11 | | | 11 | |
| | | | |
12 | | | 12 | |
13 | | | 13 | |
Precondition Violations (0)
Row |
Violation |