switch (eventType)
{
case Notification.ADD:
{
return super.createNotification(eventType, oldObject, newObject, index, size > 1);
}
case Notification.ADD_MANY:
{
return super.createNotification(eventType, oldObject, newObject, index, size - ((List<?>)newObject).size() > 0);
}
default:
{
return super.createNotification(eventType, oldObject, newObject, index, true);
}
}
switch (eventType)
{
case Notification.ADD:
{
return super.createNotification(eventType, oldObject, newObject, index, size > 1);
}
case Notification.ADD_MANY:
{
return super.createNotification(eventType, oldObject, newObject, index, size - ((List<?>)newObject).size() > 0);
}
default:
{
return super.createNotification(eventType, oldObject, newObject, index, true);
}
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EOperationImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EClassImpl.java
|
Method name: NotificationImpl createNotification(int, Object, Object, int, boolean)
|
|
Method name: NotificationImpl createNotification(int, Object, Object, int, boolean)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | switch (eventType)↵ | | 1 | switch (eventType)↵
|
2 | {↵ | | 2 | {↵
|
3 | case Notification.ADD:↵ | | 3 | case Notification.ADD:↵
|
4 | {↵ | | 4 | {↵
|
5 | return super.createNotification(eventType, oldObject, newObject, index, size > 1);↵ | | 5 | return super.createNotification(eventType, oldObject, newObject, index, size > 1);↵
|
6 | }↵ | | 6 | }↵
|
7 | case Notification.ADD_MANY:↵ | | 7 | case Notification.ADD_MANY:↵
|
8 | {↵ | | 8 | {↵
|
9 | return super.createNotification(eventType, oldObject, newObject, index, size - ((List<?>)newObject).size() > 0);↵ | | 9 | return super.createNotification(eventType, oldObject, newObject, index, size - ((List<?>)newObject).size() > 0);↵
|
10 | }↵ | | 10 | }↵
|
11 | default:↵ | | 11 | default:↵
|
12 | {↵ | | 12 | {↵
|
13 | return super.createNotification(eventType, oldObject, newObject, index, true);↵ | | 13 | return super.createNotification(eventType, oldObject, newObject, index, true);↵
|
14 | }↵ | | 14 | }↵
|
15 | } | | 15 | }
|
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) | 1.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 25 |
-
{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.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | switch (eventType) | | 1 | switch (eventType) |
2 | | | 2 | |
3 | return super.createNotification(eventType, oldObject, newObject, index, size > 1); | | 3 | return super.createNotification(eventType, oldObject, newObject, index, size > 1); |
4 | case Notification.ADD_MANY: | | 4 | case Notification.ADD_MANY: |
5 | return super.createNotification(eventType, oldObject, newObject, index, size - ((List<?>)newObject).size() > 0); | | 5 | return super.createNotification(eventType, oldObject, newObject, index, size - ((List<?>)newObject).size() > 0); |
6 | | | 6 | |
7 | return super.createNotification(eventType, oldObject, newObject, index, true); | | 7 | return super.createNotification(eventType, oldObject, newObject, index, true); |
Precondition Violations (0)
Row |
Violation |