NotificationChain notifications = createNotificationChain(collectionSize);
int lastIndex = index + collectionSize;
for (int i = index; i < lastIndex; ++i)
{
notifications = inverseAdd(delegateGet(i), notifications);
}
if (notifications != null) notifications.dispatch();
NotificationChain notifications = createNotificationChain(collectionSize);
int lastIndex = index + collectionSize;
for (int i = index; i < lastIndex; ++i)
{
notifications = inverseAdd(delegateGet(i), notifications);
}
if (notifications != null) notifications.dispatch();
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/DelegatingNotifyingListImpl.java
|
Method name: boolean addAllUnique(int, Object[], int, int)
|
|
Method name: boolean addAllUnique(int, Collection extends E>)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | NotificationChain notifications = createNotificationChain(collectionSize);↵ | | 1 | NotificationChain notifications = createNotificationChain(collectionSize);↵
|
2 | int lastIndex = index + collectionSize;↵ | | 2 | int lastIndex = index + collectionSize;↵
|
3 | for (int i = index; i < lastIndex; ++i)↵ | | 3 | for (int i = index; i < lastIndex; ++i)↵
|
4 | { ↵ | | 4 | { ↵
|
5 | notifications = inverseAdd(delegateGet(i), notifications);↵ | | 5 | notifications = inverseAdd(delegateGet(i), notifications);↵
|
6 | }↵ | | 6 | }↵
|
7 | if (notifications != null) notifications.dispatch(); | | 7 | if (notifications != null) notifications.dispatch();
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 18 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
30 | NotificationChain notifications = createNotificationChain(collectionSize); | | 22 | NotificationChain notifications = createNotificationChain(collectionSize); |
31 | int lastIndex = index + collectionSize; | | 23 | int lastIndex = index + collectionSize; |
32 | for (int i = index; i < lastIndex; ++i) | | 24 | for (int i = index; i < lastIndex; ++i) |
33 | notifications = inverseAdd(delegateGet(i), notifications); | | 25 | notifications = inverseAdd(delegateGet(i), notifications); |
34 | if (notifications != null) | | 26 | if (notifications != null) |
35 | notifications.dispatch(); | | 27 | notifications.dispatch(); |
Precondition Violations (0)
Row |
Violation |