for (int i = 0; i < VALUES_ARRAY.length; ++i) { ChangeKind result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null;
for (int i = 0; i < VALUES_ARRAY.length; ++i) { SpaceType result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/ChangeKind.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/namespace/SpaceType.java
Method name: ChangeKind get(String) Method name: SpaceType getByName(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
for (int i = 0; i < VALUES_ARRAY.length; ++i)
1
for (int i = 0; i < VALUES_ARRAY.length; ++i)
2
    {
2
    {
3
      ChangeKind result = VALUES_ARRAY[i];
3
      SpaceType result = VALUES_ARRAY[i];
4
      if (result.toString().equals(literal))
4
      if (result.getName().equals(name))
5
      {
5
      {
6
        return result;
6
        return result;
7
      }
7
      }
8
    }
8
    }
9
    return null;
9
    return null;
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 different classes having the same super class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < VALUES_ARRAY.length; ++i)
    1
    for (int i = 0; i < VALUES_ARRAY.length; ++i)
    2
    ChangeKind result = VALUES_ARRAY[i];
    2
    SpaceType result = VALUES_ARRAY[i];
    3
    if (result.toString().equals(literal))
    3
    if (result.toString().equals(literal))
    3
    if (result.getName().equals(name))
    Differences
    Expression1Expression2Difference
    literalnameVARIABLE_NAME_MISMATCH
    toStringgetNameMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression result.toString() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression result.getName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (result.getName().equals(name))
    4
    return result;
    4
    return result;
    5
    return null;
    5
    return null;
    Precondition Violations (2)
    Row Violation
    1Expression result.toString() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression result.getName() cannot be parameterized, because it has dependencies to/from statements that will be extracted