switch (c) { case 'd': case 'D': case 'w': case 'W': case 's': case 'S': tok.mergeRanges(this.getTokenForShorthand(c)); end = true; break; case 'i': case 'I': case 'c': case 'C': c = this.processCIinCharacterClass(tok, c); if (c < 0) end = true; break; case 'p': case 'P': int pstart = this.offset; RangeToken tok2 = this.processBacksolidus_pP(c); if (tok2 == null) throw this.ex("parser.atom.5", pstart); tok.mergeRanges(tok2); end = true; break; default: c = this.decodeEscaped(); }
switch (c) { case 'd': case 'D': case 'w': case 'W': case 's': case 'S': tok.mergeRanges(this.getTokenForShorthand(c)); end = true; break; case 'i': case 'I': case 'c': case 'C': c = this.processCIinCharacterClass(tok, c); if (c < 0) end = true; break; case 'p': case 'P': int pstart = this.offset; RangeToken tok2 = this.processBacksolidus_pP(c); if (tok2 == null) throw this.ex("parser.atom.5", pstart); tok.mergeRanges(tok2); end = true; break; default: c = this.decodeEscaped(); }
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: RangeToken parseCharacterClass(boolean) Method name: RangeToken parseCharacterClass(boolean)
Number of AST nodes: 29 Number of AST nodes: 29
1
switch (c) {
1
switch (c)
2
        
2
          {
3
            case 'd':
3
            case 'd':
4
  case 'D':
4
            case 'D':
5
                    case 'w':
5
            case 'w':
6
  case 'W':
6
            case 'W':
7
                    case 's':
7
            case 's':
8
  case 'S':
8
            case 'S':
9
                      tok.mergeRanges(this.getTokenForShorthand(c));
9
              tok.mergeRanges(this.getTokenForShorthand(c));
10
                      end = true;
10
              end = true;
11
                      break;
11
              break;
12
                    case 'i':
12
            case 'i':
13
  case 'I':
13
            case 'I':
14
                    case 'c':
14
            case 'c':
15
  case 'C':
15
            case 'C':
16
                      c = this.processCIinCharacterClass(tok, c);
16
              c = this.processCIinCharacterClass(tok, c);
17
                      if (c < 0)  end = true;
17
              if (c < 0)
18
                      break;
18
                end = true;
19
                      
19
              break;
20
                    case 'p':
20
            case 'p':
21
                    case 'P':
21
            case 'P':
22
                      int pstart = this.offset;
22
              int pstart = this.offset;
23
                      RangeToken tok2 = this.processBacksolidus_pP(c);
23
              RangeToken tok2 = this.processBacksolidus_pP(c);
24
                      if (tok2 == null)
24
              if (tok2 == null)
25
  throw this.ex("parser.atom.5", pstart);
25
                throw this.ex("parser.atom.5", pstart);
26
                      tok.mergeRanges(tok2);
26
              tok.mergeRanges(tok2);
27
                      end = true;
27
              end = true;
28
                      break;
28
              break;
29
                    default:
29
            default:
30
                      c = this.decodeEscaped();
30
              c = this.decodeEscaped();
31
                  }
31
          }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in the same java file
Number of node comparisons341
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements29
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)52.0
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    22
    switch (c)
    22
    switch (c)
    23
    case 'd':
    23
    case 'd':
    24
    case 'D':
    24
    case 'D':
    25
    case 'w':
    25
    case 'w':
    26
    case 'W':
    26
    case 'W':
    27
    case 's':
    27
    case 's':
    28
    case 'S':
    28
    case 'S':
    29
    tok.mergeRanges(this.getTokenForShorthand(c));
    29
    tok.mergeRanges(this.getTokenForShorthand(c));
    30
    end = true;
    30
    end = true;
    31
    break;
    31
    break;
    32
    case 'i':
    32
    case 'i':
    33
    case 'I':
    33
    case 'I':
    34
    case 'c':
    34
    case 'c':
    35
    case 'C':
    35
    case 'C':
    36
    c = this.processCIinCharacterClass(tok, c);
    36
    c = this.processCIinCharacterClass(tok, c);
    37
    if (c < 0)
    37
    if (c < 0)
    38
    end = true;
    38
    end = true;
    39
    break;
    39
    break;
    40
    case 'p':
    40
    case 'p':
    41
    case 'P':
    41
    case 'P':
    42
    int pstart = this.offset;
    42
    int pstart = this.offset;
    43
    RangeToken tok2 = this.processBacksolidus_pP(c);
    43
    RangeToken tok2 = this.processBacksolidus_pP(c);
    44
    if (tok2 == null)
    44
    if (tok2 == null)
    45
    throw this.ex("parser.atom.5", pstart);
    45
    throw this.ex("parser.atom.5", pstart);
    46
    tok.mergeRanges(tok2);
    46
    tok.mergeRanges(tok2);
    47
    end = true;
    47
    end = true;
    48
    break;
    48
    break;
    49
    default:
    49
    default:
    50
    c = this.decodeEscaped();
    50
    c = this.decodeEscaped();
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables end, c , while Clone fragment #2 returns variables end, c