if (hasInverse())
{
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();
}
if (hasInverse())
{
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, Collection extends E>)
|
|
Method name: boolean addAllUnique(int, Object[], int, int)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (hasInverse())↵ | | 1 | if (hasInverse())↵
|
2 | {↵ | | 2 | {↵
|
3 | NotificationChain notifications = createNotificationChain(collectionSize);↵ | | 3 | NotificationChain notifications = createNotificationChain(collectionSize);↵
|
4 | int lastIndex = index + collectionSize;↵ | | 4 | int lastIndex = index + collectionSize;↵
|
5 | for (int i = index; i < lastIndex; ++i)↵ | | 5 | for (int i = index; i < lastIndex; ++i)↵
|
6 | { ↵ | | 6 | { ↵
|
7 | notifications = inverseAdd(delegateGet(i), notifications);↵ | | 7 | notifications = inverseAdd(delegateGet(i), notifications);↵
|
8 | }↵ | | 8 | }↵
|
9 | if (notifications != null) notifications.dispatch();↵ | | 9 | if (notifications != null) notifications.dispatch();↵
|
10 | } | | 10 | }
|
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.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 50 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
21 | if (hasInverse()) | | 29 | if (hasInverse()) |
22 | NotificationChain notifications = createNotificationChain(collectionSize); | | 30 | NotificationChain notifications = createNotificationChain(collectionSize); |
23 | int lastIndex = index + collectionSize; | | 31 | int lastIndex = index + collectionSize; |
24 | for (int i = index; i < lastIndex; ++i) | | 32 | for (int i = index; i < lastIndex; ++i) |
25 | notifications = inverseAdd(delegateGet(i), notifications); | | 33 | notifications = inverseAdd(delegateGet(i), notifications); |
26 | if (notifications != null) | | 34 | if (notifications != null) |
27 | notifications.dispatch(); | | 35 | notifications.dispatch(); |
Precondition Violations (0)
Row |
Violation |