if (dx > 0) { if (offset >= con.limit) return -1; int ch = target .charAt( offset ) ; if (isSet(opts, SINGLE_LINE)) { if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit) offset ++; } else { if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit) ch = REUtil.composeFromSurrogates(ch, target .charAt( ++offset ) ); if (isEOLChar(ch)) return -1; } offset ++; } else { int o1 = offset-1; if (o1 >= con.limit || o1 < 0) return -1; int ch = target .charAt( o1 ) ; if (isSet(opts, SINGLE_LINE)) { if (REUtil.isLowSurrogate(ch) && o1-1 >= 0) o1 --; } else { if (REUtil.isLowSurrogate(ch) && o1-1 >= 0) ch = REUtil.composeFromSurrogates( target .charAt( --o1 ) , ch); if (!isEOLChar(ch)) return -1; } offset = o1;
if (dx > 0) { if (offset >= con.limit) return -1; int ch = target .setIndex( offset ) ; if (isSet(opts, SINGLE_LINE)) { if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit) offset ++; } else { if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit) ch = REUtil.composeFromSurrogates(ch, target .setIndex( ++offset ) ); if (isEOLChar(ch)) return -1; } offset ++; } else { int o1 = offset-1; if (o1 >= con.limit || o1 < 0) return -1; int ch = target .setIndex( o1 ) ; if (isSet(opts, SINGLE_LINE)) { if (REUtil.isLowSurrogate(ch) && o1-1 >= 0) o1 --; } else { if (REUtil.isLowSurrogate(ch) && o1-1 >= 0) ch = REUtil.composeFromSurrogates( target .setIndex( --o1 ) , ch); if (!isEOLChar(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 (isSet(opts, SINGLE_LINE)) {
5
                      if (isSet(opts, SINGLE_LINE)) {
6
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
6
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
7
                              offset ++;
7
                              offset ++;
8
                      } else {
8
                      } else {
9
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
9
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
10
                              ch = REUtil.composeFromSurrogates(ch,  target .charAt(  ++offset ) );
10
                              ch = REUtil.composeFromSurrogates(ch,  target .setIndex(  ++offset ) );
11
                          if (isEOLChar(ch))
11
                          if (isEOLChar(ch))
12
                              return -1;
12
                              return -1;
13
                      }
13
                      }
14
                      offset ++;
14
                      offset ++;
15
                  } else {
15
                  } else {
16
                      int o1 = offset-1;
16
                      int o1 = offset-1;
17
                      if (o1 >= con.limit || o1 < 0)
17
                      if (o1 >= con.limit || o1 < 0)
18
                          return -1;
18
                          return -1;
19
                      int ch =  target .charAt(  o1 ) ;
19
                      int ch =  target .setIndex(  o1 ) ;
20
                      if (isSet(opts, SINGLE_LINE)) {
20
                      if (isSet(opts, SINGLE_LINE)) {
21
                          if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
21
                          if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
22
                              o1 --;
22
                              o1 --;
23
                      } else {
23
                      } else {
24
                          if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
24
                          if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
25
                              ch = REUtil.composeFromSurrogates( target .charAt(  --o1 ) , ch);
25
                              ch = REUtil.composeFromSurrogates( target .setIndex(  --o1 ) , ch);
26
                          if (!isEOLChar(ch))
26
                          if (!isEOLChar(ch))
27
                              return -1;
27
                              return -1;
28
                      }
28
                      }
29
                      offset = o1;
29
                      offset = o1;
30
                  
30
                  
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