12001-1-2

int c = this.chardata; boolean end = false; if (type == T_BACKSOLIDUS) { 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(); }
int c = this.chardata; boolean end = false; if (type == T_BACKSOLIDUS) { 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: 31 |  | Number of AST nodes: 31

1

    int c = this.chardata;↵

1

    int c = this.chardata;↵

2

            boolean end = false;↵

2

                  boolean end = false;↵

3

            if (type == T_BACKSOLIDUS)↵

3

                  if (type == T_BACKSOLIDUS) {↵

4

            {↵

4

            ↵

5

              switch (c)↵

5

              switch (c) {↵

6

              {↵

6

            ↵

7

                case 'd':↵

7

                case 'd':↵

8

                case 'D':↵

8

      case 'D':↵

9

                case 'w':↵

9

                        case 'w':↵

10

                case 'W':↵

10

      case 'W':↵

11

                case 's':↵

11

                        case 's':↵

12

                case 'S':↵

12

      case 'S':↵

13

                  tok.mergeRanges(this.getTokenForShorthand(c));↵

13

                          tok.mergeRanges(this.getTokenForShorthand(c));↵

14

                  end = true;↵

14

                          end = true;↵

15

                  break;↵

15

                          break;↵

16

                case 'i':↵

16

                        case 'i':↵

17

                case 'I':↵

17

      case 'I':↵

18

                case 'c':↵

18

                        case 'c':↵

19

                case 'C':↵

19

      case 'C':↵

20

                  c = this.processCIinCharacterClass(tok, c);↵

20

                          c = this.processCIinCharacterClass(tok, c);↵

21

                  if (c < 0)↵

21

                          if (c < 0)↵

22

      end = true;↵

22

                    end = true;↵

23

                          break;↵

23

                  break;↵

24

                  ↵

25

            ↵

24

                case 'p':↵

26

                        case 'p':↵

25

                case 'P':↵

27

                        case 'P':↵

26

                  int pstart = this.offset;↵

28

                          int pstart = this.offset;↵

27

                  RangeToken tok2 = this.processBacksolidus_pP(c);↵

29

                          RangeToken tok2 = this.processBacksolidus_pP(c);↵

28

                  if (tok2 == null)↵

30

                          if (tok2 == null)↵

29

                    throw this.ex("parser.atom.5", pstart);↵

31

      throw this.ex("parser.atom.5", pstart);↵

30

                  tok.mergeRanges(tok2);↵

32

                          tok.mergeRanges(tok2);↵

31

                  end = true;↵

33

                          end = true;↵

32

                  break;↵

34

                          break;↵

33

                default:↵

35

                        default:↵

34

                  c = this.decodeEscaped();↵

36

                          c = this.decodeEscaped();↵

35

              }

37

                      }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4
Clones location | Clones are in the same java file
Number of node comparisons | 341

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 29
   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) | 44.5
   Clone type | Type 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
   --- | ---
   1 | Clone fragment #1 returns variables end, c , while Clone fragment #2 returns variables end, c