11389-1-3

case '\n': { outputPos = replaceChars(outputPos, LF, inputLength); changed = true; break; } case '\r': { outputPos = replaceChars(outputPos, CR, inputLength); changed = true; break; } case '\t': { outputPos = replaceChars(outputPos, TAB, inputLength); changed = true; break;
case '&': { outputPos = replaceChars(outputPos, AMP, inputLength); changed = true; break; } case '<': { outputPos = replaceChars(outputPos, LESS, inputLength); changed = true; break; } case '"': { outputPos = replaceChars(outputPos, QUOTE, inputLength); changed = true; break;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java
Method name: `String convert(String)` |  | Method name: `String convert(String)`
Number of AST nodes: 12 |  | Number of AST nodes: 12

1

    case '\n':↵

1

    case '&':↵

2

              {↵

2

              {↵

3

                outputPos = replaceChars(outputPos, LF, inputLength);↵

3

                outputPos = replaceChars(outputPos, AMP, inputLength);↵

4

                changed = true;↵

4

                changed = true;↵

5

                break;↵

5

                break;↵

6

              }↵

6

              }↵

7

              case '\r':↵

7

              case '<':↵

8

              {↵

8

              {↵

9

                outputPos = replaceChars(outputPos, CR, inputLength);↵

9

                outputPos = replaceChars(outputPos, LESS, inputLength);↵

10

                changed = true;↵

10

                changed = true;↵

11

                break;↵

11

                break;↵

12

              }↵

12

              }↵

13

              case '\t':↵

13

              case '"':↵

14

              {↵

14

              {↵

15

                outputPos = replaceChars(outputPos, TAB, inputLength);↵

15

                outputPos = replaceChars(outputPos, QUOTE, inputLength);↵

16

                changed = true;↵

16

                changed = true;↵

17

                break;

17

                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 the same method
Number of node comparisons | 97

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
   --- | --- | --- | --- | ---

   55

       case '\n':

   55 | case '\n':
   51 | case '"':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   '\n' | '"' | LITERAL_VALUE_MISMATCH

   51

       case '"':

   56

       outputPos = replaceChars(outputPos, LF, inputLength);

   56 | outputPos = replaceChars(outputPos, LF, inputLength);
   52 | outputPos = replaceChars(outputPos, QUOTE, inputLength);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   LF | QUOTE | VARIABLE_NAME_MISMATCH

   52

       outputPos = replaceChars(outputPos, QUOTE, inputLength);

   57

       changed = true;

   53

       changed = true;

   58

       break;

   54

       break;

   59

       case '\r':

   59 | case '\r':
   47 | case '<':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   '\r' | '<' | LITERAL_VALUE_MISMATCH

   47

       case '<':

   60

       outputPos = replaceChars(outputPos, CR, inputLength);

   60 | outputPos = replaceChars(outputPos, CR, inputLength);
   48 | outputPos = replaceChars(outputPos, LESS, inputLength);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   CR | LESS | VARIABLE_NAME_MISMATCH

   48

       outputPos = replaceChars(outputPos, LESS, inputLength);

   61

       changed = true;

   49

       changed = true;

   62

       break;

   50

       break;

   63

       case '\t':

   63 | case '\t':
   43 | case '&':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   '\t' | '&' | LITERAL_VALUE_MISMATCH

   43

       case '&':

   64

       outputPos = replaceChars(outputPos, TAB, inputLength);

   64 | outputPos = replaceChars(outputPos, TAB, inputLength);
   44 | outputPos = replaceChars(outputPos, AMP, inputLength);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   TAB | AMP | VARIABLE_NAME_MISMATCH

   44

       outputPos = replaceChars(outputPos, AMP, inputLength);

   65

       changed = true;

   45

       changed = true;

   66

       break;

   46

       break;

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