11638-1-2

case 'd': return ParserForXMLSchema.getRange("xml:isDigit", true); case 'D': return ParserForXMLSchema.getRange("xml:isDigit", false); case 'w': return ParserForXMLSchema.getRange("xml:isWord", true); case 'W': return ParserForXMLSchema.getRange("xml:isWord", false); case 's': return ParserForXMLSchema.getRange("xml:isSpace", true); case 'S': return ParserForXMLSchema.getRange("xml:isSpace", false); case 'c': return ParserForXMLSchema.getRange("xml:isNameChar", true); case 'C': return ParserForXMLSchema.getRange("xml:isNameChar", false);
case 'w': return ParserForXMLSchema.getRange("xml:isWord", true); case 'W': return ParserForXMLSchema.getRange("xml:isWord", false); case 's': return ParserForXMLSchema.getRange("xml:isSpace", true); case 'S': return ParserForXMLSchema.getRange("xml:isSpace", false); case 'c': return ParserForXMLSchema.getRange("xml:isNameChar", true); case 'C': return ParserForXMLSchema.getRange("xml:isNameChar", false); case 'i': return ParserForXMLSchema.getRange("xml:isInitialNameChar", true); case 'I': return ParserForXMLSchema.getRange("xml:isInitialNameChar", false);

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java
Method name: `Token getTokenForShorthand(int)` |  | Method name: `Token getTokenForShorthand(int)`
Number of AST nodes: 16 |  | Number of AST nodes: 16

1

    case 'd':↵

2

              return ParserForXMLSchema.getRange("xml:isDigit", true);↵

3

            case 'D':↵

4

              return ParserForXMLSchema.getRange("xml:isDigit", false);↵

5

            case 'w':↵

1

    case 'w':↵

6

              return ParserForXMLSchema.getRange("xml:isWord", true);↵

2

              return ParserForXMLSchema.getRange("xml:isWord", true);↵

7

            case 'W':↵

3

            case 'W':↵

8

              return ParserForXMLSchema.getRange("xml:isWord", false);↵

4

              return ParserForXMLSchema.getRange("xml:isWord", false);↵

9

            case 's':↵

5

            case 's':↵

10

              return ParserForXMLSchema.getRange("xml:isSpace", true);↵

6

              return ParserForXMLSchema.getRange("xml:isSpace", true);↵

11

            case 'S':↵

7

            case 'S':↵

12

              return ParserForXMLSchema.getRange("xml:isSpace", false);↵

8

              return ParserForXMLSchema.getRange("xml:isSpace", false);↵

13

            case 'c':↵

9

            case 'c':↵

14

              return ParserForXMLSchema.getRange("xml:isNameChar", true);↵

10

              return ParserForXMLSchema.getRange("xml:isNameChar", true);↵

15

            case 'C':↵

11

            case 'C':↵

16

              return ParserForXMLSchema.getRange("xml:isNameChar", false);

12

              return ParserForXMLSchema.getRange("xml:isNameChar", false);↵

13

            case 'i':↵

14

              return ParserForXMLSchema.getRange("xml:isInitialNameChar", true);↵

15

            case 'I':↵

