10912-1-4

case DATATYPE_ELEMENT_SINGLE: { saveDataTypeElementSingle(o, f); break; } case OBJECT_CONTAIN_SINGLE_UNSETTABLE: { if (isNil(o, f)) { saveNil(o, f); break; } // it's intentional to keep going } case OBJECT_CONTAIN_SINGLE: { saveContainedSingle(o, f); break; } case OBJECT_CONTAIN_MANY_UNSETTABLE:
case OBJECT_CONTAIN_MANY: { saveContainedMany(o, f); break; } case OBJECT_HREF_SINGLE_UNSETTABLE: { if (isNil(o, f)) { saveNil(o, f); break; } // it's intentional to keep going } case OBJECT_HREF_SINGLE: { saveHRefSingle(o, f); 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: 11 |  | Number of AST nodes: 11

1

    case DATATYPE_ELEMENT_SINGLE:↵

1

    case OBJECT_CONTAIN_MANY:↵

2

            {↵

2

            {↵

3

              saveDataTypeElementSingle(o, f);↵

3

              saveContainedMany(o, f);↵

4

              break;↵

4

              break;↵

5

            }↵

5

            }↵

6

            case OBJECT_CONTAIN_SINGLE_UNSETTABLE:↵

6

            case OBJECT_HREF_SINGLE_UNSETTABLE:↵

7

            {↵

7

            {↵

8

              if (isNil(o, f))↵

8

              if (isNil(o, f))↵

9

              {↵

9

              {↵

10

                saveNil(o, f);↵

10

                saveNil(o, f);↵

11

                break;↵

11

                break;↵

12

              }↵

12

              }↵

13

              // it's intentional to keep going↵

13

              // it's intentional to keep going↵

14

            }↵

14

            }↵

15

            case OBJECT_CONTAIN_SINGLE:↵

15

            case OBJECT_HREF_SINGLE:↵

16

            {↵

16

            {↵

17

              saveContainedSingle(o, f);↵

17

              saveHRefSingle(o, f);↵

18

              break;↵

18

              break;↵

19

            }↵

19

            }↵

20

            case OBJECT_CONTAIN_MANY_UNSETTABLE:

20

            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.1
Clones location | Clones are in the same method
Number of node comparisons | 56

1. {Non-refactorable}

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

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

   152

       case DATATYPE_ELEMENT_SINGLE:

   152 | case DATATYPE_ELEMENT_SINGLE:
   163 | case OBJECT_CONTAIN_MANY:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   DATATYPE_ELEMENT_SINGLE | OBJECT_CONTAIN_MANY | VARIABLE_NAME_MISMATCH

   163

       case OBJECT_CONTAIN_MANY:

   153

       saveDataTypeElementSingle(o, f);

   153 | saveDataTypeElementSingle(o, f);
   164 | saveContainedMany(o, f);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   saveDataTypeElementSingle | saveContainedMany | METHOD_INVOCATION_NAME_MISMATCH

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

   164

       saveContainedMany(o, f);

   154

       break;

   165

       break;

   155

       case OBJECT_CONTAIN_SINGLE_UNSETTABLE:

   155 | case OBJECT_CONTAIN_SINGLE_UNSETTABLE:
   166 | case OBJECT_HREF_SINGLE_UNSETTABLE:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   OBJECT_CONTAIN_SINGLE_UNSETTABLE | OBJECT_HREF_SINGLE_UNSETTABLE | VARIABLE_NAME_MISMATCH

   166

       case OBJECT_HREF_SINGLE_UNSETTABLE:

   156

       if (isNil(o, f))

   167

       if (isNil(o, f))

   157

       saveNil(o, f);

   168

       saveNil(o, f);

   158

       break;

   169

       break;

   159

       case OBJECT_CONTAIN_SINGLE:

   159 | case OBJECT_CONTAIN_SINGLE:
   170 | case OBJECT_HREF_SINGLE:

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

   170

       case OBJECT_HREF_SINGLE:

   160

       saveContainedSingle(o, f);

   160 | saveContainedSingle(o, f);
   171 | saveHRefSingle(o, f);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   saveContainedSingle | saveHRefSingle | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression saveContainedSingle(o,f) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression saveHRefSingle(o,f) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression saveContainedSingle(o,f) is a void method call, and thus it cannot be parameterized
   Expression saveHRefSingle(o,f) is a void method call, and thus it cannot be parameterized

   171

       saveHRefSingle(o, f);

   161

       break;

   172

       break;

   162

       case OBJECT_CONTAIN_MANY_UNSETTABLE:

   162 | case OBJECT_CONTAIN_MANY_UNSETTABLE:
   173 | case OBJECT_HREF_MANY_UNSETTABLE:

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

   173

       case OBJECT_HREF_MANY_UNSETTABLE:

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Expression saveDataTypeElementSingle(o,f) is a void method call, and thus it cannot be parameterized
   2 | Expression saveContainedMany(o,f) is a void method call, and thus it cannot be parameterized
   3 | Expression saveContainedSingle(o,f) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression saveHRefSingle(o,f) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression saveContainedSingle(o,f) is a void method call, and thus it cannot be parameterized
   6 | Expression saveHRefSingle(o,f) is a void method call, and thus it cannot be parameterized