if ((ioObj.openFile.getMode() & OpenFile.READABLE) != 0) {
unselectable_reads.add(obj);
}
if (!registerSelect(context, selector, obj, ioObj, SelectionKey.OP_WRITE)) {
if ((ioObj.openFile.getMode() & OpenFile.WRITABLE) != 0) {
unselectable_writes.add(obj);
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyIO.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyIO.java
|
Method name: IRubyObject select_static(ThreadContext, Ruby, IRubyObject[])
|
|
Method name: IRubyObject select_static(ThreadContext, Ruby, IRubyObject[])
|
Number of AST nodes: 2
|
|
Number of AST nodes: 3
|
|
| | | 1 | if (!registerSelect(context, selector, obj, ioObj, SelectionKey.OP_WRITE)) {↵
|
1 | if ((ioObj.openFile.getMode() & OpenFile.READABLE) != 0) {↵ | | 2 | if ((ioObj.openFile.getMode() & OpenFile.WRITABLE) != 0) {↵
|
2 | unselectable_reads.add(obj);↵ | | 3 | unselectable_writes.add(obj);↵
|
3 | } | | 4 | }↵
|
| | | 5 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
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.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
18 | if ((ioObj.openFile.getMode() & OpenFile.READABLE) != 0) | | 28 | if ((ioObj.openFile.getMode() & OpenFile.WRITABLE) != 0) |
19 | unselectable_reads.add(obj); | | 29 | unselectable_writes.add(obj); |
Precondition Violations (0)
Row |
Violation |