reset(); result = prepareDropLinkOn(); if (result) { operation = DROP_LINK; }
reset(); result = prepareDropCopyOn(); if (result) { operation = DROP_COPY; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/DragAndDropCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/DragAndDropCommand.java
Method name: boolean prepareDropOn() Method name: boolean prepareDropOn()
Number of AST nodes: 4 Number of AST nodes: 4
1
reset();
1
reset();
2
      result = prepareDropLinkOn();
2
      result = prepareDropCopyOn();
3
      if (result)
3
      if (result)
4
      {
4
      {
5
        operation = DROP_LINK;
5
        operation = DROP_COPY;
6
      }
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.4
Clones locationClones are in the same method
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)13.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    19
    reset();
    14
    reset();
    20
    result = prepareDropLinkOn();
    20
    result = prepareDropLinkOn();
    15
    result = prepareDropCopyOn();
    Differences
    Expression1Expression2Difference
    prepareDropLinkOnprepareDropCopyOnMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression prepareDropLinkOn() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression prepareDropCopyOn() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15
    result = prepareDropCopyOn();
    21
    if (result)
    16
    if (result)
    22
    operation = DROP_LINK;
    22
    operation = DROP_LINK;
    17
    operation = DROP_COPY;
    Differences
    Expression1Expression2Difference
    DROP_LINKDROP_COPYVARIABLE_NAME_MISMATCH
    17
    operation = DROP_COPY;
    Precondition Violations (2)
    Row Violation
    1Expression prepareDropLinkOn() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression prepareDropCopyOn() cannot be parameterized, because it has dependencies to/from statements that will be extracted