if (i != 0) retval += " ";
if (tok.kind == 0) {
retval += tokenImage[0];
break;
}
retval += add_escapes(tok.image);
tok = tok.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: 7
|
|
Number of AST nodes: 8
|
|
| | | 1 | for (int i = 0; i < maxSize; i++) {↵
|
1 | if (i != 0) retval += " ";↵ | | 2 | if (i != 0) retval += " ";↵
|
2 | if (tok.kind == 0) {↵ | | 3 | if (tok.kind == 0) {↵
|
3 | retval += tokenImage[0];↵ | | 4 | retval += tokenImage[0];↵
|
4 | break;↵ | | 5 | break;↵
|
5 | }↵ | | 6 | }↵
|
6 | retval += add_escapes(tok.image);↵ | | 7 | retval += add_escapes(tok.image);↵
|
7 | tok = tok.next; | | 8 | tok = tok.next; ↵
|
| | | 9 | }
|
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 25 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 2.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | if (i != 0) | | 16 | if (i != 0) |
9 | | | 17 | |
10 | if (tok.kind == 0) | | 18 | if (tok.kind == 0) |
11 | | | 19 | |
12 | | | 20 | |
13 | retval += add_escapes(tok.image); | | 21 | retval += add_escapes(tok.image); |
14 | tok = tok.next; | | 22 | tok = tok.next; |
Precondition Violations (3)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |
3 | Clone fragment #1 returns variables retval, tok , while Clone fragment #2 returns variables retval, tok |