125-1-2

String featureNamespace = getNamespace(eStructuralFeature); if (namespace == null) { if (featureNamespace == null) { return eStructuralFeature; } else if (result == null) { result = eStructuralFeature; } } else if (namespace.equals(featureNamespace)) { return eStructuralFeature; } else if (featureNamespace == null && result == null) { result = eStructuralFeature; }
String featureNamespace = getNamespace(eStructuralFeature); if (namespace == null) { if (featureNamespace == null) { return eStructuralFeature; } else if (result == null) { result = eStructuralFeature; } } else if (namespace.equals(featureNamespace)) { return eStructuralFeature; } else if (featureNamespace == null && result == null) { result = eStructuralFeature; }

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
Method name: `EStructuralFeature getLocalElement(EClass, String, String)` |  | Method name: `EStructuralFeature getLocalElement(EClass, String, String)`
Number of AST nodes: 10 |  | Number of AST nodes: 10

1

    String featureNamespace = getNamespace(eStructuralFeature);↵

1

    String featureNamespace = getNamespace(eStructuralFeature);↵

2

                  if (namespace == null) ↵

2

              if (namespace == null) ↵

3

                  {↵

3

              ↵

4

      ↵

4

    {↵

5

                  if (featureNamespace == null)↵

5

                if (featureNamespace == null)↵

6

                    {↵

6

                ↵

7

       ↵

7

    {↵

8

                   return eStructuralFeature;↵

8

                  return eStructuralFeature;↵

9

                    }↵

9

                }↵

10

                    else if (result == null)↵

10

                else if (result == null)↵

11

                    {↵

11

                ↵

12

        ↵

12

    {↵

13

                  result = eStructuralFeature;↵

13

                  result = eStructuralFeature;↵

14

                    }↵

14

                ↵

15

        ↵

15

    }↵

16

              }↵

16

              }↵

17

                  else if (namespace.equals(featureNamespace))↵

17

              else if (namespace.equals(featureNamespace))↵

18

                  {↵

18

              ↵

19

        ↵

19

    {↵

20

                return eStructuralFeature;↵

20

                return eStructuralFeature;↵

21

                  }↵

21

              ↵

22

        ↵

22

    }↵

23

              else if (featureNamespace == null && result == null)↵

23

              else if (featureNamespace == null && result == null)↵

24

                  {↵

24

              ↵

25

        ↵

25

    {↵

26

                result = eStructuralFeature;↵

26

                result = eStructuralFeature;↵

27

                  }

27

              }

See real code fragment |  | See real code fragment

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 10
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 11.0
   Clone type | Type 1

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   23

       String featureNamespace = getNamespace(eStructuralFeature);

   7

       String featureNamespace = getNamespace(eStructuralFeature);

   24

       if (namespace == null)

   8

       if (namespace == null)

   25

       if (featureNamespace == null)

   9

       if (featureNamespace == null)

   26

       return eStructuralFeature;

   10

       return eStructuralFeature;

   27

       else if (result == null)

   11

       else if (result == null)

   28

       result = eStructuralFeature;

   12

       result = eStructuralFeature;

   29

       else if (namespace.equals(featureNamespace))

   13

       else if (namespace.equals(featureNamespace))

   30

       return eStructuralFeature;

   14

       return eStructuralFeature;

   31

       else if (featureNamespace == null && result == null)

   15

       else if (featureNamespace == null && result == null)

   32

       result = eStructuralFeature;

   16

       result = eStructuralFeature;

   Precondition Violations (0)
   Row | Violation
   --- | ---