1641-2-3

this.timeStamp = timeStamp; if (eNotificationRequired()) { 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); }
this.uri = uri; if (eNotificationRequired()) { 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); }

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 setURI(URI)`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    this.timeStamp = timeStamp;↵

1

    this.uri = uri;↵

2

        if (eNotificationRequired())↵

2

        if (eNotificationRequired())↵

3

        {↵

3

        {↵

4

          Notification notification =↵

4

          Notification notification =↵

5

            new NotificationImpl(Notification.SET, oldTimeStamp, timeStamp)↵

5

            new NotificationImpl(Notification.SET, oldURI, uri)↵

6

            {↵

6

            {↵

7

              @Override↵

7

              @Override↵

8

              public Object getNotifier()↵

8

              public Object getNotifier()↵

9

              {↵

9

              {↵

10

                return ResourceImpl.this;↵

10

                return ResourceImpl.this;↵

11

              }↵

11

              }↵

12

              @Override↵

12

              @Override↵

13

              public int getFeatureID(Class<?> expectedClass)↵

13

              public int getFeatureID(Class<?> expectedClass)↵

14

              {↵

14

              {↵

15

                return RESOURCE__TIME_STAMP;↵

15

                return RESOURCE__URI;↵

16

              }↵

16

              }↵

17

            };↵

17

            };↵

18

          eNotify(notification);↵

18

          eNotify(notification);↵

19

        }

19

        }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1
Clones location | Clones are declared in the same class
Number of node comparisons | 10

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 3
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 1.4
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   2

       this.uri = uri;

   2

       this.timeStamp = timeStamp;

   3

       if (eNotificationRequired())

   3

       if (eNotificationRequired())

   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, oldURI, uri) {...};

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   RESOURCE__TIME_STAMP | RESOURCE__URI | VARIABLE_NAME_MISMATCH
   oldTimeStamp | oldURI | VARIABLE_NAME_MISMATCH
   long | org.eclipse.emf.common.util.URI | VARIABLE_TYPE_MISMATCH

   Preondition Violations
   Type long of variable oldTimeStamp does not match with type org.eclipse.emf.common.util.URI of variable oldURI

   4

       Notification notification = new NotificationImpl(Notification.SET, oldURI, uri) {...};

   5

       eNotify(notification);

   5

       eNotify(notification);

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Type long of variable oldTimeStamp does not match with type org.eclipse.emf.common.util.URI of variable oldURI