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;
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;
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: 12 Number of AST nodes: 12
1
if (useEncodedAttributeStyle)
1
if (useEncodedAttributeStyle)
2
            {
2
            {
3
              saveEObjectSingle(o, f);
3
              saveEObjectMany(o, f);
4
              continue LOOP;
4
              continue LOOP;
5
            }
5
            }
6
            else
6
            else
7
            {
7
            {
8
              switch (sameDocSingle(o, f))
8
              switch (sameDocMany(o, f))
9
              {
9
              {
10
                case SAME_DOC:
10
                case SAME_DOC:
11
                {
11
                {
12
                  saveIDRefSingle(o, f);
12
                  saveIDRefMany(o, f);
13
                  continue LOOP;
13
                  continue LOOP;
14
                }
14
                }
15
                case CROSS_DOC:
15
                case CROSS_DOC:
16
                {
16
                {
17
                  break;
17
                  break;
18
                }
18
                }
19
                default:
19
                default:
20
                {
20
                {
21
                  continue LOOP;
21
                  continue LOOP;
22
                }
22
                }
23
              }
23
              }
24
            }
24
            }
25
            break;
25
            break;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in the same method
Number of node comparisons45
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)787.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    50
    if (useEncodedAttributeStyle)
    67
    if (useEncodedAttributeStyle)
    51
    saveEObjectSingle(o, f);
    51
    saveEObjectSingle(o, f);
    68
    saveEObjectMany(o, f);
    Differences
    Expression1Expression2Difference
    saveEObjectSinglesaveEObjectManyMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression saveEObjectSingle(o,f) is a void method call, and thus it cannot be parameterized
    Expression saveEObjectMany(o,f) is a void method call, and thus it cannot be parameterized
    68
    saveEObjectMany(o, f);
    52
    continue LOOP;
    52
    continue LOOP;
    69
    continue LOOP;
    Preondition Violations
    Statement continue LOOP; without innermost loop
    Statement continue LOOP; without innermost loop
    69
    continue LOOP;
    else
    else
    53
    switch (sameDocSingle(o, f))
    53
    switch (sameDocSingle(o, f))
    70
    switch (sameDocMany(o, f))
    Differences
    Expression1Expression2Difference
    sameDocSinglesameDocManyMETHOD_INVOCATION_NAME_MISMATCH
    70
    switch (sameDocMany(o, f))
    54
    case SAME_DOC:
    71
    case SAME_DOC:
    55
    saveIDRefSingle(o, f);
    55
    saveIDRefSingle(o, f);
    72
    saveIDRefMany(o, f);
    Differences
    Expression1Expression2Difference
    saveIDRefSinglesaveIDRefManyMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression saveIDRefSingle(o,f) is a void method call, and thus it cannot be parameterized
    Expression saveIDRefMany(o,f) is a void method call, and thus it cannot be parameterized
    72
    saveIDRefMany(o, f);
    56
    continue LOOP;
    56
    continue LOOP;
    73
    continue LOOP;
    Preondition Violations
    Statement continue LOOP; without innermost loop
    Statement continue LOOP; without innermost loop
    73
    continue LOOP;
    57
    case CROSS_DOC:
    74
    case CROSS_DOC:
    58
    break;
    75
    break;
    59
    default:
    76
    default:
    60
    continue LOOP;
    60
    continue LOOP;
    77
    continue LOOP;
    Preondition Violations
    Statement continue LOOP; without innermost loop
    Statement continue LOOP; without innermost loop
    77
    continue LOOP;
    61
    break;
    78
    break;
    Precondition Violations (10)
    Row Violation
    1Expression saveEObjectSingle(o,f) is a void method call, and thus it cannot be parameterized
    2Expression saveEObjectMany(o,f) is a void method call, and thus it cannot be parameterized
    3Statement continue LOOP; without innermost loop
    4Statement continue LOOP; without innermost loop
    5Expression saveIDRefSingle(o,f) is a void method call, and thus it cannot be parameterized
    6Expression saveIDRefMany(o,f) is a void method call, and thus it cannot be parameterized
    7Statement continue LOOP; without innermost loop
    8Statement continue LOOP; without innermost loop
    9Statement continue LOOP; without innermost loop
    10Statement continue LOOP; without innermost loop