187-2-3

FastCompare(int initialCapacity) { super(initialCapacity); } /** * Creates an instance that is a copy of the collection. * @param collection the initial contents of the list. */ public FastCompare(Collection<? extends E> collection) { super(collection.size()); addAll(collection); } /** * Returns <code>false</code> because this list uses <code>==</code>. * @return <code>false</code>. */ @Override protected boolean useEquals() { return false; }
UniqueEList(int initialCapacity) { super(initialCapacity); } /** * Creates an instance that is a copy of the collection, with duplicates removed. * @param collection the initial contents of the list. */ public UniqueEList(Collection<? extends E> collection) { super(collection.size()); addAll(collection); } /** * Returns <code>true</code> because this list requires uniqueness. * @return <code>true</code>. */ @Override protected boolean isUnique() { return true; }

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEList.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/common/util/UniqueEList.java
Method name: `` |  | Method name: ``
Number of AST nodes: 0 |  | Number of AST nodes: 0

1

    FastCompare(int initialCapacity)↵

1

    UniqueEList(int initialCapacity)↵

2

        {↵

2

      ↵

3

      ↵

3

    {↵

4

        super(initialCapacity);↵

4

        super(initialCapacity);↵

5

        }↵

5

      }↵

6

        /**↵

6

      /**↵

7

         * Creates an instance that is a copy of the collection.↵

7

       * Creates an instance that is a copy of the collection, with duplicates removed.↵

8

         * @param collection the initial contents of the list.↵

8

       * @param collection the initial contents of the list.↵

9

         */↵

9

       */↵

10

        public FastCompare(Collection<? extends E> collection)↵

10

      public UniqueEList(Collection<? extends E> collection)↵

11

        {↵

11

      ↵

12

      ↵

12

    {↵

13

        super(collection.size());↵

13

        super(collection.size());↵

14

          addAll(collection);↵

14

        addAll(collection);↵

15

      ↵

15

       ↵

16

      }↵

16

      }↵

17

        /**↵

17

      /**↵

18

         * Returns <code>false</code> because this list uses <code>==</code>.↵

18

       * Returns <code>true</code> because this list ↵

19

      ↵

19

    requires uniqueness.↵

20

       * @return <code>false</code>.↵

20

       * @return <code>true</code>.↵

21

         */↵

21

       */↵

22

        @Override↵

22

      @Override↵

23

        protected boolean useEquals()↵

23

      protected boolean isUnique()↵

24

        {↵

24

      {↵

25

          return false;↵

25

        return true;↵

26

        }

26

      }

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 |
Number of node comparisons | 0