Notification notification = new NotificationImpl(Notification.SET, oldURI, uri) { @Override public Object getNotifier() { return ResourceImpl.this; } @Override public int getFeatureID(Class<?> expectedClass) { return RESOURCE__URI; } }; eNotify(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: void setURI(URI) 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, oldURI, uri)
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__URI;
12
            return RESOURCE__IS_TRACKING_MODIFICATION;
13
          }
13
          }
14
        };
14
        };
15
      eNotify(notification);
15
      eNotify(notification);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
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. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    Notification notification = new NotificationImpl(Notification.SET, oldURI, uri) {...};
    4
    Notification notification = new NotificationImpl(Notification.SET, oldURI, uri) {...};
    14
    Notification notification = new NotificationImpl(Notification.SET, oldIsTrackingModification, isTrackingModification) {...};
    Differences
    Expression1Expression2Difference
    RESOURCE__URIRESOURCE__IS_TRACKING_MODIFICATIONVARIABLE_NAME_MISMATCH
    oldURIoldIsTrackingModificationVARIABLE_NAME_MISMATCH
    org.eclipse.emf.common.util.URIbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.util.URI of variable oldURI does not match with type boolean of variable oldIsTrackingModification
    14
    Notification notification = new NotificationImpl(Notification.SET, oldIsTrackingModification, isTrackingModification) {...};
    5
    eNotify(notification);
    15
    eNotify(notification);
    Precondition Violations (1)
    Row Violation
    1Type org.eclipse.emf.common.util.URI of variable oldURI does not match with type boolean of variable oldIsTrackingModification