151-2-3

BasicEList<Entry<K, V>> eList = entryData[index]; if (eList != null) { Object [] entries = eList.data; int size = eList.size; for (int j = 0; j < size; ++j) { @SuppressWarnings("unchecked") Entry<K, V> entry = (Entry<K, V>)entries[j]; if (entry.getKey() == key) { return j; } } }
BasicEList<Entry<K, V>> eList = entryData[i]; if (eList != null) { Object [] entries = eList.data; int size = eList.size; for (int j = 0; j < size; ++j) { @SuppressWarnings("unchecked") Entry<K, V> entry = (Entry<K, V>)entries[j]; objectOutputStream.writeObject(entry.getKey()); objectOutputStream.writeObject(entry.getValue()); } }

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: `int entryIndexForKey(int, int, Object)` |  | Method name: `void writeObject(ObjectOutputStream)`
Number of AST nodes: 8 |  | Number of AST nodes: 8

1

    BasicEList<Entry<K, V>> eList = entryData[index];↵

1

    BasicEList<Entry<K, V>> eList = entryData[i];↵

2

          if (eList != null)↵

2

            if (eList != null)↵

3

          {↵

3

            {↵

4

            Object [] entries = eList.data;↵

4

              Object [] entries = eList.data;↵

5

            int size = eList.size;↵

5

              int size = eList.size;↵

6

            for (int j = 0; j < size; ++j)↵

6

              for (int j = 0; j < size; ++j)↵

7

            {↵

7

              {↵

8

              @SuppressWarnings("unchecked") Entry<K, V> entry = (Entry<K, V>)entries[j];↵

8

                @SuppressWarnings("unchecked") Entry<K, V> entry = (Entry<K, V>)entries[j];↵

9

              if (entry.getKey() == key) ↵

9

              ↵

10

              {↵

11

                return j↵

10

      objectOutputStream.writeObject(entry.getKey());↵

12

    ;↵

11

                objectOutputStream.writeObject(entry.getValue());↵

13

              }↵

12

              }↵

14

            }↵

13

            }

15

          }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location | Clones are declared in the same class
Number of node comparisons | 1