protected E resolve(E object) { return object; } /** * Removes each object of the collection from the list and returns whether any object was actually contained by the list; * it does no inverse updating, or notification. * @param collection the collection of objects to be removed. * @return whether any object was actually contained by the list. */ protected boolean doRemoveAll(Collection<?> collection) { return super.removeAll(collection); } /** * Removes the object from the list and returns the potentially updated notification chain; * it does no {@link #inverseRemove inverse} updating. * This implementation generates notifications as {@link #isNotificationRequired required}. * @param object the object to be removed. * @return the notification chain. * @see #isNotificationRequired * @see #hasInverse * @see #inverseRemove */ public NotificationChain basicRemove(Object object, NotificationChain notifications) { int index = indexOf(object); if (index != -1) { if (isNotificationRequired()) { boolean oldIsSet = isSet(); Object oldObject = doRemove(index); NotificationImpl notification = createNotification(Notification.REMOVE, oldObject, null, index, oldIsSet); if (notifications == null) { notifications = notification; } else { notifications.add(notification); } } else { doRemove(index); } } return notifications;
protected E resolve(E object) { return object; } /** * Removes each object of the collection from the list and returns whether any object was actually contained by the list; * it does no inverse updating, or notification. * @param collection the collection of objects to be removed. * @return whether any object was actually contained by the list. */ protected boolean doRemoveAll(Collection<?> collection) { return super.removeAll(collection); } /** * Removes the object from the list and returns the potentially updated notification chain; * it does no {@link #inverseRemove inverse} updating. * This implementation generates notifications as {@link #isNotificationRequired required}. * @param object the object to be removed. * @return the notification chain. * @see #isNotificationRequired * @see #hasInverse * @see #inverseRemove */ public NotificationChain basicRemove(Object object, NotificationChain notifications) { int index = indexOf(object); if (index != -1) { if (isNotificationRequired()) { boolean oldIsSet = isSet(); Object oldObject = doRemove(index); NotificationImpl notification = createNotification(Notification.REMOVE, oldObject, null, index, oldIsSet); if (notifications == null) { notifications = notification; } else { notifications.add(notification); } } else { doRemove(index); } } return notifications;
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
protected E resolve(E object)
1
protected E resolve(E object)
2
  {
2
  {
3
    return object;
3
    return object;
4
  }
4
  }
5
  /**
5
  /**
6
   * Removes each object of the collection from the list and returns whether any object was actually contained by the list;
6
   * Removes each object of the collection from the list and returns whether any object was actually contained by the list;
7
   * it does no inverse updating, or notification.
7
   * it does no inverse updating, or notification.
8
   * @param collection the collection of objects to be removed.
8
   * @param collection the collection of objects to be removed.
9
   * @return whether any object was actually contained by the list.
9
   * @return whether any object was actually contained by the list.
10
   */
10
   */
11
  protected boolean doRemoveAll(Collection<?> collection)
11
  protected boolean doRemoveAll(Collection<?> collection)
12
  {
12
  {
13
    return super.removeAll(collection);
13
    return super.removeAll(collection);
14
  }
14
  }
15
  /**
15
  /**
16
   * Removes the object from the list and returns the potentially updated notification chain;
16
   * Removes the object from the list and returns the potentially updated notification chain;
17
   * it does no {@link #inverseRemove inverse} updating.
17
   * it does no {@link #inverseRemove inverse} updating.
18
   * This implementation generates notifications as {@link #isNotificationRequired required}.
18
   * This implementation generates notifications as {@link #isNotificationRequired required}.
19
   * @param object the object to be removed.
19
   * @param object the object to be removed.
20
   * @return the notification chain.
20
   * @return the notification chain.
21
   * @see #isNotificationRequired
21
   * @see #isNotificationRequired
22
   * @see #hasInverse
22
   * @see #hasInverse
23
   * @see #inverseRemove
23
   * @see #inverseRemove
24
   */
24
   */
25
  public NotificationChain basicRemove(Object object, NotificationChain notifications)
25
  public NotificationChain basicRemove(Object object, NotificationChain notifications)
26
  {
26
  {
27
    int index = indexOf(object);
27
    int index = indexOf(object);
28
    if (index != -1)
28
    if (index != -1)
29
    {
29
    {
30
      if (isNotificationRequired())
30
      if (isNotificationRequired())
31
      {
31
      {
32
        boolean oldIsSet = isSet();
32
        boolean oldIsSet = isSet();
33
        Object oldObject = doRemove(index);
33
        Object oldObject = doRemove(index);
34
        NotificationImpl notification = createNotification(Notification.REMOVE, oldObject, null, index, oldIsSet);
34
        NotificationImpl notification = createNotification(Notification.REMOVE, oldObject, null, index, oldIsSet);
35
        if (notifications == null) 
35
        if (notifications == null) 
36
        {
36
        {
37
          notifications = notification;
37
          notifications = notification;
38
        }
38
        }
39
        else
39
        else
40
        {
40
        {
41
          notifications.add(notification);
41
          notifications.add(notification);
42
        }
42
        }
43
      }
43
      }
44
      else
44
      else
45
      {
45
      {
46
        doRemove(index);
46
        doRemove(index);
47
      }
47
      }
48
    }
48
    }
49
    return notifications;
49
    return notifications;
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0