File path: /jruby-1.4.0/src/org/jruby/ext/ffi/io/FileDescriptorByteChannel.java | File path: /jruby-1.4.0/src/org/jruby/ext/ffi/io/FileDescriptorByteChannel.java | |||
Method name: int read(ByteBuffer)
|
Method name: int write(ByteBuffer)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if (!isOpen) {↵ | 1 | if (!isOpen) {↵ | |
2 | throw new IOException("Not open");↵ | 2 | throw new IOException("Not open");↵ | |
3 | }↵ | 3 | }↵ | |
4 | int n = libc.read(fd, dst, dst.remaining());↵ | 4 | int n = libc.write(fd, src, src.remaining());↵ | |
5 | if (n > 0) {↵ | 5 | if (n > 0) {↵ | |
6 | dst.position(dst.position() + n);↵ | 6 | src.position(src.position() + n);↵ | |
7 | }↵ | 7 | }↵ | |
8 | return n; | 8 |
| |
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) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
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.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (!isOpen) | 1 | if (!isOpen) | |||||||||||||||||
2 | throw new IOException("Not open"); | 2 | throw new IOException("Not open"); | |||||||||||||||||
3 | int n = libc.read(fd, dst, dst.remaining()); |
| 3 | int n = libc.write(fd, src, src.remaining()); | ||||||||||||||||
4 | if (n > 0) | 4 | if (n > 0) | |||||||||||||||||
5 | dst.position(dst.position() + n); |
| 5 | src.position(src.position() + n); | ||||||||||||||||
6 | return n; | 6 | return n; |
Row | Violation |
---|