File path: /apache-ant-1.7.0/src/org/apache/tools/ant/DemuxOutputStream.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/LineOrientedOutputStream.java | |||
Method name: void write(byte[], int, int)
|
Method name: void write(byte[], int, int)
|
|||
Number of AST nodes: 16 | Number of AST nodes: 15 | |||
1 | int offset = off;↵ | 1 | int offset = off;↵ | |
2 | int blockStartOffset = offset;↵ | 2 | int blockStartOffset = offset;↵ | |
3 | int remaining = len;↵ | 3 | int remaining = len;↵ | |
4 | BufferInfo bufferInfo = getBufferInfo();↵ | |||
5 | while (remaining > 0) {↵ | 4 | while (remaining > 0) {↵ | |
6 | while (remaining > 0 && b[offset] != LF && b[offset] != CR) {↵ | 5 | while (remaining > 0 && b[offset] != LF && b[offset] != CR) {↵ | |
7 | offset++;↵ | 6 | offset++;↵ | |
8 | remaining--;↵ | 7 | remaining--;↵ | |
9 | }↵ | 8 | }↵ | |
10 | // either end of buffer or a line separator char↵ | 9 | // either end of buffer or a line separator char↵ | |
11 | int blockLength = offset - blockStartOffset;↵ | 10 | int blockLength = offset - blockStartOffset;↵ | |
12 | if (blockLength > 0) {↵ | 11 | if (blockLength > 0) {↵ | |
13 | bufferInfo.buffer.write(b, blockStartOffset, blockLength);↵ | 12 | buffer.write(b, blockStartOffset, blockLength);↵ | |
14 | }↵ | 13 | }↵ | |
15 | while (remaining > 0 && (b[offset] == LF || b[offset] == CR)) {↵ | 14 | while (remaining > 0 && (b[offset] == LF || b[offset] == CR)) {↵ | |
16 | write(b[offset]);↵ | 15 | write(b[offset]);↵ | |
17 | offset++;↵ | 16 | offset++;↵ | |
18 | remaining--;↵ | 17 | remaining--;↵ | |
19 | }↵ | 18 | }↵ | |
20 | blockStartOffset = offset;↵ | 19 | blockStartOffset = offset;↵ | |
21 | } | 20 |
| |
See real code fragment | See real code fragment |
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) | 1.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 83 |
Number of mapped statements | 15 |
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) | 5.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int offset = off; | 1 | int offset = off; | |||||||||||
2 | int blockStartOffset = offset; | 2 | int blockStartOffset = offset; | |||||||||||
3 | int remaining = len; | 3 | int remaining = len; | |||||||||||
4 | BufferInfo bufferInfo = getBufferInfo(); | | ||||||||||||
5 | while (remaining > 0) | 4 | while (remaining > 0) | |||||||||||
6 | while (remaining > 0 && b[offset] != LF && b[offset] != CR) | 5 | while (remaining > 0 && b[offset] != LF && b[offset] != CR) | |||||||||||
7 | offset++; | 6 | offset++; | |||||||||||
8 | remaining--; | 7 | remaining--; | |||||||||||
9 | int blockLength = offset - blockStartOffset; | 8 | int blockLength = offset - blockStartOffset; | |||||||||||
10 | if (blockLength > 0) | 9 | if (blockLength > 0) | |||||||||||
11 | bufferInfo.buffer.write(b, blockStartOffset, blockLength); |
| 10 | buffer.write(b, blockStartOffset, blockLength); | ||||||||||
12 | while (remaining > 0 && (b[offset] == LF || b[offset] == CR)) | 11 | while (remaining > 0 && (b[offset] == LF || b[offset] == CR)) | |||||||||||
13 | write(b[offset]); | 12 | write(b[offset]); | |||||||||||
14 | offset++; | 13 | offset++; | |||||||||||
15 | remaining--; | 14 | remaining--; | |||||||||||
16 | blockStartOffset = offset; | 15 | blockStartOffset = offset; |
Row | Violation |
---|