for (Command command : commandList) { if (!command.canExecute()) { return false; } } return true;
for (Object object : collection) { if (!contains(feature, object)) { return false; } } return true;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/command/CompoundCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java
Method name: boolean prepare() Method name: boolean containsAll(EStructuralFeature, Collection)
Number of AST nodes: 4 Number of AST nodes: 4
1
for (Command command : commandList)
1
for (Object object : collection)
2
      {
2
    {
3
        if (!command.canExecute())
3
      if (!contains(feature, object))
4
        {
4
      
5
  
5
{
6
        return false;
6
        return false;
7
        }
7
      }
8
      }
8
    }
9
      return true;
9
    return true;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons5
  1. {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)548.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (!command.canExecute())
    4
    if (!command.canExecute())
    2
    if (!contains(feature, object))
    Differences
    Expression1Expression2Difference
    canExecutecontainsMETHOD_INVOCATION_NAME_MISMATCH
    command.canExecute()contains(feature,object)ARGUMENT_NUMBER_MISMATCH
    commandMISSING_METHOD_INVOCATION_EXPRESSION
    2
    if (!contains(feature, object))
    5
    return false;
    3
    return false;
    Precondition Violations (0)
    Row Violation