10281-1-2

case OBJECT_HREF_MANY: { if (useEncodedAttributeStyle) { saveEObjectMany(o, f); continue LOOP; } else { switch (sameDocMany(o, f)) { case SAME_DOC: { saveIDRefMany(o, f); continue LOOP; } case CROSS_DOC: { break; } default: { continue LOOP; } } } break; } case OBJECT_ELEMENT_SINGLE_UNSETTABLE:
case OBJECT_HREF_SINGLE: { if (useEncodedAttributeStyle) { saveEObjectSingle(o, f); continue LOOP; } else { switch (sameDocSingle(o, f)) { case SAME_DOC: { saveIDRefSingle(o, f); continue LOOP; } case CROSS_DOC: { break; } default: { continue LOOP; } } } break; } case OBJECT_HREF_MANY_UNSETTABLE:

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java
Method name: `boolean saveFeatures(EObject)` |  | Method name: `boolean saveFeatures(EObject)`
Number of AST nodes: 14 |  | Number of AST nodes: 14

1

    case OBJECT_HREF_MANY:↵

1

    case OBJECT_HREF_SINGLE:↵

2

              {↵

2

              {↵

3

                if (useEncodedAttributeStyle)↵

3

                if (useEncodedAttributeStyle)↵

4

                {↵

4

                {↵

5

                  saveEObjectMany(o, f);↵

5

                  saveEObjectSingle(o, f);↵

6

                  continue LOOP;↵

6

                  continue LOOP;↵

7

                }↵

7

                }↵

8

                else↵

8

                else↵

9

                {↵

9

                {↵

10

                  switch (sameDocMany(o, f))↵

10

                  switch (sameDocSingle(o, f))↵

11

                  {↵

11

                  {↵

12

                    case SAME_DOC:↵

12

                    case SAME_DOC:↵

13

                    {↵

13

                    {↵

14

                      saveIDRefMany(o, f);↵

14

                      saveIDRefSingle(o, f);↵

15

                      continue LOOP;↵

15

                      continue LOOP;↵

16

                    }↵

16

                    }↵

17

                    case CROSS_DOC:↵

17

                    case CROSS_DOC:↵

18

                    {↵

18

                    {↵

19

                      break;↵

19

                      break;↵

20

                    }↵

20

                    }↵

21

                    default:↵

21

                    default:↵

22

                    {↵

22

                    {↵

23

                      continue LOOP;↵

23

                      continue LOOP;↵

24

                    }↵

24

                    }↵

25

                  }↵

25

                  }↵

26

                }↵

26

                }↵

27

                break;↵

27

                break;↵

28

              }↵

28

              }↵

29

              case OBJECT_ELEMENT_SINGLE_UNSETTABLE:

29

              case OBJECT_HREF_MANY_UNSETTABLE:

See real code fragment |  | See real code fragment

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 14
   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) | 617.3
   Clone type | Type 2

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

   66

       case OBJECT_HREF_MANY:

   66 | case OBJECT_HREF_MANY:
   49 | case OBJECT_HREF_SINGLE:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   OBJECT_HREF_MANY | OBJECT_HREF_SINGLE | VARIABLE_NAME_MISMATCH

   49

       case OBJECT_HREF_SINGLE:

   67

       if (useEncodedAttributeStyle)

   50

       if (useEncodedAttributeStyle)

   68

       saveEObjectMany(o, f);

   68 | saveEObjectMany(o, f);
   51 | saveEObjectSingle(o, f);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   saveEObjectMany | saveEObjectSingle | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression saveEObjectMany(o,f) is a void method call, and thus it cannot be parameterized
   Expression saveEObjectSingle(o,f) is a void method call, and thus it cannot be parameterized

   51

       saveEObjectSingle(o, f);

   69

       continue LOOP;

   69 | continue LOOP;
   52 | continue LOOP;

   Preondition Violations
   Statement continue LOOP; without innermost loop
   Statement continue LOOP; without innermost loop

   52

       continue LOOP;

       else

       else

   70

       switch (sameDocMany(o, f))

   70 | switch (sameDocMany(o, f))
   53 | switch (sameDocSingle(o, f))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   sameDocMany | sameDocSingle | METHOD_INVOCATION_NAME_MISMATCH

   53

       switch (sameDocSingle(o, f))

   71

       case SAME_DOC:

   54

       case SAME_DOC:

   72

       saveIDRefMany(o, f);

   72 | saveIDRefMany(o, f);
   55 | saveIDRefSingle(o, f);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   saveIDRefMany | saveIDRefSingle | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression saveIDRefMany(o,f) is a void method call, and thus it cannot be parameterized
   Expression saveIDRefSingle(o,f) is a void method call, and thus it cannot be parameterized

   55

       saveIDRefSingle(o, f);

   73

       continue LOOP;

   73 | continue LOOP;
   56 | continue LOOP;

   Preondition Violations
   Statement continue LOOP; without innermost loop
   Statement continue LOOP; without innermost loop

   56

       continue LOOP;

   74

       case CROSS_DOC:

   57

       case CROSS_DOC:

   75

       break;

   58

       break;

   76

       default:

   59

       default:

   77

       continue LOOP;

   77 | continue LOOP;
   60 | continue LOOP;

   Preondition Violations
   Statement continue LOOP; without innermost loop
   Statement continue LOOP; without innermost loop

   60

       continue LOOP;

   78

       break;

   61

       break;

   79

       case OBJECT_ELEMENT_SINGLE_UNSETTABLE:

   79 | case OBJECT_ELEMENT_SINGLE_UNSETTABLE:
   62 | case OBJECT_HREF_MANY_UNSETTABLE:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   OBJECT_ELEMENT_SINGLE_UNSETTABLE | OBJECT_HREF_MANY_UNSETTABLE | VARIABLE_NAME_MISMATCH

   62

       case OBJECT_HREF_MANY_UNSETTABLE:

   Precondition Violations (10)
   Row | Violation
   --- | ---
   1 | Expression saveEObjectMany(o,f) is a void method call, and thus it cannot be parameterized
   2 | Expression saveEObjectSingle(o,f) is a void method call, and thus it cannot be parameterized
   3 | Statement continue LOOP; without innermost loop
   4 | Statement continue LOOP; without innermost loop
   5 | Expression saveIDRefMany(o,f) is a void method call, and thus it cannot be parameterized
   6 | Expression saveIDRefSingle(o,f) is a void method call, and thus it cannot be parameterized
   7 | Statement continue LOOP; without innermost loop
   8 | Statement continue LOOP; without innermost loop
   9 | Statement continue LOOP; without innermost loop
   10 | Statement continue LOOP; without innermost loop