16

              return ParserForXMLSchema.getRange("xml:isInitialNameChar", false);

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

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

   2

       case 'd':

   2 | case 'd':
   6 | case 'w':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   'd' | 'w' | LITERAL_VALUE_MISMATCH

   6

       case 'w':

   3

       return ParserForXMLSchema.getRange("xml:isDigit", true);

   3 | return ParserForXMLSchema.getRange("xml:isDigit", true);
   7 | return ParserForXMLSchema.getRange("xml:isWord", true);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "xml:isDigit" | "xml:isWord" | LITERAL_VALUE_MISMATCH

   7

       return ParserForXMLSchema.getRange("xml:isWord", true);

   4

       case 'D':

   4 | case 'D':
   8 | case 'W':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   'D' | 'W' | LITERAL_VALUE_MISMATCH

   8

       case 'W':

   5

       return ParserForXMLSchema.getRange("xml:isDigit", false);

   5 | return ParserForXMLSchema.getRange("xml:isDigit", false);
   9 | return ParserForXMLSchema.getRange("xml:isWord", false);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "xml:isDigit" | "xml:isWord" | LITERAL_VALUE_MISMATCH

   9

       return ParserForXMLSchema.getRange("xml:isWord", false);

   6

       case 'w':

   6 | case 'w':
   10 | case 's':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   'w' | 's' | LITERAL_VALUE_MISMATCH

   10

       case 's':

   7

       return ParserForXMLSchema.getRange("xml:isWord", true);

   7 | return ParserForXMLSchema.getRange("xml:isWord", true);
   11 | return ParserForXMLSchema.getRange("xml:isSpace", true);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "xml:isWord" | "xml:isSpace" | LITERAL_VALUE_MISMATCH

   11

       return ParserForXMLSchema.getRange("xml:isSpace", true);

   8

       case 'W':

   8 | case 'W':
   12 | case 'S':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   'W' | 'S' | LITERAL_VALUE_MISMATCH

   12

       case 'S':

   9

       return ParserForXMLSchema.getRange("xml:isWord", false);

   9 | return ParserForXMLSchema.getRange("xml:isWord", false);
   13 | return ParserForXMLSchema.getRange("xml:isSpace", false);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "xml:isWord" | "xml:isSpace" | LITERAL_VALUE_MISMATCH

   13

       return ParserForXMLSchema.getRange("xml:isSpace", false);

   10

       case 's':

   10 | case 's':
   14 | case 'c':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   's' | 'c' | LITERAL_VALUE_MISMATCH

   14

       case 'c':

   11

       return ParserForXMLSchema.getRange("xml:isSpace", true);

   11 | return ParserForXMLSchema.getRange("xml:isSpace", true);
   15 | return ParserForXMLSchema.getRange("xml:isNameChar", true);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "xml:isSpace" | "xml:isNameChar" | LITERAL_VALUE_MISMATCH

   15

       return ParserForXMLSchema.getRange("xml:isNameChar", true);

   12

       case 'S':

   12 | case 'S':
   16 | case 'C':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   'S' | 'C' | LITERAL_VALUE_MISMATCH

   16

       case 'C':

   13

       return ParserForXMLSchema.getRange("xml:isSpace", false);

   13 | return ParserForXMLSchema.getRange("xml:isSpace", false);
   17 | return ParserForXMLSchema.getRange("xml:isNameChar", false);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "xml:isSpace" | "xml:isNameChar" | LITERAL_VALUE_MISMATCH

   17

       return ParserForXMLSchema.getRange("xml:isNameChar", false);

   14

       case 'c':

   14 | case 'c':
   18 | case 'i':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   'c' | 'i' | LITERAL_VALUE_MISMATCH

   18

       case 'i':

   15

       return ParserForXMLSchema.getRange("xml:isNameChar", true);

   15 | return ParserForXMLSchema.getRange("xml:isNameChar", true);
   19 | return ParserForXMLSchema.getRange("xml:isInitialNameChar", true);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "xml:isNameChar" | "xml:isInitialNameChar" | LITERAL_VALUE_MISMATCH

   19

       return ParserForXMLSchema.getRange("xml:isInitialNameChar", true);

   16

       case 'C':

   16 | case 'C':
   20 | case 'I':

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   'C' | 'I' | LITERAL_VALUE_MISMATCH

   20

       case 'I':

   17

       return ParserForXMLSchema.getRange("xml:isNameChar", false);

   17 | return ParserForXMLSchema.getRange("xml:isNameChar", false);
   21 | return ParserForXMLSchema.getRange("xml:isInitialNameChar", false);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "xml:isNameChar" | "xml:isInitialNameChar" | LITERAL_VALUE_MISMATCH

   21

       return ParserForXMLSchema.getRange("xml:isInitialNameChar", false);

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