Entry e; while ((e = (Entry) queue.poll()) != null) { removeEntry(e); }
KeyedClassReference reference; while ((reference = (KeyedClassReference)referenceQueue.poll()) != null) { cache.remove(reference.getKey()); }
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/util/ClassCache.java
Method name: void expunge() Method name: void cleanup()
Number of AST nodes: 3 Number of AST nodes: 3
1
Entry e;
1
KeyedClassReference reference;
2
        while ((e = (Entry) queue.poll()) != null) {
2
        while ((reference = (KeyedClassReference)referenceQueue.poll()) != null) {
3
            removeEntry(e);
3
            cache.remove(reference.getKey());
4
        }
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 statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Entry e;
    1
    Entry e;
    1
    KeyedClassReference reference;
    Differences
    Expression1Expression2Difference
    org.jruby.util.WeakIdentityHashMap.Entryorg.jruby.util.ClassCache.KeyedClassReferenceSUBCLASS_TYPE_MISMATCH
    ereferenceVARIABLE_NAME_MISMATCH
    org.jruby.util.WeakIdentityHashMap.Entryorg.jruby.util.ClassCache.KeyedClassReferenceSUBCLASS_TYPE_MISMATCH
    1
    KeyedClassReference reference;
    2
    while ((e = (Entry)queue.poll()) != null)
    2
    while ((e = (Entry)queue.poll()) != null)
    2
    while ((reference = (KeyedClassReference)referenceQueue.poll()) != null)
    Differences
    Expression1Expression2Difference
    ereferenceVARIABLE_NAME_MISMATCH
    org.jruby.util.WeakIdentityHashMap.Entryorg.jruby.util.ClassCache.KeyedClassReferenceSUBCLASS_TYPE_MISMATCH
    org.jruby.util.WeakIdentityHashMap.Entryorg.jruby.util.ClassCache.KeyedClassReferenceSUBCLASS_TYPE_MISMATCH
    queuereferenceQueueVARIABLE_NAME_MISMATCH
    2
    while ((reference = (KeyedClassReference)referenceQueue.poll()) != null)
                                                                            
    3
    cache.remove(reference.getKey());
    Preondition Violations
    Unmatched statement cache.remove(reference.getKey()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    cache.remove(reference.getKey());
    3
    removeEntry(e);
    3
    removeEntry(e);
    Preondition Violations
    Unmatched statement removeEntry(e); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                        
    Precondition Violations (3)
    Row Violation
    1Unmatched statement cache.remove(reference.getKey()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement removeEntry(e); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variable e with type org.jruby.util.WeakIdentityHashMap.Entry , while Clone fragment #2 returns variable reference with type org.jruby.util.ClassCache.KeyedClassReference