if (dx > 0) { if (offset >= con.limit) return -1; int ch = target .charAt( offset ) ; if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit) ch = REUtil.composeFromSurrogates(ch, target .charAt( ++offset ) ); RangeToken tok = op.getToken(); if (isSet(opts, IGNORE_CASE)) { tok = tok.getCaseInsensitiveToken(); if (!tok.match(ch)) { if (ch >= 0x10000) return -1; char uch; if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch))) return -1; } } else { if (!tok.match(ch)) return -1; } offset ++; } else { int o1 = offset-1; if (o1 >= con.limit || o1 < 0) return -1; int ch = target .charAt( o1 ) ; if (REUtil.isLowSurrogate(ch) && o1-1 >= 0) ch = REUtil.composeFromSurrogates( target .charAt( --o1 ) , ch); RangeToken tok = op.getToken(); if (isSet(opts, IGNORE_CASE)) { tok = tok.getCaseInsensitiveToken(); if (!tok.match(ch)) { if (ch >= 0x10000) return -1; char uch; if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch))) return -1; } } else { if (!tok.match(ch)) return -1; } offset = o1;
if (dx > 0) { if (offset >= con.limit) return -1; int ch = target .setIndex( offset ) ; if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit) ch = REUtil.composeFromSurrogates(ch, target .setIndex( ++offset ) ); RangeToken tok = op.getToken(); if (isSet(opts, IGNORE_CASE)) { tok = tok.getCaseInsensitiveToken(); if (!tok.match(ch)) { if (ch >= 0x10000) return -1; char uch; if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch))) return -1; } } else { if (!tok.match(ch)) return -1; } offset ++; } else { int o1 = offset-1; if (o1 >= con.limit || o1 < 0) return -1; int ch = target .setIndex( o1 ) ; if (REUtil.isLowSurrogate(ch) && o1-1 >= 0) ch = REUtil.composeFromSurrogates( target .setIndex( --o1 ) , ch); RangeToken tok = op.getToken(); if (isSet(opts, IGNORE_CASE)) { tok = tok.getCaseInsensitiveToken(); if (!tok.match(ch)) { if (ch >= 0x10000) return -1; char uch; if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch))) return -1; } } else { if (!tok.match(ch)) return -1; } offset = o1;
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (dx > 0) {
1
if (dx > 0) {
2
                      if (offset >= con.limit)
2
                      if (offset >= con.limit)
3
                          return -1;
3
                          return -1;
4
                      int ch =  target .charAt(  offset ) ;
4
                      int ch =  target .setIndex(  offset ) ;
5
                      if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
5
                      if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
6
                          ch = REUtil.composeFromSurrogates(ch,  target .charAt(  ++offset ) );
6
                          ch = REUtil.composeFromSurrogates(ch,  target .setIndex(  ++offset ) );
7
                      RangeToken tok = op.getToken();
7
                      RangeToken tok = op.getToken();
8
                      if (isSet(opts, IGNORE_CASE)) {
8
                      if (isSet(opts, IGNORE_CASE)) {
9
                          tok = tok.getCaseInsensitiveToken();
9
                          tok = tok.getCaseInsensitiveToken();
10
                          if (!tok.match(ch)) {
10
                          if (!tok.match(ch)) {
11
                              if (ch >= 0x10000)  return -1;
11
                              if (ch >= 0x10000)  return -1;
12
                              char uch;
12
                              char uch;
13
                              if (!tok.match(uch = Character.toUpperCase((char)ch))
13
                              if (!tok.match(uch = Character.toUpperCase((char)ch))
14
                                  && !tok.match(Character.toLowerCase(uch)))
14
                                  && !tok.match(Character.toLowerCase(uch)))
15
                                  return -1;
15
                                  return -1;
16
                          }
16
                          }
17
                      } else {
17
                      } else {
18
                          if (!tok.match(ch))  return -1;
18
                          if (!tok.match(ch))  return -1;
19
                      }
19
                      }
20
                      offset ++;
20
                      offset ++;
21
                  } else {
21
                  } else {
22
                      int o1 = offset-1;
22
                      int o1 = offset-1;
23
                      if (o1 >= con.limit || o1 < 0)
23
                      if (o1 >= con.limit || o1 < 0)
24
                          return -1;
24
                          return -1;
25
                      int ch =  target .charAt(  o1 ) ;
25
                      int ch =  target .setIndex(  o1 ) ;
26
                      if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
26
                      if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
27
                          ch = REUtil.composeFromSurrogates( target .charAt(  --o1 ) , ch);
27
                          ch = REUtil.composeFromSurrogates( target .setIndex(  --o1 ) , ch);
28
                      RangeToken tok = op.getToken();
28
                      RangeToken tok = op.getToken();
29
                      if (isSet(opts, IGNORE_CASE)) {
29
                      if (isSet(opts, IGNORE_CASE)) {
30
                          tok = tok.getCaseInsensitiveToken();
30
                          tok = tok.getCaseInsensitiveToken();
31
                          if (!tok.match(ch)) {
31
                          if (!tok.match(ch)) {
32
                              if (ch >= 0x10000)  return -1;
32
                              if (ch >= 0x10000)  return -1;
33
                              char uch;
33
                              char uch;
34
                              if (!tok.match(uch = Character.toUpperCase((char)ch))
34
                              if (!tok.match(uch = Character.toUpperCase((char)ch))
35
                                  && !tok.match(Character.toLowerCase(uch)))
35
                                  && !tok.match(Character.toLowerCase(uch)))
36
                                  return -1;
36
                                  return -1;
37
                          }
37
                          }
38
                      } else {
38
                      } else {
39
                          if (!tok.match(ch))  return -1;
39
                          if (!tok.match(ch))  return -1;
40
                      }
40
                      }
41
                      offset = o1;
41
                      offset = o1;
42
                  
42
                  
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0