if (USE_PACKED_ARRAY) { if (packedVTable != null) return packedRemove(name); } else if (USE_PACKED_FIELDS) { if (packedVFields != null) return packedVFields.remove(name); } return hashRemove(name);
if (USE_PACKED_ARRAY) { if (packedVTable != null) return packedContains(name); } else if (USE_PACKED_FIELDS) { if (packedVFields != null) return packedVFields.contains(name); } return hashContains(name);
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 remove(String) Method name: boolean contains(String)
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 packedRemove(name);
2
            if (packedVTable != null) return packedContains(name);
3
        } else if (USE_PACKED_FIELDS) {
3
        } else if (USE_PACKED_FIELDS) {
4
            if (packedVFields != null) return packedVFields.remove(name);
4
            if (packedVFields != null) return packedVFields.contains(name);
5
        }
5
        }
6
        return hashRemove(name);
6
        return hashContains(name);
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.5
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.0
    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 packedContains(name);
    Preondition Violations
    Unmatched statement return packedContains(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return packedContains(name);
    3
    return packedContains(name);
    3
    return packedRemove(name);
    3
    return packedRemove(name);
    Preondition Violations
    Unmatched statement return packedRemove(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return packedRemove(name);
                                                              
    4
    else if (USE_PACKED_FIELDS)
    4
    else if (USE_PACKED_FIELDS)
    5
    if (packedVFields != null)
    5
    if (packedVFields != null)
                                                                                  
    6
    return packedVFields.contains(name);
    Preondition Violations
    Unmatched statement return packedVFields.contains(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return packedVFields.contains(name);
    6
    return packedVFields.contains(name);
    6
    return packedVFields.remove(name);
    6
    return packedVFields.remove(name);
    Preondition Violations
    Unmatched statement return packedVFields.remove(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return packedVFields.remove(name);
                                                                              
                                                              
    7
    return hashContains(name);
    Preondition Violations
    Unmatched return hashContains(name);
    7
    return hashContains(name);
    7
    return hashRemove(name);
    7
    return hashRemove(name);
    Preondition Violations
    Unmatched return hashRemove(name);
                                                          
    Precondition Violations (10)
    Row Violation
    1Unmatched statement return packedContains(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched return packedContains(name);
    3Unmatched statement return packedRemove(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return packedRemove(name);
    5Unmatched statement return packedVFields.contains(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched return packedVFields.contains(name);
    7Unmatched statement return packedVFields.remove(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Unmatched return packedVFields.remove(name);
    9Unmatched return hashContains(name);
    10Unmatched return hashRemove(name);