Object adapter = object;
if (adapterFactory != null)
{
adapter = adapterFactory.adapt(object, IUpdateableItemParent.class);
}
if (adapter instanceof IUpdateableItemParent)
{
((IUpdateableItemParent)adapter).setParent(object, null);
}
return notifications;
Object adapter = object;
if (adapterFactory != null)
{
adapter = adapterFactory.adapt(object, IUpdateableItemParent.class);
}
if (adapter instanceof IUpdateableItemParent)
{
((IUpdateableItemParent)adapter).setParent(object, ItemProvider.this);
}
return notifications;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemProvider.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemProvider.java
|
Method name: NotificationChain inverseRemove(Object, NotificationChain)
|
|
Method name: NotificationChain inverseAdd(Object, NotificationChain)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | Object adapter = object;↵ | | 1 | Object adapter = object;↵
|
2 | if (adapterFactory != null)↵ | | 2 | if (adapterFactory != null)↵
|
3 | {↵ | | 3 | {↵
|
4 | adapter = adapterFactory.adapt(object, IUpdateableItemParent.class);↵ | | 4 | adapter = adapterFactory.adapt(object, IUpdateableItemParent.class);↵
|
5 | }↵ | | 5 | }↵
|
|
6 | if (adapter instanceof IUpdateableItemParent)↵ | | 6 | if (adapter instanceof IUpdateableItemParent)↵
|
7 | {↵ | | 7 | {↵
|
8 | ((IUpdateableItemParent)adapter).setParent(object, null);↵ | | 8 | ((IUpdateableItemParent)adapter).setParent(object, ItemProvider.this);↵
|
9 | }↵ | | 9 | }↵
|
|
10 | return notifications; | | 10 | 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 declared in the same class |
Number of node comparisons | 17 |
-
{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 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Object adapter = object; | | 1 | Object adapter = object; |
2 | if (adapterFactory != null) | | 2 | if (adapterFactory != null) |
3 | adapter = adapterFactory.adapt(object, IUpdateableItemParent.class); | | 3 | adapter = adapterFactory.adapt(object, IUpdateableItemParent.class); |
4 | if (adapter instanceof IUpdateableItemParent) | | 4 | if (adapter instanceof IUpdateableItemParent) |
5 | ((IUpdateableItemParent)adapter).setParent(object, null); | | 5 | ((IUpdateableItemParent)adapter).setParent(object, ItemProvider.this); |
6 | return notifications; | | 6 | return notifications; |
Precondition Violations (0)
Row |
Violation |