if (fileExtension.equals(extension)) { return true; }
if (!mappedObjects.contains(mappedObject)) { mappedObjects.add(mappedObject); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/RootXMLContentHandlerImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/presentation/MappingEditor.java
Method name: boolean canHandle(URI) Method name: boolean hasDropDownEditor(Object, int)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (fileExtension.equals(extension))
1
if (
2
!mappedObjects.contains(mappedObject))
2
          {
3
                  {
3
            return true;
4
            
5
        mappedObjects.add(mappedObject);
4
          }
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 in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)731.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    if (fileExtension.equals(extension))
    6
    if (fileExtension.equals(extension))
    16
    if (!mappedObjects.contains(mappedObject))
    Differences
    Expression1Expression2Difference
    fileExtension.equals(extension)!mappedObjects.contains(mappedObject)TYPE_COMPATIBLE_REPLACEMENT
    16
    if (!mappedObjects.contains(mappedObject))
    7
    return true;
    7
    return true;
    Preondition Violations
    Unmatched return true;
                                  
                                                                            
    17
    mappedObjects.add(mappedObject);
    Preondition Violations
    Unmatched statement mappedObjects.add(mappedObject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    17
    mappedObjects.add(mappedObject);
    Precondition Violations (2)
    Row Violation
    1Unmatched return true;
    2Unmatched statement mappedObjects.add(mappedObject); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted