if (this == other) return getRuntime().getTrue(); if (!(other instanceof RubyRange)) return getRuntime().getFalse(); RubyRange otherRange = (RubyRange)other; if (eqlInternal(context, begin, otherRange.begin) && eqlInternal(context, end, otherRange.end) && isExclusive == otherRange.isExclusive) return getRuntime().getTrue(); return getRuntime().getFalse();
if (this == other) return getRuntime().getTrue(); if (!(other instanceof RubyRange)) return getRuntime().getFalse(); RubyRange otherRange = (RubyRange) other; if (equalInternal(context, begin, otherRange.begin) && equalInternal(context, end, otherRange.end) && isExclusive == otherRange.isExclusive) return getRuntime().getTrue(); return getRuntime().getFalse();
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyRange.java File path: /jruby-1.4.0/src/org/jruby/RubyRange.java
Method name: IRubyObject eql_p(ThreadContext, IRubyObject) Method name: IRubyObject op_equal(ThreadContext, IRubyObject)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (this == other) return getRuntime().getTrue();
1
if (this == other) return getRuntime().getTrue();
2
        if (!(other instanceof RubyRange)) return getRuntime().getFalse();
2
        if (!(other instanceof RubyRange)) return getRuntime().getFalse();
3
        RubyRange otherRange = (RubyRange)other;
3
        RubyRange otherRange = (RubyRange) other;
4
        if (eqlInternal(context, begin, otherRange.begin) &&
4
        if (equalInternal(context, begin, otherRange.begin) &&
5
            eqlInternal(context, end, otherRange.end) &&
5
            equalInternal(context, end, otherRange.end) &&
6
            isExclusive == otherRange.isExclusive) return getRuntime().getTrue();
6
            isExclusive == otherRange.isExclusive) return getRuntime().getTrue();
7
        return getRuntime().getFalse();
7
        return getRuntime().getFalse();
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.8
Clones locationClones are declared in the same class
Number of node comparisons31
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this == other)
    1
    if (this == other)
    2
    return getRuntime().getTrue();
    2
    return getRuntime().getTrue();
    3
    if (!(other instanceof RubyRange))
    3
    if (!(other instanceof RubyRange))
    4
    return getRuntime().getFalse();
    4
    return getRuntime().getFalse();
    5
    RubyRange otherRange = (RubyRange)other;
    5
    RubyRange otherRange = (RubyRange)other;
    6
    if (eqlInternal(context, begin, otherRange.begin) && eqlInternal(context, end, otherRange.end) && isExclusive == otherRange.isExclusive)
    6
    if (eqlInternal(context, begin, otherRange.begin) && eqlInternal(context, end, otherRange.end) && isExclusive == otherRange.isExclusive)
    6
    if (equalInternal(context, begin, otherRange.begin) && equalInternal(context, end, otherRange.end) && isExclusive == otherRange.isExclusive)
    Differences
    Expression1Expression2Difference
    eqlInternalequalInternalMETHOD_INVOCATION_NAME_MISMATCH
    eqlInternalequalInternalMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression eqlInternal(context,begin,otherRange.begin) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression equalInternal(context,begin,otherRange.begin) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression eqlInternal(context,end,otherRange.end) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression equalInternal(context,end,otherRange.end) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (equalInternal(context, begin, otherRange.begin) && equalInternal(context, end, otherRange.end) && isExclusive == otherRange.isExclusive)
    7
    return getRuntime().getTrue();
    7
    return getRuntime().getTrue();
    8
    return getRuntime().getFalse();
    8
    return getRuntime().getFalse();
    Precondition Violations (4)
    Row Violation
    1Expression eqlInternal(context,begin,otherRange.begin) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression equalInternal(context,begin,otherRange.begin) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression eqlInternal(context,end,otherRange.end) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression equalInternal(context,end,otherRange.end) cannot be parameterized, because it has dependencies to/from statements that will be extracted