int rlen = replacement.length;
int newPos = pos + rlen;
grow(newPos + inputLength);
System.arraycopy(value, pos+1, value, newPos, inputLength);
System.arraycopy(replacement, 0, value, pos, rlen);
return newPos;
int rlen = replacement.length;
int newPos = pos + rlen;
grow(newPos + inputLength);
System.arraycopy(replacement, 0, value, pos, rlen);
return newPos;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java
|
Method name: int replace(int, char[], int)
|
|
Method name: int replaceChars(int, char[], int)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 5
|
|
1 | int rlen = replacement.length;↵ | | 1 | int rlen = replacement.length;↵
|
2 | int newPos = pos + rlen;↵ | | 2 | int newPos = pos + rlen;↵
|
3 | grow(newPos + inputLength);↵ | | 3 | grow(newPos + inputLength);↵
|
4 | System.arraycopy(value, pos+1, value, newPos, inputLength);↵ | | |
|
5 | System.arraycopy(replacement, 0, value, pos, rlen);↵ | | 4 | System.arraycopy(replacement, 0, value, pos, rlen);↵
|
6 | return newPos; | | 5 | return newPos;
|
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 21 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | int rlen = replacement.length; | | 1 | int rlen = replacement.length; |
2 | int newPos = pos + rlen; | | 2 | int newPos = pos + rlen; |
3 | grow(newPos + inputLength); | | 3 | grow(newPos + inputLength); |
4 | System.arraycopy(value, pos + 1, value, newPos, inputLength); | | | |
5 | System.arraycopy(replacement, 0, value, pos, rlen); | | 4 | System.arraycopy(replacement, 0, value, pos, rlen); |
6 | return newPos; | | 5 | return newPos; |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables newPos , while Clone fragment #2 returns variables |