Entry e; while ((e = (Entry) queue.poll()) != null) { removeEntry(e); }
WeakReferenceListNode reference; while ((reference = (WeakReferenceListNode)deadReferences.poll()) != null) { reference.remove(); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/util/WeakIdentityHashMap.java File path: /jruby-1.4.0/src/org/jruby/runtime/ObjectSpace.java
Method name: void expunge() Method name: void cleanup()
Number of AST nodes: 3 Number of AST nodes: 3
1
Entry e;
2
        while ((e = (Entry) queue
1
WeakReferenceListNode reference;
3
.poll()) != null) {
2
        while ((reference = (WeakReferenceListNode)deadReferences.poll()) != null) {
4
            removeEntry(e);
3
            reference.remove();
5
        }
4
        }
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 in different classes
Number of node comparisons5
  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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Entry e;
    1
    Entry e;
    1
    WeakReferenceListNode reference;
    Differences
    Expression1Expression2Difference
    org.jruby.util.WeakIdentityHashMap.Entryorg.jruby.runtime.ObjectSpace.WeakReferenceListNodeSUBCLASS_TYPE_MISMATCH
    ereferenceVARIABLE_NAME_MISMATCH
    org.jruby.util.WeakIdentityHashMap.Entryorg.jruby.runtime.ObjectSpace.WeakReferenceListNodeSUBCLASS_TYPE_MISMATCH
    1
    WeakReferenceListNode reference;
    2
    while ((e = (Entry)queue.poll()) != null)
    2
    while ((e = (Entry)queue.poll()) != null)
    2
    while ((reference = (WeakReferenceListNode)deadReferences.poll()) != null)
    Differences
    Expression1Expression2Difference
    ereferenceVARIABLE_NAME_MISMATCH
    org.jruby.util.WeakIdentityHashMap.Entryorg.jruby.runtime.ObjectSpace.WeakReferenceListNodeSUBCLASS_TYPE_MISMATCH
    org.jruby.util.WeakIdentityHashMap.Entryorg.jruby.runtime.ObjectSpace.WeakReferenceListNodeSUBCLASS_TYPE_MISMATCH
    queuedeadReferencesVARIABLE_NAME_MISMATCH
    2
    while ((reference = (WeakReferenceListNode)deadReferences.poll()) != null)
    3
    removeEntry(e);
    3
    removeEntry(e);
    3
    reference.remove();
    Differences
    Expression1Expression2Difference
    removeEntryremoveMETHOD_INVOCATION_NAME_MISMATCH
    removeEntry(e)reference.remove()ARGUMENT_NUMBER_MISMATCH
    referenceMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression removeEntry(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method removeEntry
    Expression reference.remove() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression removeEntry(e) is a void method call, and thus it cannot be parameterized
    Expression reference.remove() is a void method call, and thus it cannot be parameterized
    Expression removeEntry(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method removeEntry
    Expression reference.remove() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression removeEntry(e) is a void method call, and thus it cannot be parameterized
    Expression reference.remove() is a void method call, and thus it cannot be parameterized
    3
    reference.remove();
    Precondition Violations (8)
    Row Violation
    1Expression removeEntry(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression reference.remove() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression removeEntry(e) is a void method call, and thus it cannot be parameterized
    4Expression reference.remove() is a void method call, and thus it cannot be parameterized
    5Expression removeEntry(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression reference.remove() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression removeEntry(e) is a void method call, and thus it cannot be parameterized
    8Expression reference.remove() is a void method call, and thus it cannot be parameterized