NotificationChain notifications = createNotificationChain(listSize); // Copy to a list and allocate positions. // BasicEList<Object> list = new BasicEList<Object>(collection); Object [] objects = list.data(); positions = new int [listSize]; int count = 0;
NotificationChain notifications = createNotificationChain(listSize); // Copy to a list and allocate positions. // BasicEList<Object> list = new BasicEList<Object>(collection); Object[] objects = list.data(); positions = new int [listSize]; int count = 0;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/DelegatingNotifyingListImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/NotifyingListImpl.java
Method name: boolean removeAll(Collection) Method name: boolean removeAll(Collection)
Number of AST nodes: 5 Number of AST nodes: 5
1
NotificationChain notifications = createNotificationChain(listSize);
1
NotificationChain notifications = createNotificationChain(listSize);
2
        // Copy to a list and allocate positions.
2
        // Copy to a list and allocate positions.
3
        //
3
        //
4
        BasicEList<Object> list = new BasicEList<Object>(collection);
4
        BasicEList<Object> list = new BasicEList<Object>(collection);
5
        Object [] objects = list.data();
5
        Object[] objects = list.data();
6
        positions = new int [listSize];
6
        positions = new int [listSize];
7
        int count = 0;
7
        int count = 0;
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 in different classes having the same super class
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    NotificationChain notifications = createNotificationChain(listSize);
    7
    NotificationChain notifications = createNotificationChain(listSize);
    8
    BasicEList<Object> list = new BasicEList<Object>(collection);
    8
    BasicEList<Object> list = new BasicEList<Object>(collection);
    8
    BasicEList<Object> list = new BasicEList<Object>(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
    8
    BasicEList<Object> list = new BasicEList<Object>(collection);
    9
    Object[] objects = list.data();
    9
    Object[] objects = list.data();
    10
    positions = new int[listSize];
    10
    positions = new int[listSize];
    11
    int count = 0;
    11
    int count = 0;
    Precondition Violations (2)
    Row Violation
    1Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection
    2Clone fragment #1 returns variables objects, count, positions, list, notifications , while Clone fragment #2 returns variables objects, count, positions, list, notifications