string.getChars(0, length, outputchars, position);
position += length;
count += length;
if (count > flushThreshold)
{
os.flush();
count = 0;
}
string.getChars(0, length, outputchars, position);
position += length;
count += length;
if (count > flushThreshold)
{
os.flush();
count = 0;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/StringSegment.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/StringSegment.java
|
Method name: void writeAscii(OutputStream, int)
|
|
Method name: void write(Writer, int)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | string.getChars(0, length, outputchars, position);↵ | | 1 | string.getChars(0, length, outputchars, position);↵
|
2 | position += length;↵ | | 2 | position += length;↵
|
3 | count += length;↵ | | 3 | count += length;↵
|
4 | if (count > flushThreshold)↵ | | 4 | if (count > flushThreshold)↵
|
5 | {↵ | | 5 | {↵
|
6 | os.flush();↵ | | 6 | os.flush();↵
|
7 | count = 0;↵ | | 7 | count = 0;↵
|
8 | } | | 8 | }
|
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 declared in the same class |
Number of node comparisons | 26 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
20 | string.getChars(0, length, outputchars, position); | | 15 | string.getChars(0, length, outputchars, position); |
21 | position += length; | | 16 | position += length; |
22 | count += length; | | 17 | count += length; |
23 | if (count > flushThreshold) | | 18 | if (count > flushThreshold) |
24 | | | 19 | |
25 | | | 20 | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.io.OutputStream of variable os does not match with type java.io.Writer of variable os |
2 | Clone fragment #1 returns variables position, count , while Clone fragment #2 returns variables position, count |