if (other instanceof RubyRegexp) return ((RubyRegexp) other).op_match19(context, this); if (other instanceof RubyString) throw context.getRuntime().newTypeError("type mismatch: String given"); return other.callMethod(context, "=~", this);
if (other instanceof RubyRegexp) return ((RubyRegexp) other).op_match(context, this); if (other instanceof RubyString) throw context.getRuntime().newTypeError("type mismatch: String given"); return other.callMethod(context, "=~", this);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyString.java File path: /jruby-1.4.0/src/org/jruby/RubyString.java
Method name: IRubyObject op_match19(ThreadContext, IRubyObject) Method name: IRubyObject op_match(ThreadContext, IRubyObject)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (other instanceof RubyRegexp) return ((RubyRegexp) other).op_match19(context, this);
1
if (other instanceof RubyRegexp) return ((RubyRegexp) other).op_match(context, this);
2
        if (other instanceof RubyString) throw context.getRuntime().newTypeError("type mismatch: String given");
2
        if (other instanceof RubyString) throw context.getRuntime().newTypeError("type mismatch: String given");
3
        return other.callMethod(context, "=~", this);
3
        return other.callMethod(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.3
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (other instanceof RubyRegexp)
    1
    if (other instanceof RubyRegexp)
    2
    return ((RubyRegexp)other).op_match19(context, this);
    2
    return ((RubyRegexp)other).op_match19(context, this);
    2
    return ((RubyRegexp)other).op_match(context, this);
    Differences
    Expression1Expression2Difference
    op_match19op_matchMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression ((RubyRegexp)other).op_match19(context,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((RubyRegexp)other).op_match(context,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    return ((RubyRegexp)other).op_match(context, this);
    3
    if (other instanceof RubyString)
    3
    if (other instanceof RubyString)
    4
    throw context.getRuntime().newTypeError("type mismatch: String given");
    4
    throw context.getRuntime().newTypeError("type mismatch: String given");
    5
    return other.callMethod(context, "=~", this);
    5
    return other.callMethod(context, "=~", this);
    Precondition Violations (2)
    Row Violation
    1Expression ((RubyRegexp)other).op_match19(context,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ((RubyRegexp)other).op_match(context,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted