11391-1-2

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; } case '\n': { outputPos = replaceChars(outputPos, LF, 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; } case '\n': { outputPos = replaceChars(outputPos, LINE_FEED, 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 convertText(String)`
Number of AST nodes: 16 |  | Number of AST nodes: 16

1

    case '&':↵

1

    case '&':↵

2

              {↵

2

              {↵

3

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

3

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

4

                changed = true;↵

4

                changed = true;↵

5

                break;↵

5

                break;↵

6

              }↵

6

              }↵

7

              case '<':↵

7

              case '<':↵

8

              {↵

8

              {↵

9

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

9

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

10

                changed = true;↵

10

                changed = true;↵

11

                break;↵

11

                break;↵

12

              }↵

12

              }↵

13

              case '"':↵

13

              case '"':↵

14

              {↵

14

              {↵

15

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

15

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

16

                changed = true;↵

16

                changed = true;↵

17

                break;↵

17

                break;↵

18

              }↵

18

              }↵

19

              case '\n':↵

19

              case '\n':↵

20

              {↵

20

              {↵

21

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

21

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

22

                changed = true;↵

22

                changed = true;↵

23

                break;

23

                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 declared in the same class
Number of node comparisons | 161

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 16
   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
   --- | --- | --- | --- | ---

   43

       case '&':

   44

       case '&':

   44

       outputPos = replaceChars(outputPos, AMP, inputLength);

   45

       outputPos = replaceChars(outputPos, AMP, inputLength);

   45

       changed = true;

   46

       changed = true;

   46

       break;

   47

       break;

   47

       case '<':

   48

       case '<':

   48

       outputPos = replaceChars(outputPos, LESS, inputLength);

   49

       outputPos = replaceChars(outputPos, LESS, inputLength);

   49

       changed = true;

   50

       changed = true;

   50

       break;

   51

       break;

   51

       case '"':

   52

       case '"':

   52

       outputPos = replaceChars(outputPos, QUOTE, inputLength);

   53

       outputPos = replaceChars(outputPos, QUOTE, inputLength);

   53

       changed = true;

   54

       changed = true;

   54

       break;

   55

       break;

   55

       case '\n':

   56

       case '\n':

   56

       outputPos = replaceChars(outputPos, LF, inputLength);

   56 | outputPos = replaceChars(outputPos, LF, inputLength);
   57 | outputPos = replaceChars(outputPos, LINE_FEED, inputLength);

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

   57

       outputPos = replaceChars(outputPos, LINE_FEED, inputLength);

   57

       changed = true;

   58

       changed = true;

   58

       break;

   59

       break;

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