Notification notification = new NotificationImpl(Notification.SET, oldIsLoaded, isLoaded) { @Override public Object getNotifier() { return ResourceImpl.this; } @Override public int getFeatureID(Class<?> expectedClass) { return RESOURCE__IS_LOADED; } }; return notification;
Notification notification = new NotificationImpl(Notification.SET, oldIsTrackingModification, isTrackingModification) { @Override public Object getNotifier() { return ResourceImpl.this; } @Override public int getFeatureID(Class<?> expectedClass) { return RESOURCE__IS_TRACKING_MODIFICATION; } }; eNotify(notification);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java
Method name: Notification setLoaded(boolean) Method name: void setTrackingModification(boolean)
Number of AST nodes: 2 Number of AST nodes: 2
1
Notification notification =
1
Notification notification =
2
        new NotificationImpl(Notification.SET, oldIsLoaded, isLoaded)
2
        new NotificationImpl(Notification.SET, oldIsTrackingModification, isTrackingModification)
3
        {
3
        {
4
          @Override
4
          @Override
5
          public Object getNotifier()
5
          public Object getNotifier()
6
          {
6
          {
7
            return ResourceImpl.this;
7
            return ResourceImpl.this;
8
          }
8
          }
9
          @Override
9
          @Override
10
          public int getFeatureID(Class<?> expectedClass)
10
          public int getFeatureID(Class<?> expectedClass)
11
          {
11
          {
12
            return RESOURCE__IS_LOADED;
12
            return RESOURCE__IS_TRACKING_MODIFICATION;
13
          }
13
          }
14
        };
14
        };
15
      return notification;
15
      eNotify(notification);
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.0
Clones locationClones are declared in the same class
Number of node comparisons4
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    Notification notification = new NotificationImpl(Notification.SET, oldIsLoaded, isLoaded) {...};
    4
    Notification notification = new NotificationImpl(Notification.SET, oldIsLoaded, isLoaded) {...};
    14
    Notification notification = new NotificationImpl(Notification.SET, oldIsTrackingModification, isTrackingModification) {...};
    Differences
    Expression1Expression2Difference
    RESOURCE__IS_LOADEDRESOURCE__IS_TRACKING_MODIFICATIONVARIABLE_NAME_MISMATCH
    oldIsLoadedoldIsTrackingModificationVARIABLE_NAME_MISMATCH
    isLoadedisTrackingModificationVARIABLE_NAME_MISMATCH
    14
    Notification notification = new NotificationImpl(Notification.SET, oldIsTrackingModification, isTrackingModification) {...};
    5
    return notification;
                                                  
                                                        
    15
    eNotify(notification);
    Precondition Violations (0)
    Row Violation