if (other instanceof RubyFixnum || (other = fixCoerce(other)) instanceof RubyFixnum) { return newFixnum(context.getRuntime(), value ^ ((RubyFixnum) other).value); } return ((RubyBignum) other).op_xor(context, this);
if (other instanceof RubyFixnum || (other = fixCoerce(other)) instanceof RubyFixnum) { return newFixnum(context.getRuntime(), value & ((RubyFixnum) other).value); } return ((RubyBignum) other).op_and(context, this);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyFixnum.java File path: /jruby-1.4.0/src/org/jruby/RubyFixnum.java
Method name: IRubyObject op_xor(ThreadContext, IRubyObject) Method name: IRubyObject op_and(ThreadContext, IRubyObject)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (other instanceof RubyFixnum || (other = fixCoerce(other)) instanceof RubyFixnum) {
1
if (other instanceof RubyFixnum || (other = fixCoerce(other)) instanceof RubyFixnum) {
2
            return newFixnum(context.getRuntime(), value ^ ((RubyFixnum) other).value);
2
            return newFixnum(context.getRuntime(), value & ((RubyFixnum) other).value);
3
        }
3
        }
4
        return ((RubyBignum) other).op_xor(context, this);
4
        return ((RubyBignum) other).op_and(context, this);
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.2
Clones locationClones are declared in the same class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (other instanceof RubyFixnum || (other = fixCoerce(other)) instanceof RubyFixnum)
    1
    if (other instanceof RubyFixnum || (other = fixCoerce(other)) instanceof RubyFixnum)
                                                                                                                                                            
    2
    return newFixnum(context.getRuntime(), value & ((RubyFixnum)other).value);
    Preondition Violations
    Unmatched statement return newFixnum(context.getRuntime(),value & ((RubyFixnum)other).value); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return newFixnum(context.getRuntime(),value & ((RubyFixnum)other).value);
    2
    return newFixnum(context.getRuntime(), value & ((RubyFixnum)other).value);
    2
    return newFixnum(context.getRuntime(), value ^ ((RubyFixnum)other).value);
    2
    return newFixnum(context.getRuntime(), value ^ ((RubyFixnum)other).value);
    Preondition Violations
    Unmatched statement return newFixnum(context.getRuntime(),value ^ ((RubyFixnum)other).value); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return newFixnum(context.getRuntime(),value ^ ((RubyFixnum)other).value);
                                                                                                                                                            
    3
    return ((RubyBignum)other).op_xor(context, this);
    3
    return ((RubyBignum)other).op_xor(context, this);
    3
    return ((RubyBignum)other).op_and(context, this);
    Differences
    Expression1Expression2Difference
    op_xorop_andMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression ((RubyBignum)other).op_xor(context,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((RubyBignum)other).op_and(context,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    return ((RubyBignum)other).op_and(context, this);
    Precondition Violations (6)
    Row Violation
    1Unmatched statement return newFixnum(context.getRuntime(),value & ((RubyFixnum)other).value); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched return newFixnum(context.getRuntime(),value & ((RubyFixnum)other).value);
    3Unmatched statement return newFixnum(context.getRuntime(),value ^ ((RubyFixnum)other).value); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return newFixnum(context.getRuntime(),value ^ ((RubyFixnum)other).value);
    5Expression ((RubyBignum)other).op_xor(context,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression ((RubyBignum)other).op_and(context,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted