NotificationChain notifications = inverseAdd(object, null);
if (hasShadow())
{
notifications = shadowAdd(object, notifications);
}
if (notifications == null)
{
dispatchNotification(notification);
}
else
{
notifications.add(notification);
notifications.dispatch();
}
NotificationChain notifications = inverseAdd(object, null);
if (hasShadow())
{
notifications = shadowAdd(object, notifications);
}
if (notifications == null)
{
dispatchNotification(notification);
}
else
{
notifications.add(notification);
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/NotifyingListImpl.java
|
Method name: void addUnique(int, E)
|
|
Method name: void addUnique(int, E)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | NotificationChain notifications = inverseAdd(object, null);↵ | | 1 | NotificationChain notifications = inverseAdd(object, null);↵
|
2 | if (hasShadow())↵ | | 2 | if (hasShadow())↵
|
3 | {↵ | | 3 | {↵
|
4 | notifications = shadowAdd(object, notifications);↵ | | 4 | notifications = shadowAdd(object, notifications);↵
|
5 | }↵ | | 5 | }↵
|
6 | if (notifications == null)↵ | | 6 | if (notifications == null)↵
|
7 | {↵ | | 7 | {↵
|
8 | dispatchNotification(notification);↵ | | 8 | dispatchNotification(notification);↵
|
9 | }↵ | | 9 | }↵
|
10 | else↵ | | 10 | else↵
|
11 | {↵ | | 11 | {↵
|
12 | notifications.add(notification);↵ | | 12 | notifications.add(notification);↵
|
13 | notifications.dispatch();↵ | | 13 | notifications.dispatch();↵
|
14 | } | | 14 | }
|
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 in different classes having the same super class |
Number of node comparisons | 31 |
-
{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) | 1.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | NotificationChain notifications = inverseAdd(object, null); | | 6 | NotificationChain notifications = inverseAdd(object, null); |
7 | if (hasShadow()) | | 7 | if (hasShadow()) |
8 | notifications = shadowAdd(object, notifications); | | 8 | notifications = shadowAdd(object, notifications); |
9 | if (notifications == null) | | 9 | if (notifications == null) |
10 | dispatchNotification(notification); | | 10 | dispatchNotification(notification); |
| | | | |
11 | notifications.add(notification); | | 11 | notifications.add(notification); |
12 | notifications.dispatch(); | | 12 | notifications.dispatch(); |
Precondition Violations (0)
Row |
Violation |