switch (other.getMetaClass().index) { case ClassIndex.FIXNUM: case ClassIndex.BIGNUM: case ClassIndex.FLOAT: return RubyFloat.newFloat( getRuntime(), value * ((RubyNumeric) other).getDoubleValue()); default: return coerceBin(context, "*", other); }
switch (other.getMetaClass().index) { case ClassIndex.FIXNUM: case ClassIndex.BIGNUM: case ClassIndex.FLOAT: return RubyFloat.newFloat(getRuntime(), Math.pow(value, ((RubyNumeric) other) .getDoubleValue())); default: return coerceBin(context, "**", other); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyFloat.java File path: /jruby-1.4.0/src/org/jruby/RubyFloat.java
Method name: IRubyObject op_mul(ThreadContext, IRubyObject) Method name: IRubyObject op_pow(ThreadContext, IRubyObject)
Number of AST nodes: 7 Number of AST nodes: 7
1
switch (other.getMetaClass().index) {
1
switch (other.getMetaClass().index) {
2
        case ClassIndex.FIXNUM:
2
        case ClassIndex.FIXNUM:
3
        case ClassIndex.BIGNUM:
3
        case ClassIndex.BIGNUM:
4
        case ClassIndex.FLOAT:
4
        case ClassIndex.FLOAT:
5
            return RubyFloat.newFloat(
5
            return RubyFloat.newFloat(
6
                    getRuntime(), value * ((RubyNumeric) other)
6
getRuntime(), Math.pow(value, ((RubyNumeric) other)
7
.getDoubleValue());
7
                    .getDoubleValue()));
8
        default:
8
        default:
9
            return coerceBin(context, "*", other);
9
            return coerceBin(context, "**", other);
10
        }
10
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons24
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    switch (other.getMetaClass().index)
    1
    switch (other.getMetaClass().index)
    2
    case ClassIndex.FIXNUM:
    2
    case ClassIndex.FIXNUM:
    3
    case ClassIndex.BIGNUM:
    3
    case ClassIndex.BIGNUM:
    4
    case ClassIndex.FLOAT:
    4
    case ClassIndex.FLOAT:
    5
    return RubyFloat.newFloat(getRuntime(), value * ((RubyNumeric)other).getDoubleValue());
    5
    return RubyFloat.newFloat(getRuntime(), value * ((RubyNumeric)other).getDoubleValue());
    5
    return RubyFloat.newFloat(getRuntime(), Math.pow(value, ((RubyNumeric)other).getDoubleValue()));
    Differences
    Expression1Expression2Difference
    value * ((RubyNumeric)other).getDoubleValue()Math.pow(value,((RubyNumeric)other).getDoubleValue())TYPE_COMPATIBLE_REPLACEMENT
    5
    return RubyFloat.newFloat(getRuntime(), Math.pow(value, ((RubyNumeric)other).getDoubleValue()));
    6
    default:
    6
    default:
    7
    return coerceBin(context, "*", other);
    7
    return coerceBin(context, "*", other);
    7
    return coerceBin(context, "**", other);
    Differences
    Expression1Expression2Difference
    "*""**"LITERAL_VALUE_MISMATCH
    7
    return coerceBin(context, "**", other);
    Precondition Violations (0)
    Row Violation