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 write(Writer, int)
|
Method name: void writeAscii(OutputStream, int)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | InputStreamReader reader = new InputStreamReader(new FileInputStream(temporaryFileName), "UTF8");↵ | 1 | InputStream inputStream = new FileInputStream(temporaryFileName);↵ | |
2 | for (int length = reader.read(outputchars, 0, outputchars.length); length > 0; length = reader.read(↵ | 2 | for (int length = inputStream.read(outputbytes, 0, outputbytes.length); length > 0; length = inputStream.read(↵ | |
3 | outputchars,↵ | 3 | outputbytes,↵ | |
4 | 0,↵ | 4 | 0,↵ | |
5 | outputchars.length))↵ | 5 | outputbytes.length))↵ | |
6 | {↵ | 6 | {↵ | |
7 | os.write(outputchars, 0, length);↵ | 7 | os.write(outputbytes, 0, length);↵ | |
8 | count += length;↵ | 8 | count += length;↵ | |
9 | if (count > flushThreshold)↵ | 9 | if (count > flushThreshold)↵ | |
10 | {↵ | 10 | {↵ | |
11 | os.flush();↵ | 11 | os.flush();↵ | |
12 | count = 0;↵ | 12 | count = 0;↵ | |
13 | }↵ | 13 | }↵ | |
14 | }↵ | 14 | }↵ | |
15 | reader.close();↵ | 15 | inputStream.close();↵ | |
16 | new File(temporaryFileName).delete(); | 16 |
| |
See real code fragment | See real code fragment |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 33 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24 | InputStreamReader reader = new InputStreamReader(new FileInputStream(temporaryFileName), "UTF8"); | | |||||||||||||||||||||||||||||||||||||
| 31 | InputStream inputStream = new FileInputStream(temporaryFileName); | |||||||||||||||||||||||||||||||||||||
25 | for (int length = reader.read(outputchars, 0, outputchars.length); length > 0; length = reader.read(outputchars, 0, outputchars.length)) |
| 32 | for (int length = inputStream.read(outputbytes, 0, outputbytes.length); length > 0; length = inputStream.read(outputbytes, 0, outputbytes.length)) | |||||||||||||||||||||||||||||||||||
26 | os.write(outputchars, 0, length); |
| 33 | os.write(outputbytes, 0, length); | |||||||||||||||||||||||||||||||||||
27 | count += length; | 34 | count += length; | ||||||||||||||||||||||||||||||||||||
28 | if (count > flushThreshold) | 35 | if (count > flushThreshold) | ||||||||||||||||||||||||||||||||||||
29 | os.flush(); |
| 36 | os.flush(); | |||||||||||||||||||||||||||||||||||
30 | count = 0; | 37 | count = 0; | ||||||||||||||||||||||||||||||||||||
31 | reader.close(); |
| 38 | inputStream.close(); | |||||||||||||||||||||||||||||||||||
32 | new File(temporaryFileName).delete(); | 39 | new File(temporaryFileName).delete(); |
Row | Violation |
---|---|
1 | Type char[] of variable outputchars does not match with type byte[] of variable outputbytes |
2 | Type java.io.InputStreamReader of variable reader does not match with type java.io.InputStream of variable inputStream |
3 | Type char[] of variable outputchars does not match with type byte[] of variable outputbytes |
4 | Type java.io.InputStreamReader of variable reader does not match with type java.io.InputStream of variable inputStream |
5 | Type char[] of variable outputchars does not match with type byte[] of variable outputbytes |
6 | Type java.io.Writer of variable os does not match with type java.io.OutputStream of variable os |
7 | Type java.io.Writer of variable os does not match with type java.io.OutputStream of variable os |
8 | Type java.io.InputStreamReader of variable reader does not match with type java.io.InputStream of variable inputStream |