if ((skey.interestOps() & skey.readyOps() & (SelectionKey.OP_WRITE)) != 0) { if(skey.attachment() == descriptor) { return true; } }
if ((skey.interestOps() & skey.readyOps() & (SelectionKey.OP_READ | SelectionKey.OP_ACCEPT)) != 0) { if(skey.attachment() == descriptor) { return true; } }
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: boolean waitWritable(ChannelDescriptor) Method name: boolean waitReadable(ChannelDescriptor)
Number of AST nodes: 3 Number of AST nodes: 3
1
if ((skey.interestOps() & skey.readyOps() & (SelectionKey.OP_WRITE)) != 0) {
1
if ((skey.interestOps() & skey.readyOps() & (SelectionKey.OP_READ | SelectionKey.OP_ACCEPT)) != 0) {
2
                        if(skey.attachment() == descriptor) {
2
                        if(skey.attachment() == descriptor) {
3
                            return true;
3
                            return true;
4
                        }
4
                        }
5
                    }
5
                    }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.7
Clones locationClones are declared in the same class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    20
    if ((skey.interestOps() & skey.readyOps() & (SelectionKey.OP_WRITE)) != 0)
    20
    if ((skey.interestOps() & skey.readyOps() & (SelectionKey.OP_WRITE)) != 0)
    20
    if ((skey.interestOps() & skey.readyOps() & (SelectionKey.OP_READ | SelectionKey.OP_ACCEPT)) != 0)
    Differences
    Expression1Expression2Difference
    SelectionKey.OP_WRITESelectionKey.OP_READ | SelectionKey.OP_ACCEPTTYPE_COMPATIBLE_REPLACEMENT
    20
    if ((skey.interestOps() & skey.readyOps() & (SelectionKey.OP_READ | SelectionKey.OP_ACCEPT)) != 0)
    21
    if (skey.attachment() == descriptor)
    21
    if (skey.attachment() == descriptor)
    22
    return true;
    22
    return true;
    22
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    22
    return true;
    Precondition Violations (2)
    Row Violation
    1Conditional return true;
    2Conditional return true;