if (USE_PACKED_ARRAY) { if (packedVTable != null) return packedStore(name, value); } else if (USE_PACKED_FIELDS) { if (packedVFields != null) return packedVFields.store(name, value); } return hashStore(name, value);
if (USE_PACKED_ARRAY) { if (packedVTable != null) return fastPackedStore(internedName, value); } else if (USE_PACKED_FIELDS) { if (packedVFields != null) return packedVFields.fastStore(internedName, value); } return fastHashStore(internedName, value);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/builtin/InstanceVariableTable.java File path: /jruby-1.4.0/src/org/jruby/runtime/builtin/InstanceVariableTable.java
Method name: Object store(String, Object) Method name: Object fastStore(String, Object)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (USE_PACKED_ARRAY) {
1
if (USE_PACKED_ARRAY) {
2
            if (packedVTable != null) return packedStore(name, value); 
2
            if (packedVTable != null) return fastPackedStore(internedName, value); 
3
        } else if (USE_PACKED_FIELDS) {
3
        } else if (USE_PACKED_FIELDS) {
4
            if (packedVFields != null) return packedVFields.store(name, value);
4
            if (packedVFields != null) return packedVFields.fastStore(internedName, value);
5
        }
5
        }
6
        return hashStore(name, value);
6
        return fastHashStore(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.6
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Non-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)2.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (USE_PACKED_ARRAY)
    1
    if (USE_PACKED_ARRAY)
    2
    if (packedVTable != null)
    2
    if (packedVTable != null)
    3
    return packedStore(name, value);
    3
    return packedStore(name, value);
    3
    return fastPackedStore(internedName, value);
    Differences
    Expression1Expression2Difference
    packedStorefastPackedStoreMETHOD_INVOCATION_NAME_MISMATCH
    nameinternedNameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression packedStore(name,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method packedStore
    Expression fastPackedStore(internedName,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method fastPackedStore
    3
    return fastPackedStore(internedName, value);
    4
    else if (USE_PACKED_FIELDS)
    4
    else if (USE_PACKED_FIELDS)
    5
    if (packedVFields != null)
    5
    if (packedVFields != null)
    6
    return packedVFields.store(name, value);
    6
    return packedVFields.store(name, value);
    6
    return packedVFields.fastStore(internedName, value);
    Differences
    Expression1Expression2Difference
    storefastStoreMETHOD_INVOCATION_NAME_MISMATCH
    nameinternedNameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression packedVFields.store(name,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression packedVFields.fastStore(internedName,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    return packedVFields.fastStore(internedName, value);
    7
    return hashStore(name, value);
    7
    return hashStore(name, value);
    7
    return fastHashStore(internedName, value);
    Differences
    Expression1Expression2Difference
    hashStorefastHashStoreMETHOD_INVOCATION_NAME_MISMATCH
    nameinternedNameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression hashStore(name,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method hashStore
    Expression fastHashStore(internedName,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method fastHashStore
    7
    return fastHashStore(internedName, value);
    Precondition Violations (6)
    Row Violation
    1Expression packedStore(name,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression fastPackedStore(internedName,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression packedVFields.store(name,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression packedVFields.fastStore(internedName,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression hashStore(name,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression fastHashStore(internedName,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted