11609-1-4

case Notification.SET: { result.append("SET"); break; } case Notification.UNSET: { result.append("UNSET"); break; } case Notification.ADD: { result.append("ADD"); break; } case Notification.ADD_MANY: { result.append("ADD_MANY"); break;
case OK: { result.append("OK"); break; } case INFO: { result.append("INFO"); break; } case WARNING: { result.append("WARNING"); break; } case ERROR: { result.append("ERROR"); break;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/notify/impl/NotificationImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicDiagnostic.java
Method name: `String toString()` |  | Method name: `String toString()`
Number of AST nodes: 12 |  | Number of AST nodes: 12

1

    case Notification.SET:↵

1

    case OK: ↵

2

          {↵

2

          {↵

3

            result.append("SET");↵

3

            result.append("OK"); ↵

4

            break;↵

4

            break;↵

5

          }↵

5

          }↵

6

          case Notification.UNSET:↵

6

          case INFO: ↵

7

          {↵

7

          {↵

8

            result.append("UNSET");↵

8

            result.append("INFO"); ↵

9

            break;↵

9

            break;↵

10

          }↵

10

          }↵

11

          case Notification.ADD:↵

11

          case WARNING: ↵

12

          {↵

12

          {↵

13

            result.append("ADD");↵

13

            result.append("WARNING"); ↵

14

            break;↵

14

            break;↵

15

          }↵

15

          }↵

16

          case Notification.ADD_MANY:↵

16

          case ERROR: ↵

17

          {↵

17

          {↵

18

            result.append("ADD_MANY");↵

18

            result.append("ERROR"); ↵

19

            break;

19

            break;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location | Clones are in different classes
Number of node comparisons | 90

1. {Refactorable}

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

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

   4

       case Notification.SET:

   4 | case Notification.SET:
   4 | case OK:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   Notification.SET | OK | TYPE_COMPATIBLE_REPLACEMENT

   4

       case OK:

   5

       result.append("SET");

   5 | result.append("SET");
   5 | result.append("OK");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "SET" | "OK" | LITERAL_VALUE_MISMATCH
   java.lang.StringBuffer | java.lang.StringBuilder | SUBCLASS_TYPE_MISMATCH

   5

       result.append("OK");

   6

       break;

   6

       break;

   7

       case Notification.UNSET:

   7 | case Notification.UNSET:
   7 | case INFO:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   Notification.UNSET | INFO | TYPE_COMPATIBLE_REPLACEMENT

   7

       case INFO:

   8

       result.append("UNSET");

   8 | result.append("UNSET");
   8 | result.append("INFO");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "UNSET" | "INFO" | LITERAL_VALUE_MISMATCH
   java.lang.StringBuffer | java.lang.StringBuilder | SUBCLASS_TYPE_MISMATCH

   8

       result.append("INFO");

   9

       break;

   9

       break;

   10

       case Notification.ADD:

   10 | case Notification.ADD:
   10 | case WARNING:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   Notification.ADD | WARNING | TYPE_COMPATIBLE_REPLACEMENT

   10

       case WARNING:

   11

       result.append("ADD");

   11 | result.append("ADD");
   11 | result.append("WARNING");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "ADD" | "WARNING" | LITERAL_VALUE_MISMATCH
   java.lang.StringBuffer | java.lang.StringBuilder | SUBCLASS_TYPE_MISMATCH

   11

       result.append("WARNING");

   12

       break;

   12

       break;

   13

       case Notification.ADD_MANY:

   13 | case Notification.ADD_MANY:
   13 | case ERROR:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   Notification.ADD_MANY | ERROR | TYPE_COMPATIBLE_REPLACEMENT

   13

       case ERROR:

   14

       result.append("ADD_MANY");

   14 | result.append("ADD_MANY");
   14 | result.append("ERROR");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "ADD_MANY" | "ERROR" | LITERAL_VALUE_MISMATCH
   java.lang.StringBuffer | java.lang.StringBuilder | SUBCLASS_TYPE_MISMATCH

   14

       result.append("ERROR");

   15

       break;

   15

       break;

   Precondition Violations (0)
   Row | Violation
   --- | ---