@SuppressWarnings("unchecked") Entry<K, V> [] entries = (Entry<K, V> [])eList.data; int size = eList.size; for (int j = 0; j < size; ++j) { Entry<K, V> entry = entries[j]; if (entry.getHash() == hash && entry.equals(otherEntry)) { // BasicEMap.this.removeEntry(index, j); remove(otherEntry); return true; } }
@SuppressWarnings("unchecked") Entry<K, V> [] entries = (Entry<K, V> [])eList.data; int size = eList.size; for (int j = 0; j < size; ++j) { Entry<K, V> entry = entries[j]; if (value == entry.getValue()) { return true; } }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEMap.java File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEMap.java
Method name: boolean remove(Object) Method name: boolean containsValue(Object)
Number of AST nodes: 7 Number of AST nodes: 6
1
@SuppressWarnings("unchecked") Entry<K, V> [] entries = (Entry<K, V> [])eList.data;
1
@SuppressWarnings("unchecked") Entry<K, V> [] entries = (Entry<K, V> [])eList.data;
2
              int size = eList.size;
2
            int size = eList.size;
3
              for (int j = 0; j < size; ++j)
3
            for (int j = 0; j < size; ++j)
4
              {
4
            {
5
                Entry<K, V> entry = entries[j];
5
              Entry<K, V> entry = entries[j];
6
                if (entry.getHash() == hash && entry.equals(otherEntry)) 
6
              if (
7
                {
8
                  // BasicEMap.this.removeEntry(index, j);
9
                  remove(otherEntry);
10
  
7
value == entry.getValue())
8
              {
11
                return true;
9
                return true;
12
                }
10
              
13
  
11
}
14
            }
12
            }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same java file
Number of node comparisons1