assert IdUtil.isConstant(name) && value != null; ensureConstantsSettable(); return constantTableStore(name, value);
assert IdUtil.isInstanceVariable(internedName) && value != null; ensureInstanceVariablesSettable(); return (IRubyObject)variableTableFastStore(internedName, value);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyModule.java File path: /jruby-1.4.0/src/org/jruby/RubyBasicObject.java
Method name: IRubyObject storeConstant(String, IRubyObject) Method name: IRubyObject fastSetInstanceVariable(String, IRubyObject)
Number of AST nodes: 3 Number of AST nodes: 3
1
assert IdUtil.isConstant(name) && value != null;
1
assert IdUtil.isInstanceVariable(internedName) && value != null;
2
        ensureConstantsSettable();
2
        ensureInstanceVariablesSettable();
3
        return constantTableStore(name, value);
3
        return (IRubyObject)variableTableFastStore(internedName, value);
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    assert IdUtil.isConstant(name) && value != null;
    1
    assert IdUtil.isConstant(name) && value != null;
    1
    assert IdUtil.isInstanceVariable(internedName) && value != null;
    Differences
    Expression1Expression2Difference
    isConstantisInstanceVariableMETHOD_INVOCATION_NAME_MISMATCH
    nameinternedNameVARIABLE_NAME_MISMATCH
    1
    assert IdUtil.isInstanceVariable(internedName) && value != null;
    2
    ensureConstantsSettable();
    2
    ensureConstantsSettable();
    2
    ensureInstanceVariablesSettable();
    Differences
    Expression1Expression2Difference
    ensureConstantsSettableensureInstanceVariablesSettableMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression ensureConstantsSettable() is a void method call, and thus it cannot be parameterized
    Expression ensureInstanceVariablesSettable() is a void method call, and thus it cannot be parameterized
    2
    ensureInstanceVariablesSettable();
    3
    return constantTableStore(name, value);
    3
    return constantTableStore(name, value);
    3
    return (IRubyObject)variableTableFastStore(internedName, value);
    Differences
    Expression1Expression2Difference
    constantTableStore(name,value)(IRubyObject)variableTableFastStore(internedName,value)TYPE_COMPATIBLE_REPLACEMENT
    3
    return (IRubyObject)variableTableFastStore(internedName, value);
    Precondition Violations (2)
    Row Violation
    1Expression ensureConstantsSettable() is a void method call, and thus it cannot be parameterized
    2Expression ensureInstanceVariablesSettable() is a void method call, and thus it cannot be parameterized