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, oldIsLoaded, isLoaded) { @Override public Object getNotifier() { return ResourceImpl.this; } @Override public int getFeatureID(Class<?> expectedClass) { return RESOURCE__IS_LOADED; } }; return 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: Notification setLoaded(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, oldIsLoaded, isLoaded)
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_LOADED;
13
          }
13
          }
14
        };
14
        };
15
      eNotify(notification);
15
      return 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 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, oldTimeStamp, timeStamp) {...};
    4
    Notification notification = new NotificationImpl(Notification.SET, oldTimeStamp, timeStamp) {...};
    4
    Notification notification = new NotificationImpl(Notification.SET, oldIsLoaded, isLoaded) {...};
    Differences
    Expression1Expression2Difference
    RESOURCE__TIME_STAMPRESOURCE__IS_LOADEDVARIABLE_NAME_MISMATCH
    oldTimeStampoldIsLoadedVARIABLE_NAME_MISMATCH
    longbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type long of variable oldTimeStamp does not match with type boolean of variable oldIsLoaded
    4
    Notification notification = new NotificationImpl(Notification.SET, oldIsLoaded, isLoaded) {...};
                                                  
    5
    return notification;
    5
    eNotify(notification);
                                                      
    Precondition Violations (1)
    Row Violation
    1Type long of variable oldTimeStamp does not match with type boolean of variable oldIsLoaded