for (Diagnostic child : diagnostic.getChildren()) { add(child); }
for (Diagnostic childDiagnostic : diagnostic.getChildren()) { createMarkers(childDiagnostic); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicDiagnostic.java File path: /emf-2.4.1/src/org/eclipse/emf/common/ui/MarkerHelper.java
Method name: void addAll(Diagnostic) Method name: void createMarkers(Diagnostic)
Number of AST nodes: 2 Number of AST nodes: 2
1
for (Diagnostic child : diagnostic.getChildren())
1
for (Diagnostic childDiagnostic : diagnostic.getChildren())
2
    {
2
      {
3
      add(child);
3
        createMarkers(childDiagnostic);
4
    }
4
      }
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.1
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (Diagnostic child : diagnostic.getChildren())
    1
    for (Diagnostic child : diagnostic.getChildren())
    4
    for (Diagnostic childDiagnostic : diagnostic.getChildren())
    Differences
    Expression1Expression2Difference
    childchildDiagnosticVARIABLE_NAME_MISMATCH
    4
    for (Diagnostic childDiagnostic : diagnostic.getChildren())
    2
    add(child);
    2
    add(child);
    5
    createMarkers(childDiagnostic);
    Differences
    Expression1Expression2Difference
    addcreateMarkersMETHOD_INVOCATION_NAME_MISMATCH
    childchildDiagnosticVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression add(child) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression createMarkers(childDiagnostic) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(child) is a void method call, and thus it cannot be parameterized
    Expression createMarkers(childDiagnostic) is a void method call, and thus it cannot be parameterized
    5
    createMarkers(childDiagnostic);
    Precondition Violations (4)
    Row Violation
    1Expression add(child) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression createMarkers(childDiagnostic) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression add(child) is a void method call, and thus it cannot be parameterized
    4Expression createMarkers(childDiagnostic) is a void method call, and thus it cannot be parameterized