Notification notification = new NotificationImpl(Notification.SET, oldTimeStamp, timeStamp) { @Override public Object getNotifier() { return ResourceImpl.this; } @Override public int getFeatureID(Class<?> expectedClass) { return RESOURCE__TIME_STAMP; } }; eNotify(notification);
Notification notification = new NotificationImpl(Notification.SET, oldIsModified, isModified) { @Override public Object getNotifier() { return ResourceImpl.this; } @Override public int getFeatureID(Class<?> expectedClass) { return RESOURCE__IS_MODIFIED; } }; 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 setTimeStamp(long) Method name: void setModified(boolean)
Number of AST nodes: 2 Number of AST nodes: 2
1
Notification notification =
1
Notification notification =
2
        new NotificationImpl(Notification.SET, oldTimeStamp, timeStamp)
2
        new NotificationImpl(Notification.SET, oldIsModified, isModified)
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__TIME_STAMP;
12
            return RESOURCE__IS_MODIFIED;
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, oldTimeStamp, timeStamp) {...};
    4
    Notification notification = new NotificationImpl(Notification.SET, oldTimeStamp, timeStamp) {...};
    4
    Notification notification = new NotificationImpl(Notification.SET, oldIsModified, isModified) {...};
    Differences
    Expression1Expression2Difference
    RESOURCE__TIME_STAMPRESOURCE__IS_MODIFIEDVARIABLE_NAME_MISMATCH
    oldTimeStampoldIsModifiedVARIABLE_NAME_MISMATCH
    longbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type long of variable oldTimeStamp does not match with type boolean of variable oldIsModified
    4
    Notification notification = new NotificationImpl(Notification.SET, oldIsModified, isModified) {...};
    5
    eNotify(notification);
    5
    eNotify(notification);
    Precondition Violations (1)
    Row Violation
    1Type long of variable oldTimeStamp does not match with type boolean of variable oldIsModified