for (int i = 0; i < maxSize; i++)
{
if (i != 0) retval += " ";
if (tok.kind == 0) {
retval += tokenImage[0];
break;
}
retval += add_escapes(tok.image);
tok = tok.next;
}
Token tok = currentToken.next;
for (int i = 0; i < maxSize; i++) {
if (i != 0) retval += " ";
if (tok.kind == 0) {
retval += tokenImage[0];
break;
}
retval += add_escapes(tok.image);
tok = tok.next;
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/ParseException.java
|
|
File path: /jEdit-4.2/src/bsh/ParseException.java
|
Method name: String getErrorText()
|
|
Method name: String getMessage(boolean)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 9
|
|
| | | 1 | Token tok = currentToken.next;↵
|
1 | for (int i = 0; i < maxSize; i++) ↵ | | 2 | for (int i = 0; i < maxSize; i++) ↵
|
2 | {↵ | | |
|
3 | ↵ | | 3 | {↵
|
4 | if (i != 0) retval += " ";↵ | | 4 | if (i != 0) retval += " ";↵
|
5 | if (tok.kind == 0) {↵ | | 5 | if (tok.kind == 0) {↵
|
6 | retval += tokenImage[0];↵ | | 6 | retval += tokenImage[0];↵
|
7 | break;↵ | | 7 | break;↵
|
8 | }↵ | | 8 | }↵
|
9 | retval += add_escapes(tok.image);↵ | | 9 | retval += add_escapes(tok.image);↵
|
10 | tok = tok.next;↵ | | 10 | tok = tok.next; ↵
|
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 32 |
-
{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 | 1 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 14 | Token tok = currentToken.next; |
7 | for (int i = 0; i < maxSize; i++) | | 15 | for (int i = 0; i < maxSize; i++) |
8 | | | 16 | |
9 | | | 17 | |
10 | | | 18 | |
11 | | | 19 | |
12 | | | 20 | |
13 | retval += add_escapes(tok.image); | | 21 | retval += add_escapes(tok.image); |
14 | | | 22 | |
Precondition Violations (0)
Row |
Violation |