if (isNotificationRequired())
{
EStructuralFeature feature = oldObject.getEStructuralFeature();
Object oldValue = oldObject.getValue();
Object newValue = newObject.getValue();
NotificationImpl notification =
createNotification
(Notification.SET,
feature,
oldValue,
newValue,
feature.isMany() ? indexOf(feature, newValue) : Notification.NO_INDEX,
true);
if (notifications != null)
{
notifications.add(notification);
}
else
{
notifications = notification;
}
}
return notifications;
if (isNotificationRequired())
{
EStructuralFeature feature = oldObject.getEStructuralFeature();
Object oldValue = oldObject.getValue();
Object newValue = newObject.getValue();
NotificationImpl notification =
createNotification
(Notification.SET,
feature,
oldValue,
newValue,
feature.isMany() ? indexOf(feature, newValue) : Notification.NO_INDEX,
true);
if (notifications != null)
{
notifications.add(notification);
}
else
{
notifications = notification;
}
}
return notifications;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java
|
Method name: NotificationChain shadowSet(Entry, Entry, NotificationChain)
|
|
Method name: NotificationChain shadowSet(Entry, Entry, NotificationChain)
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | if (isNotificationRequired())↵ | | 1 | if (isNotificationRequired())↵
|
2 | {↵ | | 2 | {↵
|
3 | EStructuralFeature feature = oldObject.getEStructuralFeature();↵ | | 3 | EStructuralFeature feature = oldObject.getEStructuralFeature();↵
|
4 | Object oldValue = oldObject.getValue();↵ | | 4 | Object oldValue = oldObject.getValue();↵
|
5 | Object newValue = newObject.getValue();↵ | | 5 | Object newValue = newObject.getValue();↵
|
6 | NotificationImpl notification = ↵ | | 6 | NotificationImpl notification = ↵
|
7 | createNotification↵ | | 7 | createNotification↵
|
8 | (Notification.SET,↵ | | 8 | (Notification.SET,↵
|
9 | feature,↵ | | 9 | feature,↵
|
10 | oldValue,↵ | | 10 | oldValue,↵
|
11 | newValue,↵ | | 11 | newValue,↵
|
12 | feature.isMany() ? indexOf(feature, newValue) : Notification.NO_INDEX,↵ | | 12 | feature.isMany() ? indexOf(feature, newValue) : Notification.NO_INDEX,↵
|
13 | true);↵ | | 13 | true);↵
|
|
14 | if (notifications != null)↵ | | 14 | if (notifications != null)↵
|
15 | {↵ | | 15 | {↵
|
16 | notifications.add(notification);↵ | | 16 | notifications.add(notification);↵
|
17 | }↵ | | 17 | }↵
|
18 | else↵ | | 18 | else↵
|
19 | {↵ | | 19 | {↵
|
20 | notifications = notification;↵ | | 20 | notifications = notification;↵
|
21 | }↵ | | 21 | }↵
|
22 | }↵ | | 22 | }↵
|
23 | return notifications; | | 23 | return notifications;
|
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 | 35 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 9 |
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) | 2.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (isNotificationRequired()) | | 1 | if (isNotificationRequired()) |
2 | EStructuralFeature feature = oldObject.getEStructuralFeature(); | | 2 | EStructuralFeature feature = oldObject.getEStructuralFeature(); |
3 | Object oldValue = oldObject.getValue(); | | 3 | Object oldValue = oldObject.getValue(); |
4 | Object newValue = newObject.getValue(); | | 4 | Object newValue = newObject.getValue(); |
5 | NotificationImpl notification = createNotification(Notification.SET, feature, oldValue, newValue, feature.isMany() ? indexOf(feature, newValue) : Notification.NO_INDEX, true); | | 5 | NotificationImpl notification = createNotification(Notification.SET, feature, oldValue, newValue, feature.isMany() ? indexOf(feature, newValue) : Notification.NO_INDEX, true); |
6 | if (notifications != null) | | 6 | if (notifications != null) |
7 | notifications.add(notification); | | 7 | notifications.add(notification); |
| | | | |
8 | notifications = notification; | | 8 | notifications = notification; |
9 | return notifications; | | 9 | return notifications; |
Precondition Violations (0)
Row |
Violation |