for (EObject eObject : node.getExtent()) { roseEcoreBuilder.setIDs(null, eObject); } // Process the children of the UnitTreeNode recursively. // for (UnitTreeNode subNode : node.getNodes()) { setIDs(subNode); }
for (EObject eObject : node.getExtent()) { roseEcoreBuilder.validate(eObject); } // Process the children of the UnitTreeNode recursively. // for (UnitTreeNode subNode : node.getNodes()) { validate(subNode); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/builder/RoseUtil.java File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/builder/RoseUtil.java
Method name: void setIDs(UnitTreeNode) Method name: void validate(UnitTreeNode)
Number of AST nodes: 4 Number of AST nodes: 4
1
for (EObject eObject : node.getExtent())
1
for (EObject eObject : node.getExtent())
2
    {
2
    {
3
      roseEcoreBuilder.setIDs(null, eObject);
3
      roseEcoreBuilder.validate(eObject);
4
    }
4
    }
5
    // Process the children of the UnitTreeNode recursively.
5
    // Process the children of the UnitTreeNode recursively.
6
    //
6
    //
7
    for (UnitTreeNode subNode : node.getNodes())
7
    for (UnitTreeNode subNode : node.getNodes())
8
    {
8
    {
9
      setIDs(subNode);
9
      validate(subNode);
10
    }
10
    }
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 declared in the same class
Number of node comparisons13
  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)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (EObject eObject : node.getExtent())
    1
    for (EObject eObject : node.getExtent())
    2
    roseEcoreBuilder.setIDs(null, eObject);
    2
    roseEcoreBuilder.setIDs(null, eObject);
    2
    roseEcoreBuilder.validate(eObject);
    Differences
    Expression1Expression2Difference
    setIDsvalidateMETHOD_INVOCATION_NAME_MISMATCH
    roseEcoreBuilder.setIDs(null,eObject)roseEcoreBuilder.validate(eObject)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression roseEcoreBuilder.setIDs(null,eObject) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression roseEcoreBuilder.validate(eObject) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression roseEcoreBuilder.setIDs(null,eObject) is a void method call, and thus it cannot be parameterized
    Expression roseEcoreBuilder.validate(eObject) is a void method call, and thus it cannot be parameterized
    Expression roseEcoreBuilder.setIDs(null,eObject) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression roseEcoreBuilder.validate(eObject) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression roseEcoreBuilder.setIDs(null,eObject) is a void method call, and thus it cannot be parameterized
    Expression roseEcoreBuilder.validate(eObject) is a void method call, and thus it cannot be parameterized
    2
    roseEcoreBuilder.validate(eObject);
    3
    for (UnitTreeNode subNode : node.getNodes())
    3
    for (UnitTreeNode subNode : node.getNodes())
    4
    setIDs(subNode);
    4
    setIDs(subNode);
    4
    validate(subNode);
    Differences
    Expression1Expression2Difference
    setIDsvalidateMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression setIDs(subNode) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression validate(subNode) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setIDs(subNode) is a void method call, and thus it cannot be parameterized
    Expression validate(subNode) is a void method call, and thus it cannot be parameterized
    4
    validate(subNode);
    Precondition Violations (12)
    Row Violation
    1Expression roseEcoreBuilder.setIDs(null,eObject) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression roseEcoreBuilder.validate(eObject) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression roseEcoreBuilder.setIDs(null,eObject) is a void method call, and thus it cannot be parameterized
    4Expression roseEcoreBuilder.validate(eObject) is a void method call, and thus it cannot be parameterized
    5Expression roseEcoreBuilder.setIDs(null,eObject) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression roseEcoreBuilder.validate(eObject) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression roseEcoreBuilder.setIDs(null,eObject) is a void method call, and thus it cannot be parameterized
    8Expression roseEcoreBuilder.validate(eObject) is a void method call, and thus it cannot be parameterized
    9Expression setIDs(subNode) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression validate(subNode) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression setIDs(subNode) is a void method call, and thus it cannot be parameterized
    12Expression validate(subNode) is a void method call, and thus it cannot be parameterized