MappedObjectState mappedObjectState = getMappedObjectState(input); if (mappedObjectState != null) { mappedObjectState.getMappings().remove(mapping); }
MappedObjectState mappedObjectState = getMappedObjectState(output); if (mappedObjectState != null) { mappedObjectState.getMappings().add(mapping); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/impl/MappingRootImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/impl/MappingRootImpl.java
Method name: void deregister(Mapping) Method name: void refreshMappedObjectStates(Mapping)
Number of AST nodes: 3 Number of AST nodes: 3
1
MappedObjectState mappedObjectState = getMappedObjectState(input);
1
MappedObjectState mappedObjectState = getMappedObjectState(output);
2
      if (mappedObjectState != null)
2
        if (mappedObjectState != null)
3
      {
3
      
4
  {
4
        mappedObjectState.getMappings().remove(mapping);
5
          mappedObjectState.getMappings().add(mapping);
5
      }
6
        }
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.2
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)43.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    MappedObjectState mappedObjectState = getMappedObjectState(input);
    2
    MappedObjectState mappedObjectState = getMappedObjectState(input);
    19
    MappedObjectState mappedObjectState = getMappedObjectState(output);
    Differences
    Expression1Expression2Difference
    inputoutputVARIABLE_NAME_MISMATCH
    19
    MappedObjectState mappedObjectState = getMappedObjectState(output);
    3
    if (mappedObjectState != null)
    20
    if (mappedObjectState != null)
    4
    mappedObjectState.getMappings().remove(mapping);
    4
    mappedObjectState.getMappings().remove(mapping);
    21
    mappedObjectState.getMappings().add(mapping);
    Differences
    Expression1Expression2Difference
    removeaddMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression mappedObjectState.getMappings().remove(mapping) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mappedObjectState.getMappings().add(mapping) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21
    mappedObjectState.getMappings().add(mapping);
    Precondition Violations (2)
    Row Violation
    1Expression mappedObjectState.getMappings().remove(mapping) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression mappedObjectState.getMappings().add(mapping) cannot be parameterized, because it has dependencies to/from statements that will be extracted