ownerList.remove(value); // Insert the collection at the right place. // ownerList.addAll(index, collection); // Update the containing map, if necessary. // updateEMap(owner, feature); // We'd like the collection of replacements selected after this replace completes. // affectedObjects = collection;
ownerList.remove(value); // Insert the collection at the right place. // ownerList.addAll(index, collection); // Update the containing map, if necessary. // updateEMap(owner, feature); // We'd like the collection of replacements selected after this replace completes. // affectedObjects = collection;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/ReplaceCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/ReplaceCommand.java
Method name: void doExecute() Method name: void doRedo()
Number of AST nodes: 4 Number of AST nodes: 4
1
ownerList.remove(value);
1
ownerList.remove(value);
2
    // Insert the collection at the right place.
2
    // Insert the collection at the right place.
3
    //
3
    //
4
    ownerList.addAll(index, collection);
4
    ownerList.addAll(index, collection);
5
  
5
  
6
    // Update the containing map, if necessary.
6
    // Update the containing map, if necessary.
7
    //
7
    //
8
    updateEMap(owner, feature);
8
    updateEMap(owner, feature);
9
    // We'd like the collection of replacements selected after this replace completes.
9
    // We'd like the collection of replacements selected after this replace completes.
10
    //
10
    //
11
    affectedObjects = collection;
11
    affectedObjects = collection;
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.0
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    ownerList.remove(value);
    1
    ownerList.remove(value);
    3
    ownerList.addAll(index, collection);
    3
    ownerList.addAll(index, collection);
    2
    ownerList.addAll(index, collection);
    Differences
    Expression1Expression2Difference
    java.util.Collection<>java.util.Collection<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection
    • Make classes java.util.Collection<> and java.util.Collection<> extend a common superclass
    2
    ownerList.addAll(index, collection);
    4
    updateEMap(owner, feature);
    3
    updateEMap(owner, feature);
                                                                
    4
    affectedObjects = collection;
    5
    affectedObjects = collection;
                                                                
    Precondition Violations (1)
    Row Violation
    1Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection