Object adapter = object; if (adapterFactory != null) { adapter = adapterFactory.adapt(object, IUpdateableItemParent.class); } if (adapter instanceof IUpdateableItemParent) { ((IUpdateableItemParent)adapter).setParent(object, ItemProvider.this); } return notifications;
Object adapter = object; if (adapterFactory != null) { adapter = adapterFactory.adapt(object, IUpdateableItemParent.class); } if (adapter instanceof IUpdateableItemParent) { ((IUpdateableItemParent)adapter).setParent(object, null); } 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 inverseAdd(Object, NotificationChain) Method name: NotificationChain inverseRemove(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, ItemProvider.this);
8
        ((IUpdateableItemParent)adapter).setParent(object, null);
9
      }
9
      }
10
      return notifications;
10
      return notifications;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 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, ItemProvider.this);
    5
    ((IUpdateableItemParent)adapter).setParent(object, ItemProvider.this);
    5
    ((IUpdateableItemParent)adapter).setParent(object, null);
    Differences
    Expression1Expression2Difference
    ItemProvider.thisnullTYPE_COMPATIBLE_REPLACEMENT
    5
    ((IUpdateableItemParent)adapter).setParent(object, null);
    6
    return notifications;
    6
    return notifications;
    Precondition Violations (0)
    Row Violation