switch (op.type) { case Op.CHAR: if (isSet(opts, IGNORE_CASE)) { int ch = op.getData(); if (dx > 0) { if (offset >= con.limit || !matchIgnoreCase(ch, target .charAt( offset ) )) return -1; offset ++; } else { int o1 = offset-1; if (o1 >= con.limit || o1 < 0 || !matchIgnoreCase(ch, target .charAt( o1 ) )) return -1; offset = o1; } } else { int ch = op.getData(); if (dx > 0) { if (offset >= con.limit || ch != target .charAt( offset ) ) return -1; offset ++; } else { int o1 = offset-1; if (o1 >= con.limit || o1 < 0 || ch != target .charAt( o1 ) ) return -1; offset = o1; } } op = op.next; break; case Op.DOT: 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; } op = op.next; break; case Op.RANGE: case Op.NRANGE: 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; } op = op.next; break; case Op.ANCHOR: boolean go = false; switch (op.getData()) { case '^': if (isSet(opts, MULTIPLE_LINES)) { if (!(offset == con.start || offset > con.start && isEOLChar( target .charAt( offset-1 ) ))) return -1; } else { if (offset != con.start) return -1; } break; case '@': // Internal use only. // The @ always matches line beginnings. if (!(offset == con.start || offset > con.start && isEOLChar( target .charAt( offset-1 ) ))) return -1; break; case '$': if (isSet(opts, MULTIPLE_LINES)) { if (!(offset == con.limit || offset < con.limit && isEOLChar( target .charAt( offset ) ))) return -1; } else { if (!(offset == con.limit || offset+1 == con.limit && isEOLChar( target .charAt( offset ) ) || offset+2 == con.limit && target .charAt( offset ) == CARRIAGE_RETURN && target .charAt( offset+1 ) == LINE_FEED)) return -1; } break; case 'A': if (offset != con.start) return -1; break; case 'Z': if (!(offset == con.limit || offset+1 == con.limit && isEOLChar( target .charAt( offset ) ) || offset+2 == con.limit && target .charAt( offset ) == CARRIAGE_RETURN && target .charAt( offset+1 ) == LINE_FEED)) return -1; break; case 'z': if (offset != con.limit) return -1; break; case 'b': if (con.length == 0) return -1; { int after = getWordType(target, con.start, con.limit, offset, opts); if (after == WT_IGNORE) return -1; int before = getPreviousWordType(target, con.start, con.limit, offset, opts); if (after == before) return -1; } break; case 'B': if (con.length == 0) go = true; else { int after = getWordType(target, con.start, con.limit, offset, opts); go = after == WT_IGNORE || after == getPreviousWordType(target, con.start, con.limit, offset, opts); } if (!go) return -1; break; case '<': if (con.length == 0 || offset == con.limit) return -1; if (getWordType(target, con.start, con.limit, offset, opts) != WT_LETTER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_OTHER) return -1; break; case '>': if (con.length == 0 || offset == con.start) return -1; if (getWordType(target, con.start, con.limit, offset, opts) != WT_OTHER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_LETTER) return -1; break; } // switch anchor type op = op.next; break; case Op.BACKREFERENCE: { int refno = op.getData(); if (refno <= 0 || refno >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno); if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0) return -1; // ******** int o2 = con.match.getBeginning(refno); int literallen = con.match.getEnd(refno)-o2; if (!isSet(opts, IGNORE_CASE)) { if (dx > 0) { if (!regionMatches(target, offset, con.limit, o2, literallen)) return -1; offset += literallen; } else { if (!regionMatches(target, offset-literallen, con.limit, o2, literallen)) return -1; offset -= literallen; } } else { if (dx > 0) { if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen)) return -1; offset += literallen; } else { if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit, o2, literallen)) return -1; offset -= literallen; } } } op = op.next; break; case Op.STRING: { String literal = op.getString(); int literallen = literal.length(); if (!isSet(opts, IGNORE_CASE)) { if (dx > 0) { if (!regionMatches(target, offset, con.limit, literal, literallen)) return -1; offset += literallen; } else { if (!regionMatches(target, offset-literallen, con.limit, literal, literallen)) return -1; offset -= literallen; } } else { if (dx > 0) { if (!regionMatchesIgnoreCase(target, offset, con.limit, literal, literallen)) return -1; offset += literallen; } else { if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit, literal, literallen)) return -1; offset -= literallen; } } } op = op.next; break; case Op.CLOSURE: { /* * Saves current position to avoid * zero-width repeats. */ int id = op.getData(); if (id >= 0) { int previousOffset = con.offsets[id]; if (previousOffset < 0 || previousOffset != offset) { con.offsets[id] = offset; } else { con.offsets[id] = -1; op = op.next; break; } } int ret = this. matchString (con, op.getChild(), offset, dx, opts); if (id >= 0) con.offsets[id] = -1; if (ret >= 0) return ret; op = op.next; } break; case Op.QUESTION: { int ret = this. matchString (con, op.getChild(), offset, dx, opts); if (ret >= 0) return ret; op = op.next; } break; case Op.NONGREEDYCLOSURE: case Op.NONGREEDYQUESTION: { int ret = this. matchString (con, op.next, offset, dx, opts); if (ret >= 0) return ret; op = op.getChild(); } break; case Op.UNION: for (int i = 0; i < op.size(); i ++) { int ret = this. matchString (con, op.elementAt(i), offset, dx, opts); if (DEBUG) { System.err.println("UNION: "+i+", ret="+ret); } if (ret >= 0) return ret; } return -1; case Op.CAPTURE: int refno = op.getData(); if (con.match != null && refno > 0) { int save = con.match.getBeginning(refno); con.match.setBeginning(refno, offset); int ret = this. matchString (con, op.next, offset, dx, opts); if (ret < 0) con.match.setBeginning(refno, save); return ret; } else if (con.match != null && refno < 0) { int index = -refno; int save = con.match.getEnd(index); con.match.setEnd(index, offset); int ret = this. matchString (con, op.next, offset, dx, opts); if (ret < 0) con.match.setEnd(index, save); return ret; } op = op.next; break; case Op.LOOKAHEAD: if (0 > this. matchString (con, op.getChild(), offset, 1, opts)) return -1; op = op.next; break; case Op.NEGATIVELOOKAHEAD: if (0 <= this. matchString (con, op.getChild(), offset, 1, opts)) return -1; op = op.next; break; case Op.LOOKBEHIND: if (0 > this. matchString (con, op.getChild(), offset, -1, opts)) return -1; op = op.next; break; case Op.NEGATIVELOOKBEHIND: if (0 <= this. matchString (con, op.getChild(), offset, -1, opts)) return -1; op = op.next; break; case Op.INDEPENDENT: { int ret = this. matchString (con, op.getChild(), offset, dx, opts); if (ret < 0) return ret; offset = ret; op = op.next; } break; case Op.MODIFIER: { int localopts = opts; localopts |= op.getData(); localopts &= ~op.getData2(); //System.err.println("MODIFIER: "+Integer.toString(opts, 16)+" -> "+Integer.toString(localopts, 16)); int ret = this. matchString (con, op.getChild(), offset, dx, localopts); if (ret < 0) return ret; offset = ret; op = op.next; } break; case Op.CONDITION: { Op.ConditionOp cop = (Op.ConditionOp)op; boolean matchp = false; if (cop.refNumber > 0) { if (cop.refNumber >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber); matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0; } else { matchp = 0 <= this. matchString (con, cop.condition, offset, dx, opts); } if (matchp) { op = cop.yes; } else if (cop.no != null) { op = cop.no; } else { op = cop.next; } } break; default: throw new RuntimeException("Unknown operation type: "+op.type); }
switch (op.type) { case Op.CHAR: if (isSet(opts, IGNORE_CASE)) { int ch = op.getData(); if (dx > 0) { if (offset >= con.limit || !matchIgnoreCase(ch, target .setIndex( offset ) )) return -1; offset ++; } else { int o1 = offset-1; if (o1 >= con.limit || o1 < 0 || !matchIgnoreCase(ch, target .setIndex( o1 ) )) return -1; offset = o1; } } else { int ch = op.getData(); if (dx > 0) { if (offset >= con.limit || ch != target .setIndex( offset ) ) return -1; offset ++; } else { int o1 = offset-1; if (o1 >= con.limit || o1 < 0 || ch != target .setIndex( o1 ) ) return -1; offset = o1; } } op = op.next; break; case Op.DOT: 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; } op = op.next; break; case Op.RANGE: case Op.NRANGE: 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; } op = op.next; break; case Op.ANCHOR: boolean go = false; switch (op.getData()) { case '^': if (isSet(opts, MULTIPLE_LINES)) { if (!(offset == con.start || offset > con.start && isEOLChar( target .setIndex( offset-1 ) ))) return -1; } else { if (offset != con.start) return -1; } break; case '@': // Internal use only. // The @ always matches line beginnings. if (!(offset == con.start || offset > con.start && isEOLChar( target .setIndex( offset-1 ) ))) return -1; break; case '$': if (isSet(opts, MULTIPLE_LINES)) { if (!(offset == con.limit || offset < con.limit && isEOLChar( target .setIndex( offset ) ))) return -1; } else { if (!(offset == con.limit || offset+1 == con.limit && isEOLChar( target .setIndex( offset ) ) || offset+2 == con.limit && target .setIndex( offset ) == CARRIAGE_RETURN && target .setIndex( offset+1 ) == LINE_FEED)) return -1; } break; case 'A': if (offset != con.start) return -1; break; case 'Z': if (!(offset == con.limit || offset+1 == con.limit && isEOLChar( target .setIndex( offset ) ) || offset+2 == con.limit && target .setIndex( offset ) == CARRIAGE_RETURN && target .setIndex( offset+1 ) == LINE_FEED)) return -1; break; case 'z': if (offset != con.limit) return -1; break; case 'b': if (con.length == 0) return -1; { int after = getWordType(target, con.start, con.limit, offset, opts); if (after == WT_IGNORE) return -1; int before = getPreviousWordType(target, con.start, con.limit, offset, opts); if (after == before) return -1; } break; case 'B': if (con.length == 0) go = true; else { int after = getWordType(target, con.start, con.limit, offset, opts); go = after == WT_IGNORE || after == getPreviousWordType(target, con.start, con.limit, offset, opts); } if (!go) return -1; break; case '<': if (con.length == 0 || offset == con.limit) return -1; if (getWordType(target, con.start, con.limit, offset, opts) != WT_LETTER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_OTHER) return -1; break; case '>': if (con.length == 0 || offset == con.start) return -1; if (getWordType(target, con.start, con.limit, offset, opts) != WT_OTHER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_LETTER) return -1; break; } // switch anchor type op = op.next; break; case Op.BACKREFERENCE: { int refno = op.getData(); if (refno <= 0 || refno >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno); if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0) return -1; // ******** int o2 = con.match.getBeginning(refno); int literallen = con.match.getEnd(refno)-o2; if (!isSet(opts, IGNORE_CASE)) { if (dx > 0) { if (!regionMatches(target, offset, con.limit, o2, literallen)) return -1; offset += literallen; } else { if (!regionMatches(target, offset-literallen, con.limit, o2, literallen)) return -1; offset -= literallen; } } else { if (dx > 0) { if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen)) return -1; offset += literallen; } else { if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit, o2, literallen)) return -1; offset -= literallen; } } } op = op.next; break; case Op.STRING: { String literal = op.getString(); int literallen = literal.length(); if (!isSet(opts, IGNORE_CASE)) { if (dx > 0) { if (!regionMatches(target, offset, con.limit, literal, literallen)) return -1; offset += literallen; } else { if (!regionMatches(target, offset-literallen, con.limit, literal, literallen)) return -1; offset -= literallen; } } else { if (dx > 0) { if (!regionMatchesIgnoreCase(target, offset, con.limit, literal, literallen)) return -1; offset += literallen; } else { if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit, literal, literallen)) return -1; offset -= literallen; } } } op = op.next; break; case Op.CLOSURE: { /* * Saves current position to avoid * zero-width repeats. */ int id = op.getData(); if (id >= 0) { int previousOffset = con.offsets[id]; if (previousOffset < 0 || previousOffset != offset) { con.offsets[id] = offset; } else { con.offsets[id] = -1; op = op.next; break; } } int ret = this. matchCharacterIterator (con, op.getChild(), offset, dx, opts); if (id >= 0) con.offsets[id] = -1; if (ret >= 0) return ret; op = op.next; } break; case Op.QUESTION: { int ret = this. matchCharacterIterator (con, op.getChild(), offset, dx, opts); if (ret >= 0) return ret; op = op.next; } break; case Op.NONGREEDYCLOSURE: case Op.NONGREEDYQUESTION: { int ret = this. matchCharacterIterator (con, op.next, offset, dx, opts); if (ret >= 0) return ret; op = op.getChild(); } break; case Op.UNION: for (int i = 0; i < op.size(); i ++) { int ret = this. matchCharacterIterator (con, op.elementAt(i), offset, dx, opts); if (DEBUG) { System.err.println("UNION: "+i+", ret="+ret); } if (ret >= 0) return ret; } return -1; case Op.CAPTURE: int refno = op.getData(); if (con.match != null && refno > 0) { int save = con.match.getBeginning(refno); con.match.setBeginning(refno, offset); int ret = this. matchCharacterIterator (con, op.next, offset, dx, opts); if (ret < 0) con.match.setBeginning(refno, save); return ret; } else if (con.match != null && refno < 0) { int index = -refno; int save = con.match.getEnd(index); con.match.setEnd(index, offset); int ret = this. matchCharacterIterator (con, op.next, offset, dx, opts); if (ret < 0) con.match.setEnd(index, save); return ret; } op = op.next; break; case Op.LOOKAHEAD: if (0 > this. matchCharacterIterator (con, op.getChild(), offset, 1, opts)) return -1; op = op.next; break; case Op.NEGATIVELOOKAHEAD: if (0 <= this. matchCharacterIterator (con, op.getChild(), offset, 1, opts)) return -1; op = op.next; break; case Op.LOOKBEHIND: if (0 > this. matchCharacterIterator (con, op.getChild(), offset, -1, opts)) return -1; op = op.next; break; case Op.NEGATIVELOOKBEHIND: if (0 <= this. matchCharacterIterator (con, op.getChild(), offset, -1, opts)) return -1; op = op.next; break; case Op.INDEPENDENT: { int ret = this. matchCharacterIterator (con, op.getChild(), offset, dx, opts); if (ret < 0) return ret; offset = ret; op = op.next; } break; case Op.MODIFIER: { int localopts = opts; localopts |= op.getData(); localopts &= ~op.getData2(); //System.err.println("MODIFIER: "+Integer.toString(opts, 16)+" -> "+Integer.toString(localopts, 16)); int ret = this. matchCharacterIterator (con, op.getChild(), offset, dx, localopts); if (ret < 0) return ret; offset = ret; op = op.next; } break; case Op.CONDITION: { Op.ConditionOp cop = (Op.ConditionOp)op; boolean matchp = false; if (cop.refNumber > 0) { if (cop.refNumber >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber); matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0; } else { matchp = 0 <= this. matchCharacterIterator (con, cop.condition, offset, dx, opts); } if (matchp) { op = cop.yes; } else if (cop.no != null) { op = cop.no; } else { op = cop.next; } } break; default: throw new RuntimeException("Unknown operation type: "+op.type); }
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: int matchString(Context, Op, int, int, int) Method name: int matchCharacterIterator(Context, Op, int, int, int)
Number of AST nodes: 309 Number of AST nodes: 309
1
switch (op.type) {
1
switch (op.type) {
2
              case Op.CHAR:
2
              case Op.CHAR:
3
                  if (isSet(opts, IGNORE_CASE)) {
3
                  if (isSet(opts, IGNORE_CASE)) {
4
                      int ch = op.getData();
4
                      int ch = op.getData();
5
                      if (dx > 0) {
5
                      if (dx > 0) {
6
                          if (offset >= con.limit || !matchIgnoreCase(ch,  target .charAt(  offset ) ))
6
                          if (offset >= con.limit || !matchIgnoreCase(ch,  target .setIndex(  offset ) ))
7
                              return -1;
7
                              return -1;
8
                          offset ++;
8
                          offset ++;
9
                      } else {
9
                      } else {
10
                          int o1 = offset-1;
10
                          int o1 = offset-1;
11
                          if (o1 >= con.limit || o1 < 0 || !matchIgnoreCase(ch,  target .charAt(  o1 ) ))
11
                          if (o1 >= con.limit || o1 < 0 || !matchIgnoreCase(ch,  target .setIndex(  o1 ) ))
12
                              return -1;
12
                              return -1;
13
                          offset = o1;
13
                          offset = o1;
14
                      }
14
                      }
15
                  } else {
15
                  } else {
16
                      int ch = op.getData();
16
                      int ch = op.getData();
17
                      if (dx > 0) {
17
                      if (dx > 0) {
18
                          if (offset >= con.limit || ch !=  target .charAt(  offset ) )
18
                          if (offset >= con.limit || ch !=  target .setIndex(  offset ) )
19
                              return -1;
19
                              return -1;
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 || ch !=  target .charAt(  o1 ) )
23
                          if (o1 >= con.limit || o1 < 0 || ch !=  target .setIndex(  o1 ) )
24
                              return -1;
24
                              return -1;
25
                          offset = o1;
25
                          offset = o1;
26
                      }
26
                      }
27
                  }
27
                  }
28
                  op = op.next;
28
                  op = op.next;
29
                  break;
29
                  break;
30
              case Op.DOT:
30
              case Op.DOT:
31
                  if (dx > 0) {
31
                  if (dx > 0) {
32
                      if (offset >= con.limit)
32
                      if (offset >= con.limit)
33
                          return -1;
33
                          return -1;
34
                      int ch =  target .charAt(  offset ) ;
34
                      int ch =  target .setIndex(  offset ) ;
35
                      if (isSet(opts, SINGLE_LINE)) {
35
                      if (isSet(opts, SINGLE_LINE)) {
36
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
36
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
37
                              offset ++;
37
                              offset ++;
38
                      } else {
38
                      } else {
39
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
39
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
40
                              ch = REUtil.composeFromSurrogates(ch,  target .charAt(  ++offset ) );
40
                              ch = REUtil.composeFromSurrogates(ch,  target .setIndex(  ++offset ) );
41
                          if (isEOLChar(ch))
41
                          if (isEOLChar(ch))
42
                              return -1;
42
                              return -1;
43
                      }
43
                      }
44
                      offset ++;
44
                      offset ++;
45
                  } else {
45
                  } else {
46
                      int o1 = offset-1;
46
                      int o1 = offset-1;
47
                      if (o1 >= con.limit || o1 < 0)
47
                      if (o1 >= con.limit || o1 < 0)
48
                          return -1;
48
                          return -1;
49
                      int ch =  target .charAt(  o1 ) ;
49
                      int ch =  target .setIndex(  o1 ) ;
50
                      if (isSet(opts, SINGLE_LINE)) {
50
                      if (isSet(opts, SINGLE_LINE)) {
51
                          if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
51
                          if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
52
                              o1 --;
52
                              o1 --;
53
                      } else {
53
                      } else {
54
                          if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
54
                          if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
55
                              ch = REUtil.composeFromSurrogates( target .charAt(  --o1 ) , ch);
55
                              ch = REUtil.composeFromSurrogates( target .setIndex(  --o1 ) , ch);
56
                          if (!isEOLChar(ch))
56
                          if (!isEOLChar(ch))
57
                              return -1;
57
                              return -1;
58
                      }
58
                      }
59
                      offset = o1;
59
                      offset = o1;
60
                  }
60
                  }
61
                  op = op.next;
61
                  op = op.next;
62
                  break;
62
                  break;
63
              case Op.RANGE:
63
              case Op.RANGE:
64
              case Op.NRANGE:
64
              case Op.NRANGE:
65
                  if (dx > 0) {
65
                  if (dx > 0) {
66
                      if (offset >= con.limit)
66
                      if (offset >= con.limit)
67
                          return -1;
67
                          return -1;
68
                      int ch =  target .charAt(  offset ) ;
68
                      int ch =  target .setIndex(  offset ) ;
69
                      if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
69
                      if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
70
                          ch = REUtil.composeFromSurrogates(ch,  target .charAt(  ++offset ) );
70
                          ch = REUtil.composeFromSurrogates(ch,  target .setIndex(  ++offset ) );
71
                      RangeToken tok = op.getToken();
71
                      RangeToken tok = op.getToken();
72
                      if (isSet(opts, IGNORE_CASE)) {
72
                      if (isSet(opts, IGNORE_CASE)) {
73
                          tok = tok.getCaseInsensitiveToken();
73
                          tok = tok.getCaseInsensitiveToken();
74
                          if (!tok.match(ch)) {
74
                          if (!tok.match(ch)) {
75
                              if (ch >= 0x10000)  return -1;
75
                              if (ch >= 0x10000)  return -1;
76
                              char uch;
76
                              char uch;
77
                              if (!tok.match(uch = Character.toUpperCase((char)ch))
77
                              if (!tok.match(uch = Character.toUpperCase((char)ch))
78
                                  && !tok.match(Character.toLowerCase(uch)))
78
                                  && !tok.match(Character.toLowerCase(uch)))
79
                                  return -1;
79
                                  return -1;
80
                          }
80
                          }
81
                      } else {
81
                      } else {
82
                          if (!tok.match(ch))  return -1;
82
                          if (!tok.match(ch))  return -1;
83
                      }
83
                      }
84
                      offset ++;
84
                      offset ++;
85
                  } else {
85
                  } else {
86
                      int o1 = offset-1;
86
                      int o1 = offset-1;
87
                      if (o1 >= con.limit || o1 < 0)
87
                      if (o1 >= con.limit || o1 < 0)
88
                          return -1;
88
                          return -1;
89
                      int ch =  target .charAt(  o1 ) ;
89
                      int ch =  target .setIndex(  o1 ) ;
90
                      if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
90
                      if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)
91
                          ch = REUtil.composeFromSurrogates( target .charAt(  --o1 ) , ch);
91
                          ch = REUtil.composeFromSurrogates( target .setIndex(  --o1 ) , ch);
92
                      RangeToken tok = op.getToken();
92
                      RangeToken tok = op.getToken();
93
                      if (isSet(opts, IGNORE_CASE)) {
93
                      if (isSet(opts, IGNORE_CASE)) {
94
                          tok = tok.getCaseInsensitiveToken();
94
                          tok = tok.getCaseInsensitiveToken();
95
                          if (!tok.match(ch)) {
95
                          if (!tok.match(ch)) {
96
                              if (ch >= 0x10000)  return -1;
96
                              if (ch >= 0x10000)  return -1;
97
                              char uch;
97
                              char uch;
98
                              if (!tok.match(uch = Character.toUpperCase((char)ch))
98
                              if (!tok.match(uch = Character.toUpperCase((char)ch))
99
                                  && !tok.match(Character.toLowerCase(uch)))
99
                                  && !tok.match(Character.toLowerCase(uch)))
100
                                  return -1;
100
                                  return -1;
101
                          }
101
                          }
102
                      } else {
102
                      } else {
103
                          if (!tok.match(ch))  return -1;
103
                          if (!tok.match(ch))  return -1;
104
                      }
104
                      }
105
                      offset = o1;
105
                      offset = o1;
106
                  }
106
                  }
107
                  op = op.next;
107
                  op = op.next;
108
                  break;
108
                  break;
109
              case Op.ANCHOR:
109
              case Op.ANCHOR:
110
                  boolean go = false;
110
                  boolean go = false;
111
                  switch (op.getData()) {
111
                  switch (op.getData()) {
112
                  case '^':
112
                  case '^':
113
                      if (isSet(opts, MULTIPLE_LINES)) {
113
                      if (isSet(opts, MULTIPLE_LINES)) {
114
                          if (!(offset == con.start
114
                          if (!(offset == con.start
115
                                || offset > con.start && isEOLChar( target .charAt(  offset-1 ) )))
115
                                || offset > con.start && isEOLChar( target .setIndex(  offset-1 ) )))
116
                              return -1;
116
                              return -1;
117
                      } else {
117
                      } else {
118
                          if (offset != con.start)
118
                          if (offset != con.start)
119
                              return -1;
119
                              return -1;
120
                      }
120
                      }
121
                      break;
121
                      break;
122
                  case '@':                         // Internal use only.
122
                  case '@':                         // Internal use only.
123
                      // The @ always matches line beginnings.
123
                      // The @ always matches line beginnings.
124
                      if (!(offset == con.start
124
                      if (!(offset == con.start
125
                            || offset > con.start && isEOLChar( target .charAt(  offset-1 ) )))
125
                            || offset > con.start && isEOLChar( target .setIndex(  offset-1 ) )))
126
                          return -1;
126
                          return -1;
127
                      break;
127
                      break;
128
                  case '$':
128
                  case '$':
129
                      if (isSet(opts, MULTIPLE_LINES)) {
129
                      if (isSet(opts, MULTIPLE_LINES)) {
130
                          if (!(offset == con.limit
130
                          if (!(offset == con.limit
131
                                || offset < con.limit && isEOLChar( target .charAt(  offset ) )))
131
                                || offset < con.limit && isEOLChar( target .setIndex(  offset ) )))
132
                              return -1;
132
                              return -1;
133
                      } else {
133
                      } else {
134
                          if (!(offset == con.limit
134
                          if (!(offset == con.limit
135
                                || offset+1 == con.limit && isEOLChar( target .charAt(  offset ) )
135
                                || offset+1 == con.limit && isEOLChar( target .setIndex(  offset ) )
136
                                || offset+2 == con.limit &&  target .charAt(  offset )  == CARRIAGE_RETURN
136
                                || offset+2 == con.limit &&  target .setIndex(  offset )  == CARRIAGE_RETURN
137
                                &&  target .charAt(  offset+1 )  == LINE_FEED))
137
                                &&  target .setIndex(  offset+1 )  == LINE_FEED))
138
                              return -1;
138
                              return -1;
139
                      }
139
                      }
140
                      break;
140
                      break;
141
                  case 'A':
141
                  case 'A':
142
                      if (offset != con.start)  return -1;
142
                      if (offset != con.start)  return -1;
143
                      break;
143
                      break;
144
                  case 'Z':
144
                  case 'Z':
145
                      if (!(offset == con.limit
145
                      if (!(offset == con.limit
146
                            || offset+1 == con.limit && isEOLChar( target .charAt(  offset ) )
146
                            || offset+1 == con.limit && isEOLChar( target .setIndex(  offset ) )
147
                            || offset+2 == con.limit &&  target .charAt(  offset )  == CARRIAGE_RETURN
147
                            || offset+2 == con.limit &&  target .setIndex(  offset )  == CARRIAGE_RETURN
148
                            &&  target .charAt(  offset+1 )  == LINE_FEED))
148
                            &&  target .setIndex(  offset+1 )  == LINE_FEED))
149
                          return -1;
149
                          return -1;
150
                      break;
150
                      break;
151
                  case 'z':
151
                  case 'z':
152
                      if (offset != con.limit)  return -1;
152
                      if (offset != con.limit)  return -1;
153
                      break;
153
                      break;
154
                  case 'b':
154
                  case 'b':
155
                      if (con.length == 0)  return -1;
155
                      if (con.length == 0)  return -1;
156
                      {
156
                      {
157
                          int after = getWordType(target, con.start, con.limit, offset, opts);
157
                          int after = getWordType(target, con.start, con.limit, offset, opts);
158
                          if (after == WT_IGNORE)  return -1;
158
                          if (after == WT_IGNORE)  return -1;
159
                          int before = getPreviousWordType(target, con.start, con.limit, offset, opts);
159
                          int before = getPreviousWordType(target, con.start, con.limit, offset, opts);
160
                          if (after == before)  return -1;
160
                          if (after == before)  return -1;
161
                      }
161
                      }
162
                      break;
162
                      break;
163
                  case 'B':
163
                  case 'B':
164
                      if (con.length == 0)
164
                      if (con.length == 0)
165
                          go = true;
165
                          go = true;
166
                      else {
166
                      else {
167
                          int after = getWordType(target, con.start, con.limit, offset, opts);
167
                          int after = getWordType(target, con.start, con.limit, offset, opts);
168
                          go = after == WT_IGNORE
168
                          go = after == WT_IGNORE
169
                               || after == getPreviousWordType(target, con.start, con.limit, offset, opts);
169
                               || after == getPreviousWordType(target, con.start, con.limit, offset, opts);
170
                      }
170
                      }
171
                      if (!go)  return -1;
171
                      if (!go)  return -1;
172
                      break;
172
                      break;
173
                  case '<':
173
                  case '<':
174
                      if (con.length == 0 || offset == con.limit)  return -1;
174
                      if (con.length == 0 || offset == con.limit)  return -1;
175
                      if (getWordType(target, con.start, con.limit, offset, opts) != WT_LETTER
175
                      if (getWordType(target, con.start, con.limit, offset, opts) != WT_LETTER
176
                          || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_OTHER)
176
                          || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_OTHER)
177
                          return -1;
177
                          return -1;
178
                      break;
178
                      break;
179
                  case '>':
179
                  case '>':
180
                      if (con.length == 0 || offset == con.start)  return -1;
180
                      if (con.length == 0 || offset == con.start)  return -1;
181
                      if (getWordType(target, con.start, con.limit, offset, opts) != WT_OTHER
181
                      if (getWordType(target, con.start, con.limit, offset, opts) != WT_OTHER
182
                          || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_LETTER)
182
                          || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_LETTER)
183
                          return -1;
183
                          return -1;
184
                      break;
184
                      break;
185
                  } // switch anchor type
185
                  } // switch anchor type
186
                  op = op.next;
186
                  op = op.next;
187
                  break;
187
                  break;
188
              case Op.BACKREFERENCE:
188
              case Op.BACKREFERENCE:
189
                  {
189
                  {
190
                      int refno = op.getData();
190
                      int refno = op.getData();
191
                      if (refno <= 0 || refno >= this.nofparen)
191
                      if (refno <= 0 || refno >= this.nofparen)
192
                          throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno);
192
                          throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno);
193
                      if (con.match.getBeginning(refno) < 0
193
                      if (con.match.getBeginning(refno) < 0
194
                          || con.match.getEnd(refno) < 0)
194
                          || con.match.getEnd(refno) < 0)
195
                          return -1;                // ********
195
                          return -1;                // ********
196
                      int o2 = con.match.getBeginning(refno);
196
                      int o2 = con.match.getBeginning(refno);
197
                      int literallen = con.match.getEnd(refno)-o2;
197
                      int literallen = con.match.getEnd(refno)-o2;
198
                      if (!isSet(opts, IGNORE_CASE)) {
198
                      if (!isSet(opts, IGNORE_CASE)) {
199
                          if (dx > 0) {
199
                          if (dx > 0) {
200
                              if (!regionMatches(target, offset, con.limit, o2, literallen))
200
                              if (!regionMatches(target, offset, con.limit, o2, literallen))
201
                                  return -1;
201
                                  return -1;
202
                              offset += literallen;
202
                              offset += literallen;
203
                          } else {
203
                          } else {
204
                              if (!regionMatches(target, offset-literallen, con.limit, o2, literallen))
204
                              if (!regionMatches(target, offset-literallen, con.limit, o2, literallen))
205
                                  return -1;
205
                                  return -1;
206
                              offset -= literallen;
206
                              offset -= literallen;
207
                          }
207
                          }
208
                      } else {
208
                      } else {
209
                          if (dx > 0) {
209
                          if (dx > 0) {
210
                              if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))
210
                              if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))
211
                                  return -1;
211
                                  return -1;
212
                              offset += literallen;
212
                              offset += literallen;
213
                          } else {
213
                          } else {
214
                              if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit,
214
                              if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit,
215
                                                           o2, literallen))
215
                                                           o2, literallen))
216
                                  return -1;
216
                                  return -1;
217
                              offset -= literallen;
217
                              offset -= literallen;
218
                          }
218
                          }
219
                      }
219
                      }
220
                  }
220
                  }
221
                  op = op.next;
221
                  op = op.next;
222
                  break;
222
                  break;
223
              case Op.STRING:
223
              case Op.STRING:
224
                  {
224
                  {
225
                      String literal = op.getString();
225
                      String literal = op.getString();
226
                      int literallen = literal.length();
226
                      int literallen = literal.length();
227
                      if (!isSet(opts, IGNORE_CASE)) {
227
                      if (!isSet(opts, IGNORE_CASE)) {
228
                          if (dx > 0) {
228
                          if (dx > 0) {
229
                              if (!regionMatches(target, offset, con.limit, literal, literallen))
229
                              if (!regionMatches(target, offset, con.limit, literal, literallen))
230
                                  return -1;
230
                                  return -1;
231
                              offset += literallen;
231
                              offset += literallen;
232
                          } else {
232
                          } else {
233
                              if (!regionMatches(target, offset-literallen, con.limit, literal, literallen))
233
                              if (!regionMatches(target, offset-literallen, con.limit, literal, literallen))
234
                                  return -1;
234
                                  return -1;
235
                              offset -= literallen;
235
                              offset -= literallen;
236
                          }
236
                          }
237
                      } else {
237
                      } else {
238
                          if (dx > 0) {
238
                          if (dx > 0) {
239
                              if (!regionMatchesIgnoreCase(target, offset, con.limit, literal, literallen))
239
                              if (!regionMatchesIgnoreCase(target, offset, con.limit, literal, literallen))
240
                                  return -1;
240
                                  return -1;
241
                              offset += literallen;
241
                              offset += literallen;
242
                          } else {
242
                          } else {
243
                              if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit,
243
                              if (!regionMatchesIgnoreCase(target, offset-literallen, con.limit,
244
                                                           literal, literallen))
244
                                                           literal, literallen))
245
                                  return -1;
245
                                  return -1;
246
                              offset -= literallen;
246
                              offset -= literallen;
247
                          }
247
                          }
248
                      }
248
                      }
249
                  }
249
                  }
250
                  op = op.next;
250
                  op = op.next;
251
                  break;
251
                  break;
252
              case Op.CLOSURE:
252
              case Op.CLOSURE:
253
                  {
253
                  {
254
                      /*
254
                      /*
255
                       * Saves current position to avoid
255
                       * Saves current position to avoid
256
                       * zero-width repeats.
256
                       * zero-width repeats.
257
                       */
257
                       */
258
                      int id = op.getData();
258
                      int id = op.getData();
259
                      if (id >= 0) {
259
                      if (id >= 0) {
260
                          int previousOffset = con.offsets[id];
260
                          int previousOffset = con.offsets[id];
261
                          if (previousOffset < 0 || previousOffset != offset) {
261
                          if (previousOffset < 0 || previousOffset != offset) {
262
                              con.offsets[id] = offset;
262
                              con.offsets[id] = offset;
263
                          } else {
263
                          } else {
264
                              con.offsets[id] = -1;
264
                              con.offsets[id] = -1;
265
                              op = op.next;
265
                              op = op.next;
266
                              break;
266
                              break;
267
                          }
267
                          }
268
                      }
268
                      }
269
                      
269
                      int ret = this. matchString (con, op.getChild(), offset, dx, opts);
270
                      int ret = this. matchCharacterIterator (con, op.getChild(), offset, dx, opts);
270
                      if (id >= 0)  con.offsets[id] = -1;
271
                      if (id >= 0)  con.offsets[id] = -1;
271
                      if (ret >= 0)  return ret;
272
                      if (ret >= 0)  return ret;
272
                      op = op.next;
273
                      op = op.next;
273
                  }
274
                  }
274
                  break;
275
                  break;
275
              case Op.QUESTION:
276
              case Op.QUESTION:
276
                  {
277
                  {
277
                      int ret = this. matchString (con, op.getChild(), offset, dx, opts);
278
                      int ret = this. matchCharacterIterator (con, op.getChild(), offset, dx, opts);
278
                      if (ret >= 0)  return ret;
279
                      if (ret >= 0)  return ret;
279
                      op = op.next;
280
                      op = op.next;
280
                  }
281
                  }
281
                  break;
282
                  break;
282
              case Op.NONGREEDYCLOSURE:
283
              case Op.NONGREEDYCLOSURE:
283
              case Op.NONGREEDYQUESTION:
284
              case Op.NONGREEDYQUESTION:
284
                  {
285
                  {
285
                      int ret = this. matchString (con, op.next, offset, dx, opts);
286
                      int ret = this. matchCharacterIterator (con, op.next, offset, dx, opts);
286
                      if (ret >= 0)  return ret;
287
                      if (ret >= 0)  return ret;
287
                      op = op.getChild();
288
                      op = op.getChild();
288
                  }
289
                  }
289
                  break;
290
                  break;
290
              case Op.UNION:
291
              case Op.UNION:
291
                  for (int i = 0;  i < op.size();  i ++) {
292
                  for (int i = 0;  i < op.size();  i ++) {
292
                      int ret = this. matchString (con, op.elementAt(i), offset, dx, opts);
293
                      int ret = this. matchCharacterIterator (con, op.elementAt(i), offset, dx, opts);
293
                      if (DEBUG) {
294
                      if (DEBUG) {
294
                          System.err.println("UNION: "+i+", ret="+ret);
295
                          System.err.println("UNION: "+i+", ret="+ret);
295
                      }
296
                      }
296
                      if (ret >= 0)  return ret;
297
                      if (ret >= 0)  return ret;
297
                  }
298
                  }
298
                  return -1;
299
                  return -1;
299
              case Op.CAPTURE:
300
              case Op.CAPTURE:
300
                  int refno = op.getData();
301
                  int refno = op.getData();
301
                  if (con.match != null && refno > 0) {
302
                  if (con.match != null && refno > 0) {
302
                      int save = con.match.getBeginning(refno);
303
                      int save = con.match.getBeginning(refno);
303
                      con.match.setBeginning(refno, offset);
304
                      con.match.setBeginning(refno, offset);
304
                      int ret = this. matchString (con, op.next, offset, dx, opts);
305
                      int ret = this. matchCharacterIterator (con, op.next, offset, dx, opts);
305
                      if (ret < 0)  con.match.setBeginning(refno, save);
306
                      if (ret < 0)  con.match.setBeginning(refno, save);
306
                      return ret;
307
                      return ret;
307
                  } else if (con.match != null && refno < 0) {
308
                  } else if (con.match != null && refno < 0) {
308
                      int index = -refno;
309
                      int index = -refno;
309
                      int save = con.match.getEnd(index);
310
                      int save = con.match.getEnd(index);
310
                      con.match.setEnd(index, offset);
311
                      con.match.setEnd(index, offset);
311
                      int ret = this. matchString (con, op.next, offset, dx, opts);
312
                      int ret = this. matchCharacterIterator (con, op.next, offset, dx, opts);
312
                      if (ret < 0)  con.match.setEnd(index, save);
313
                      if (ret < 0)  con.match.setEnd(index, save);
313
                      return ret;
314
                      return ret;
314
                  }
315
                  }
315
                  op = op.next;
316
                  op = op.next;
316
                  break;
317
                  break;
317
              case Op.LOOKAHEAD:
318
              case Op.LOOKAHEAD:
318
                  if (0 > this. matchString (con, op.getChild(), offset, 1, opts))  return -1;
319
                  if (0 > this. matchCharacterIterator (con, op.getChild(), offset, 1, opts))  return -1;
319
                  op = op.next;
320
                  op = op.next;
320
                  break;
321
                  break;
321
              case Op.NEGATIVELOOKAHEAD:
322
              case Op.NEGATIVELOOKAHEAD:
322
                  if (0 <= this. matchString (con, op.getChild(), offset, 1, opts))  return -1;
323
                  if (0 <= this. matchCharacterIterator (con, op.getChild(), offset, 1, opts))  return -1;
323
                  op = op.next;
324
                  op = op.next;
324
                  break;
325
                  break;
325
              case Op.LOOKBEHIND:
326
              case Op.LOOKBEHIND:
326
                  if (0 > this. matchString (con, op.getChild(), offset, -1, opts))  return -1;
327
                  if (0 > this. matchCharacterIterator (con, op.getChild(), offset, -1, opts))  return -1;
327
                  op = op.next;
328
                  op = op.next;
328
                  break;
329
                  break;
329
              case Op.NEGATIVELOOKBEHIND:
330
              case Op.NEGATIVELOOKBEHIND:
330
                  if (0 <= this. matchString (con, op.getChild(), offset, -1, opts))  return -1;
331
                  if (0 <= this. matchCharacterIterator (con, op.getChild(), offset, -1, opts))  return -1;
331
                  op = op.next;
332
                  op = op.next;
332
                  break;
333
                  break;
333
              case Op.INDEPENDENT:
334
              case Op.INDEPENDENT:
334
                  {
335
                  {
335
                      int ret = this. matchString (con, op.getChild(), offset, dx, opts);
336
                      int ret = this. matchCharacterIterator (con, op.getChild(), offset, dx, opts);
336
                      if (ret < 0)  return ret;
337
                      if (ret < 0)  return ret;
337
                      offset = ret;
338
                      offset = ret;
338
                      op = op.next;
339
                      op = op.next;
339
                  }
340
                  }
340
                  break;
341
                  break;
341
              case Op.MODIFIER:
342
              case Op.MODIFIER:
342
                  {
343
                  {
343
                      int localopts = opts;
344
                      int localopts = opts;
344
                      localopts |= op.getData();
345
                      localopts |= op.getData();
345
                      localopts &= ~op.getData2();
346
                      localopts &= ~op.getData2();
346
                      //System.err.println("MODIFIER: "+Integer.toString(opts, 16)+" -> "+Integer.toString(localopts, 16));
347
                      //System.err.println("MODIFIER: "+Integer.toString(opts, 16)+" -> "+Integer.toString(localopts, 16));
347
                      int ret = this. matchString (con, op.getChild(), offset, dx, localopts);
348
                      int ret = this. matchCharacterIterator (con, op.getChild(), offset, dx, localopts);
348
                      if (ret < 0)  return ret;
349
                      if (ret < 0)  return ret;
349
                      offset = ret;
350
                      offset = ret;
350
                      op = op.next;
351
                      op = op.next;
351
                  }
352
                  }
352
                  break;
353
                  break;
353
              case Op.CONDITION:
354
              case Op.CONDITION:
354
                  {
355
                  {
355
                      Op.ConditionOp cop = (Op.ConditionOp)op;
356
                      Op.ConditionOp cop = (Op.ConditionOp)op;
356
                      boolean matchp = false;
357
                      boolean matchp = false;
357
                      if (cop.refNumber > 0) {
358
                      if (cop.refNumber > 0) {
358
                          if (cop.refNumber >= this.nofparen)
359
                          if (cop.refNumber >= this.nofparen)
359
                              throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber);
360
                              throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber);
360
                          matchp = con.match.getBeginning(cop.refNumber) >= 0
361
                          matchp = con.match.getBeginning(cop.refNumber) >= 0
361
                                   && con.match.getEnd(cop.refNumber) >= 0;
362
                                   && con.match.getEnd(cop.refNumber) >= 0;
362
                      } else {
363
                      } else {
363
                          matchp = 0 <= this. matchString (con, cop.condition, offset, dx, opts);
364
                          matchp = 0 <= this. matchCharacterIterator (con, cop.condition, offset, dx, opts);
364
                      }
365
                      }
365
                      if (matchp) {
366
                      if (matchp) {
366
                          op = cop.yes;
367
                          op = cop.yes;
367
                      } else if (cop.no != null) {
368
                      } else if (cop.no != null) {
368
                          op = cop.no;
369
                          op = cop.no;
369
                      } else {
370
                      } else {
370
                          op = cop.next;
371
                          op = cop.next;
371
                      }
372
                      }
372
                  }
373
                  }
373
                  break;
374
                  break;
374
              default:
375
              default:
375
                  throw new RuntimeException("Unknown operation type: "+op.type);
376
                  throw new RuntimeException("Unknown operation type: "+op.type);
376
              }
377
              }
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)170.2
Clones locationClones are declared in the same class
Number of node comparisons7243
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements309
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3863.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    switch (op.type)
    7
    switch (op.type)
    8
    case Op.CHAR:
    8
    case Op.CHAR:
    9
    if (isSet(opts, IGNORE_CASE))
    9
    if (isSet(opts, IGNORE_CASE))
    10
    int ch = op.getData();
    10
    int ch = op.getData();
    11
    if (dx > 0)
    11
    if (dx > 0)
    12
    if (offset >= con.limit || !matchIgnoreCase(ch, target.charAt(offset)))
    12
    if (offset >= con.limit || !matchIgnoreCase(ch, target.charAt(offset)))
    12
    if (offset >= con.limit || !matchIgnoreCase(ch, target.setIndex(offset)))
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    12
    if (offset >= con.limit || !matchIgnoreCase(ch, target.setIndex(offset)))
    13
    return -1;
    13
    return -1;
    14
    offset++;
    14
    offset++;
    else
    else
    15
    int o1 = offset - 1;
    15
    int o1 = offset - 1;
    16
    if (o1 >= con.limit || o1 < 0 || !matchIgnoreCase(ch, target.charAt(o1)))
    16
    if (o1 >= con.limit || o1 < 0 || !matchIgnoreCase(ch, target.charAt(o1)))
    16
    if (o1 >= con.limit || o1 < 0 || !matchIgnoreCase(ch, target.setIndex(o1)))
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    16
    if (o1 >= con.limit || o1 < 0 || !matchIgnoreCase(ch, target.setIndex(o1)))
    17
    return -1;
    17
    return -1;
    18
    offset = o1;
    18
    offset = o1;
    else
    else
    19
    int ch = op.getData();
    19
    int ch = op.getData();
    20
    if (dx > 0)
    20
    if (dx > 0)
    21
    if (offset >= con.limit || ch != target.charAt(offset))
    21
    if (offset >= con.limit || ch != target.charAt(offset))
    21
    if (offset >= con.limit || ch != target.setIndex(offset))
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    21
    if (offset >= con.limit || ch != target.setIndex(offset))
    22
    return -1;
    22
    return -1;
    23
    offset++;
    23
    offset++;
    else
    else
    24
    int o1 = offset - 1;
    24
    int o1 = offset - 1;
    25
    if (o1 >= con.limit || o1 < 0 || ch != target.charAt(o1))
    25
    if (o1 >= con.limit || o1 < 0 || ch != target.charAt(o1))
    25
    if (o1 >= con.limit || o1 < 0 || ch != target.setIndex(o1))
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    25
    if (o1 >= con.limit || o1 < 0 || ch != target.setIndex(o1))
    26
    return -1;
    26
    return -1;
    27
    offset = o1;
    27
    offset = o1;
    28
    op = op.next;
    28
    op = op.next;
    29
    break;
    29
    break;
    30
    case Op.DOT:
    30
    case Op.DOT:
    31
    if (dx > 0)
    31
    if (dx > 0)
    32
    if (offset >= con.limit)
    32
    if (offset >= con.limit)
    33
    return -1;
    33
    return -1;
    34
    int ch = target.charAt(offset);
    34
    int ch = target.charAt(offset);
    34
    int ch = target.setIndex(offset);
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    34
    int ch = target.setIndex(offset);
    35
    if (isSet(opts, SINGLE_LINE))
    35
    if (isSet(opts, SINGLE_LINE))
    36
    if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit)
    36
    if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit)
    37
    offset++;
    37
    offset++;
    else
    else
    38
    if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit)
    38
    if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit)
    39
    ch = REUtil.composeFromSurrogates(ch, target.charAt(++offset));
    39
    ch = REUtil.composeFromSurrogates(ch, target.charAt(++offset));
    39
    ch = REUtil.composeFromSurrogates(ch, target.setIndex(++offset));
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    39
    ch = REUtil.composeFromSurrogates(ch, target.setIndex(++offset));
    40
    if (isEOLChar(ch))
    40
    if (isEOLChar(ch))
    41
    return -1;
    41
    return -1;
    42
    offset++;
    42
    offset++;
    else
    else
    43
    int o1 = offset - 1;
    43
    int o1 = offset - 1;
    44
    if (o1 >= con.limit || o1 < 0)
    44
    if (o1 >= con.limit || o1 < 0)
    45
    return -1;
    45
    return -1;
    46
    int ch = target.charAt(o1);
    46
    int ch = target.charAt(o1);
    46
    int ch = target.setIndex(o1);
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    46
    int ch = target.setIndex(o1);
    47
    if (isSet(opts, SINGLE_LINE))
    47
    if (isSet(opts, SINGLE_LINE))
    48
    if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0)
    48
    if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0)
    49
    o1--;
    49
    o1--;
    else
    else
    50
    if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0)
    50
    if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0)
    51
    ch = REUtil.composeFromSurrogates(target.charAt(--o1), ch);
    51
    ch = REUtil.composeFromSurrogates(target.charAt(--o1), ch);
    51
    ch = REUtil.composeFromSurrogates(target.setIndex(--o1), ch);
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    51
    ch = REUtil.composeFromSurrogates(target.setIndex(--o1), ch);
    52
    if (!isEOLChar(ch))
    52
    if (!isEOLChar(ch))
    53
    return -1;
    53
    return -1;
    54
    offset = o1;
    54
    offset = o1;
    55
    op = op.next;
    55
    op = op.next;
    56
    break;
    56
    break;
    57
    case Op.RANGE:
    57
    case Op.RANGE:
    58
    case Op.NRANGE:
    58
    case Op.NRANGE:
    59
    if (dx > 0)
    59
    if (dx > 0)
    60
    if (offset >= con.limit)
    60
    if (offset >= con.limit)
    61
    return -1;
    61
    return -1;
    62
    int ch = target.charAt(offset);
    62
    int ch = target.charAt(offset);
    62
    int ch = target.setIndex(offset);
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    62
    int ch = target.setIndex(offset);
    63
    if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit)
    63
    if (REUtil.isHighSurrogate(ch) && offset + 1 < con.limit)
    64
    ch = REUtil.composeFromSurrogates(ch, target.charAt(++offset));
    64
    ch = REUtil.composeFromSurrogates(ch, target.charAt(++offset));
    64
    ch = REUtil.composeFromSurrogates(ch, target.setIndex(++offset));
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    64
    ch = REUtil.composeFromSurrogates(ch, target.setIndex(++offset));
    65
    RangeToken tok = op.getToken();
    65
    RangeToken tok = op.getToken();
    66
    if (isSet(opts, IGNORE_CASE))
    66
    if (isSet(opts, IGNORE_CASE))
    67
    tok = tok.getCaseInsensitiveToken();
    67
    tok = tok.getCaseInsensitiveToken();
    68
    if (!tok.match(ch))
    68
    if (!tok.match(ch))
    69
    if (ch >= 0x10000)
    69
    if (ch >= 0x10000)
    70
    return -1;
    70
    return -1;
    71
    char uch;
    71
    char uch;
    72
    if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch)))
    72
    if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch)))
    73
    return -1;
    73
    return -1;
    else
    else
    74
    if (!tok.match(ch))
    74
    if (!tok.match(ch))
    75
    return -1;
    75
    return -1;
    76
    offset++;
    76
    offset++;
    else
    else
    77
    int o1 = offset - 1;
    77
    int o1 = offset - 1;
    78
    if (o1 >= con.limit || o1 < 0)
    78
    if (o1 >= con.limit || o1 < 0)
    79
    return -1;
    79
    return -1;
    80
    int ch = target.charAt(o1);
    80
    int ch = target.charAt(o1);
    80
    int ch = target.setIndex(o1);
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    80
    int ch = target.setIndex(o1);
    81
    if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0)
    81
    if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0)
    82
    ch = REUtil.composeFromSurrogates(target.charAt(--o1), ch);
    82
    ch = REUtil.composeFromSurrogates(target.charAt(--o1), ch);
    82
    ch = REUtil.composeFromSurrogates(target.setIndex(--o1), ch);
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    82
    ch = REUtil.composeFromSurrogates(target.setIndex(--o1), ch);
    83
    RangeToken tok = op.getToken();
    83
    RangeToken tok = op.getToken();
    84
    if (isSet(opts, IGNORE_CASE))
    84
    if (isSet(opts, IGNORE_CASE))
    85
    tok = tok.getCaseInsensitiveToken();
    85
    tok = tok.getCaseInsensitiveToken();
    86
    if (!tok.match(ch))
    86
    if (!tok.match(ch))
    87
    if (ch >= 0x10000)
    87
    if (ch >= 0x10000)
    88
    return -1;
    88
    return -1;
    89
    char uch;
    89
    char uch;
    90
    if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch)))
    90
    if (!tok.match(uch = Character.toUpperCase((char)ch)) && !tok.match(Character.toLowerCase(uch)))
    91
    return -1;
    91
    return -1;
    else
    else
    92
    if (!tok.match(ch))
    92
    if (!tok.match(ch))
    93
    return -1;
    93
    return -1;
    94
    offset = o1;
    94
    offset = o1;
    95
    op = op.next;
    95
    op = op.next;
    96
    break;
    96
    break;
    97
    case Op.ANCHOR:
    97
    case Op.ANCHOR:
    98
    boolean go = false;
    98
    boolean go = false;
    99
    switch (op.getData())
    99
    switch (op.getData())
    100
    case '^':
    100
    case '^':
    101
    if (isSet(opts, MULTIPLE_LINES))
    101
    if (isSet(opts, MULTIPLE_LINES))
    102
    if (!(offset == con.start || offset > con.start && isEOLChar(target.charAt(offset - 1))))
    102
    if (!(offset == con.start || offset > con.start && isEOLChar(target.charAt(offset - 1))))
    102
    if (!(offset == con.start || offset > con.start && isEOLChar(target.setIndex(offset - 1))))
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(offset - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    102
    if (!(offset == con.start || offset > con.start && isEOLChar(target.setIndex(offset - 1))))
    103
    return -1;
    103
    return -1;
    else
    else
    104
    if (offset != con.start)
    104
    if (offset != con.start)
    105
    return -1;
    105
    return -1;
    106
    break;
    106
    break;
    107
    case '@':
    107
    case '@':
    108
    if (!(offset == con.start || offset > con.start && isEOLChar(target.charAt(offset - 1))))
    108
    if (!(offset == con.start || offset > con.start && isEOLChar(target.charAt(offset - 1))))
    108
    if (!(offset == con.start || offset > con.start && isEOLChar(target.setIndex(offset - 1))))
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(offset - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    108
    if (!(offset == con.start || offset > con.start && isEOLChar(target.setIndex(offset - 1))))
    109
    return -1;
    109
    return -1;
    110
    break;
    110
    break;
    111
    case '$':
    111
    case '$':
    112
    if (isSet(opts, MULTIPLE_LINES))
    112
    if (isSet(opts, MULTIPLE_LINES))
    113
    if (!(offset == con.limit || offset < con.limit && isEOLChar(target.charAt(offset))))
    113
    if (!(offset == con.limit || offset < con.limit && isEOLChar(target.charAt(offset))))
    113
    if (!(offset == con.limit || offset < con.limit && isEOLChar(target.setIndex(offset))))
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    113
    if (!(offset == con.limit || offset < con.limit && isEOLChar(target.setIndex(offset))))
    114
    return -1;
    114
    return -1;
    else
    else
    115
    if (!(offset == con.limit || offset + 1 == con.limit && isEOLChar(target.charAt(offset)) || offset + 2 == con.limit && target.charAt(offset) == CARRIAGE_RETURN && target.charAt(offset + 1) == LINE_FEED))
    115
    if (!(offset == con.limit || offset + 1 == con.limit && isEOLChar(target.charAt(offset)) || offset + 2 == con.limit && target.charAt(offset) == CARRIAGE_RETURN && target.charAt(offset + 1) == LINE_FEED))
    115
    if (!(offset == con.limit || offset + 1 == con.limit && isEOLChar(target.setIndex(offset)) || offset + 2 == con.limit && target.setIndex(offset) == CARRIAGE_RETURN && target.setIndex(offset + 1) == LINE_FEED))
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    Expression target.charAt(offset + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    115
    if (!(offset == con.limit || offset + 1 == con.limit && isEOLChar(target.setIndex(offset)) || offset + 2 == con.limit && target.setIndex(offset) == CARRIAGE_RETURN && target.setIndex(offset + 1) == LINE_FEED))
    116
    return -1;
    116
    return -1;
    117
    break;
    117
    break;
    118
    case 'A':
    118
    case 'A':
    119
    if (offset != con.start)
    119
    if (offset != con.start)
    120
    return -1;
    120
    return -1;
    121
    break;
    121
    break;
    122
    case 'Z':
    122
    case 'Z':
    123
    if (!(offset == con.limit || offset + 1 == con.limit && isEOLChar(target.charAt(offset)) || offset + 2 == con.limit && target.charAt(offset) == CARRIAGE_RETURN && target.charAt(offset + 1) == LINE_FEED))
    123
    if (!(offset == con.limit || offset + 1 == con.limit && isEOLChar(target.charAt(offset)) || offset + 2 == con.limit && target.charAt(offset) == CARRIAGE_RETURN && target.charAt(offset + 1) == LINE_FEED))
    123
    if (!(offset == con.limit || offset + 1 == con.limit && isEOLChar(target.setIndex(offset)) || offset + 2 == con.limit && target.setIndex(offset) == CARRIAGE_RETURN && target.setIndex(offset + 1) == LINE_FEED))
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    Expression target.charAt(offset + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(offset + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    123
    if (!(offset == con.limit || offset + 1 == con.limit && isEOLChar(target.setIndex(offset)) || offset + 2 == con.limit && target.setIndex(offset) == CARRIAGE_RETURN && target.setIndex(offset + 1) == LINE_FEED))
    124
    return -1;
    124
    return -1;
    125
    break;
    125
    break;
    126
    case 'z':
    126
    case 'z':
    127
    if (offset != con.limit)
    127
    if (offset != con.limit)
    128
    return -1;
    128
    return -1;
    129
    break;
    129
    break;
    130
    case 'b':
    130
    case 'b':
    131
    if (con.length == 0)
    131
    if (con.length == 0)
    132
    return -1;
    132
    return -1;
    133
    int after = getWordType(target, con.start, con.limit, offset, opts);
    133
    int after = getWordType(target, con.start, con.limit, offset, opts);
    133
    int after = getWordType(target, con.start, con.limit, offset, opts);
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    133
    int after = getWordType(target, con.start, con.limit, offset, opts);
    134
    if (after == WT_IGNORE)
    134
    if (after == WT_IGNORE)
    135
    return -1;
    135
    return -1;
    136
    int before = getPreviousWordType(target, con.start, con.limit, offset, opts);
    136
    int before = getPreviousWordType(target, con.start, con.limit, offset, opts);
    136
    int before = getPreviousWordType(target, con.start, con.limit, offset, opts);
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    136
    int before = getPreviousWordType(target, con.start, con.limit, offset, opts);
    137
    if (after == before)
    137
    if (after == before)
    138
    return -1;
    138
    return -1;
    139
    break;
    139
    break;
    140
    case 'B':
    140
    case 'B':
    141
    if (con.length == 0)
    141
    if (con.length == 0)
    142
    go = true;
    142
    go = true;
    else
    else
    143
    int after = getWordType(target, con.start, con.limit, offset, opts);
    143
    int after = getWordType(target, con.start, con.limit, offset, opts);
    143
    int after = getWordType(target, con.start, con.limit, offset, opts);
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    143
    int after = getWordType(target, con.start, con.limit, offset, opts);
    144
    go = after == WT_IGNORE || after == getPreviousWordType(target, con.start, con.limit, offset, opts);
    144
    go = after == WT_IGNORE || after == getPreviousWordType(target, con.start, con.limit, offset, opts);
    144
    go = after == WT_IGNORE || after == getPreviousWordType(target, con.start, con.limit, offset, opts);
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    144
    go = after == WT_IGNORE || after == getPreviousWordType(target, con.start, con.limit, offset, opts);
    145
    if (!go)
    145
    if (!go)
    146
    return -1;
    146
    return -1;
    147
    break;
    147
    break;
    148
    case '<':
    148
    case '<':
    149
    if (con.length == 0 || offset == con.limit)
    149
    if (con.length == 0 || offset == con.limit)
    150
    return -1;
    150
    return -1;
    151
    if (getWordType(target, con.start, con.limit, offset, opts) != WT_LETTER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_OTHER)
    151
    if (getWordType(target, con.start, con.limit, offset, opts) != WT_LETTER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_OTHER)
    151
    if (getWordType(target, con.start, con.limit, offset, opts) != WT_LETTER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_OTHER)
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    151
    if (getWordType(target, con.start, con.limit, offset, opts) != WT_LETTER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_OTHER)
    152
    return -1;
    152
    return -1;
    153
    break;
    153
    break;
    154
    case '>':
    154
    case '>':
    155
    if (con.length == 0 || offset == con.start)
    155
    if (con.length == 0 || offset == con.start)
    156
    return -1;
    156
    return -1;
    157
    if (getWordType(target, con.start, con.limit, offset, opts) != WT_OTHER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_LETTER)
    157
    if (getWordType(target, con.start, con.limit, offset, opts) != WT_OTHER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_LETTER)
    157
    if (getWordType(target, con.start, con.limit, offset, opts) != WT_OTHER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_LETTER)
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    157
    if (getWordType(target, con.start, con.limit, offset, opts) != WT_OTHER || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_LETTER)
    158
    return -1;
    158
    return -1;
    159
    break;
    159
    break;
    160
    op = op.next;
    160
    op = op.next;
    161
    break;
    161
    break;
    162
    case Op.BACKREFERENCE:
    162
    case Op.BACKREFERENCE:
    163
    int refno = op.getData();
    163
    int refno = op.getData();
    164
    if (refno <= 0 || refno >= this.nofparen)
    164
    if (refno <= 0 || refno >= this.nofparen)
    165
    throw new RuntimeException("Internal Error: Reference number must be more than zero: " + refno);
    165
    throw new RuntimeException("Internal Error: Reference number must be more than zero: " + refno);
    166
    if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0)
    166
    if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0)
    167
    return -1;
    167
    return -1;
    168
    int o2 = con.match.getBeginning(refno);
    168
    int o2 = con.match.getBeginning(refno);
    169
    int literallen = con.match.getEnd(refno) - o2;
    169
    int literallen = con.match.getEnd(refno) - o2;
    170
    if (!isSet(opts, IGNORE_CASE))
    170
    if (!isSet(opts, IGNORE_CASE))
    171
    if (dx > 0)
    171
    if (dx > 0)
    172
    if (!regionMatches(target, offset, con.limit, o2, literallen))
    172
    if (!regionMatches(target, offset, con.limit, o2, literallen))
    172
    if (!regionMatches(target, offset, con.limit, o2, literallen))
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    172
    if (!regionMatches(target, offset, con.limit, o2, literallen))
    173
    return -1;
    173
    return -1;
    174
    offset += literallen;
    174
    offset += literallen;
    else
    else
    175
    if (!regionMatches(target, offset - literallen, con.limit, o2, literallen))
    175
    if (!regionMatches(target, offset - literallen, con.limit, o2, literallen))
    175
    if (!regionMatches(target, offset - literallen, con.limit, o2, literallen))
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    175
    if (!regionMatches(target, offset - literallen, con.limit, o2, literallen))
    176
    return -1;
    176
    return -1;
    177
    offset -= literallen;
    177
    offset -= literallen;
    else
    else
    178
    if (dx > 0)
    178
    if (dx > 0)
    179
    if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))
    179
    if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))
    179
    if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    179
    if (!regionMatchesIgnoreCase(target, offset, con.limit, o2, literallen))
    180
    return -1;
    180
    return -1;
    181
    offset += literallen;
    181
    offset += literallen;
    else
    else
    182
    if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, o2, literallen))
    182
    if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, o2, literallen))
    182
    if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, o2, literallen))
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    182
    if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, o2, literallen))
    183
    return -1;
    183
    return -1;
    184
    offset -= literallen;
    184
    offset -= literallen;
    185
    op = op.next;
    185
    op = op.next;
    186
    break;
    186
    break;
    187
    case Op.STRING:
    187
    case Op.STRING:
    188
    String literal = op.getString();
    188
    String literal = op.getString();
    189
    int literallen = literal.length();
    189
    int literallen = literal.length();
    190
    if (!isSet(opts, IGNORE_CASE))
    190
    if (!isSet(opts, IGNORE_CASE))
    191
    if (dx > 0)
    191
    if (dx > 0)
    192
    if (!regionMatches(target, offset, con.limit, literal, literallen))
    192
    if (!regionMatches(target, offset, con.limit, literal, literallen))
    192
    if (!regionMatches(target, offset, con.limit, literal, literallen))
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    192
    if (!regionMatches(target, offset, con.limit, literal, literallen))
    193
    return -1;
    193
    return -1;
    194
    offset += literallen;
    194
    offset += literallen;
    else
    else
    195
    if (!regionMatches(target, offset - literallen, con.limit, literal, literallen))
    195
    if (!regionMatches(target, offset - literallen, con.limit, literal, literallen))
    195
    if (!regionMatches(target, offset - literallen, con.limit, literal, literallen))
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    195
    if (!regionMatches(target, offset - literallen, con.limit, literal, literallen))
    196
    return -1;
    196
    return -1;
    197
    offset -= literallen;
    197
    offset -= literallen;
    else
    else
    198
    if (dx > 0)
    198
    if (dx > 0)
    199
    if (!regionMatchesIgnoreCase(target, offset, con.limit, literal, literallen))
    199
    if (!regionMatchesIgnoreCase(target, offset, con.limit, literal, literallen))
    199
    if (!regionMatchesIgnoreCase(target, offset, con.limit, literal, literallen))
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    199
    if (!regionMatchesIgnoreCase(target, offset, con.limit, literal, literallen))
    200
    return -1;
    200
    return -1;
    201
    offset += literallen;
    201
    offset += literallen;
    else
    else
    202
    if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, literal, literallen))
    202
    if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, literal, literallen))
    202
    if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, literal, literallen))
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    202
    if (!regionMatchesIgnoreCase(target, offset - literallen, con.limit, literal, literallen))
    203
    return -1;
    203
    return -1;
    204
    offset -= literallen;
    204
    offset -= literallen;
    205
    op = op.next;
    205
    op = op.next;
    206
    break;
    206
    break;
    207
    case Op.CLOSURE:
    207
    case Op.CLOSURE:
    208
    int id = op.getData();
    208
    int id = op.getData();
    209
    if (id >= 0)
    209
    if (id >= 0)
    210
    int previousOffset = con.offsets[id];
    210
    int previousOffset = con.offsets[id];
    211
    if (previousOffset < 0 || previousOffset != offset)
    211
    if (previousOffset < 0 || previousOffset != offset)
    212
    con.offsets[id] = offset;
    212
    con.offsets[id] = offset;
    else
    else
    213
    con.offsets[id] = -1;
    213
    con.offsets[id] = -1;
    214
    op = op.next;
    214
    op = op.next;
    215
    break;
    215
    break;
    216
    int ret = this.matchString(con, op.getChild(), offset, dx, opts);
    216
    int ret = this.matchString(con, op.getChild(), offset, dx, opts);
    216
    int ret = this.matchCharacterIterator(con, op.getChild(), offset, dx, opts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    216
    int ret = this.matchCharacterIterator(con, op.getChild(), offset, dx, opts);
    217
    if (id >= 0)
    217
    if (id >= 0)
    218
    con.offsets[id] = -1;
    218
    con.offsets[id] = -1;
    219
    if (ret >= 0)
    219
    if (ret >= 0)
    220
    return ret;
    220
    return ret;
    221
    op = op.next;
    221
    op = op.next;
    222
    break;
    222
    break;
    223
    case Op.QUESTION:
    223
    case Op.QUESTION:
    224
    int ret = this.matchString(con, op.getChild(), offset, dx, opts);
    224
    int ret = this.matchString(con, op.getChild(), offset, dx, opts);
    224
    int ret = this.matchCharacterIterator(con, op.getChild(), offset, dx, opts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    224
    int ret = this.matchCharacterIterator(con, op.getChild(), offset, dx, opts);
    225
    if (ret >= 0)
    225
    if (ret >= 0)
    226
    return ret;
    226
    return ret;
    227
    op = op.next;
    227
    op = op.next;
    228
    break;
    228
    break;
    229
    case Op.NONGREEDYCLOSURE:
    229
    case Op.NONGREEDYCLOSURE:
    230
    case Op.NONGREEDYQUESTION:
    230
    case Op.NONGREEDYQUESTION:
    231
    int ret = this.matchString(con, op.next, offset, dx, opts);
    231
    int ret = this.matchString(con, op.next, offset, dx, opts);
    231
    int ret = this.matchCharacterIterator(con, op.next, offset, dx, opts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    231
    int ret = this.matchCharacterIterator(con, op.next, offset, dx, opts);
    232
    if (ret >= 0)
    232
    if (ret >= 0)
    233
    return ret;
    233
    return ret;
    234
    op = op.getChild();
    234
    op = op.getChild();
    235
    break;
    235
    break;
    236
    case Op.UNION:
    236
    case Op.UNION:
    237
    for (int i = 0; i < op.size(); i++)
    237
    for (int i = 0; i < op.size(); i++)
    238
    int ret = this.matchString(con, op.elementAt(i), offset, dx, opts);
    238
    int ret = this.matchString(con, op.elementAt(i), offset, dx, opts);
    238
    int ret = this.matchCharacterIterator(con, op.elementAt(i), offset, dx, opts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.elementAt(i),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.elementAt(i),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    238
    int ret = this.matchCharacterIterator(con, op.elementAt(i), offset, dx, opts);
    239
    if (DEBUG)
    239
    if (DEBUG)
    240
    System.err.println("UNION: " + i + ", ret=" + ret);
    240
    System.err.println("UNION: " + i + ", ret=" + ret);
    241
    if (ret >= 0)
    241
    if (ret >= 0)
    242
    return ret;
    242
    return ret;
    243
    return -1;
    243
    return -1;
    244
    case Op.CAPTURE:
    244
    case Op.CAPTURE:
    245
    int refno = op.getData();
    245
    int refno = op.getData();
    246
    if (con.match != null && refno > 0)
    246
    if (con.match != null && refno > 0)
    247
    int save = con.match.getBeginning(refno);
    247
    int save = con.match.getBeginning(refno);
    248
    con.match.setBeginning(refno, offset);
    248
    con.match.setBeginning(refno, offset);
    249
    int ret = this.matchString(con, op.next, offset, dx, opts);
    249
    int ret = this.matchString(con, op.next, offset, dx, opts);
    249
    int ret = this.matchCharacterIterator(con, op.next, offset, dx, opts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    249
    int ret = this.matchCharacterIterator(con, op.next, offset, dx, opts);
    250
    if (ret < 0)
    250
    if (ret < 0)
    251
    con.match.setBeginning(refno, save);
    251
    con.match.setBeginning(refno, save);
    252
    return ret;
    252
    return ret;
    253
    else if (con.match != null && refno < 0)
    253
    else if (con.match != null && refno < 0)
    254
    int index = -refno;
    254
    int index = -refno;
    255
    int save = con.match.getEnd(index);
    255
    int save = con.match.getEnd(index);
    256
    con.match.setEnd(index, offset);
    256
    con.match.setEnd(index, offset);
    257
    int ret = this.matchString(con, op.next, offset, dx, opts);
    257
    int ret = this.matchString(con, op.next, offset, dx, opts);
    257
    int ret = this.matchCharacterIterator(con, op.next, offset, dx, opts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    257
    int ret = this.matchCharacterIterator(con, op.next, offset, dx, opts);
    258
    if (ret < 0)
    258
    if (ret < 0)
    259
    con.match.setEnd(index, save);
    259
    con.match.setEnd(index, save);
    260
    return ret;
    260
    return ret;
    261
    op = op.next;
    261
    op = op.next;
    262
    break;
    262
    break;
    263
    case Op.LOOKAHEAD:
    263
    case Op.LOOKAHEAD:
    264
    if (0 > this.matchString(con, op.getChild(), offset, 1, opts))
    264
    if (0 > this.matchString(con, op.getChild(), offset, 1, opts))
    264
    if (0 > this.matchCharacterIterator(con, op.getChild(), offset, 1, opts))
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    264
    if (0 > this.matchCharacterIterator(con, op.getChild(), offset, 1, opts))
    265
    return -1;
    265
    return -1;
    266
    op = op.next;
    266
    op = op.next;
    267
    break;
    267
    break;
    268
    case Op.NEGATIVELOOKAHEAD:
    268
    case Op.NEGATIVELOOKAHEAD:
    269
    if (0 <= this.matchString(con, op.getChild(), offset, 1, opts))
    269
    if (0 <= this.matchString(con, op.getChild(), offset, 1, opts))
    269
    if (0 <= this.matchCharacterIterator(con, op.getChild(), offset, 1, opts))
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    269
    if (0 <= this.matchCharacterIterator(con, op.getChild(), offset, 1, opts))
    270
    return -1;
    270
    return -1;
    271
    op = op.next;
    271
    op = op.next;
    272
    break;
    272
    break;
    273
    case Op.LOOKBEHIND:
    273
    case Op.LOOKBEHIND:
    274
    if (0 > this.matchString(con, op.getChild(), offset, -1, opts))
    274
    if (0 > this.matchString(con, op.getChild(), offset, -1, opts))
    274
    if (0 > this.matchCharacterIterator(con, op.getChild(), offset, -1, opts))
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.getChild(),offset,-1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.getChild(),offset,-1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    274
    if (0 > this.matchCharacterIterator(con, op.getChild(), offset, -1, opts))
    275
    return -1;
    275
    return -1;
    276
    op = op.next;
    276
    op = op.next;
    277
    break;
    277
    break;
    278
    case Op.NEGATIVELOOKBEHIND:
    278
    case Op.NEGATIVELOOKBEHIND:
    279
    if (0 <= this.matchString(con, op.getChild(), offset, -1, opts))
    279
    if (0 <= this.matchString(con, op.getChild(), offset, -1, opts))
    279
    if (0 <= this.matchCharacterIterator(con, op.getChild(), offset, -1, opts))
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.getChild(),offset,-1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.getChild(),offset,-1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    279
    if (0 <= this.matchCharacterIterator(con, op.getChild(), offset, -1, opts))
    280
    return -1;
    280
    return -1;
    281
    op = op.next;
    281
    op = op.next;
    282
    break;
    282
    break;
    283
    case Op.INDEPENDENT:
    283
    case Op.INDEPENDENT:
    284
    int ret = this.matchString(con, op.getChild(), offset, dx, opts);
    284
    int ret = this.matchString(con, op.getChild(), offset, dx, opts);
    284
    int ret = this.matchCharacterIterator(con, op.getChild(), offset, dx, opts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    284
    int ret = this.matchCharacterIterator(con, op.getChild(), offset, dx, opts);
    285
    if (ret < 0)
    285
    if (ret < 0)
    286
    return ret;
    286
    return ret;
    287
    offset = ret;
    287
    offset = ret;
    288
    op = op.next;
    288
    op = op.next;
    289
    break;
    289
    break;
    290
    case Op.MODIFIER:
    290
    case Op.MODIFIER:
    291
    int localopts = opts;
    291
    int localopts = opts;
    292
    localopts |= op.getData();
    292
    localopts |= op.getData();
    293
    localopts &= ~op.getData2();
    293
    localopts &= ~op.getData2();
    294
    int ret = this.matchString(con, op.getChild(), offset, dx, localopts);
    294
    int ret = this.matchString(con, op.getChild(), offset, dx, localopts);
    294
    int ret = this.matchCharacterIterator(con, op.getChild(), offset, dx, localopts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.getChild(),offset,dx,localopts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.getChild(),offset,dx,localopts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    294
    int ret = this.matchCharacterIterator(con, op.getChild(), offset, dx, localopts);
    295
    if (ret < 0)
    295
    if (ret < 0)
    296
    return ret;
    296
    return ret;
    297
    offset = ret;
    297
    offset = ret;
    298
    op = op.next;
    298
    op = op.next;
    299
    break;
    299
    break;
    300
    case Op.CONDITION:
    300
    case Op.CONDITION:
    301
    Op.ConditionOp cop = (Op.ConditionOp)op;
    301
    Op.ConditionOp cop = (Op.ConditionOp)op;
    302
    boolean matchp = false;
    302
    boolean matchp = false;
    303
    if (cop.refNumber > 0)
    303
    if (cop.refNumber > 0)
    304
    if (cop.refNumber >= this.nofparen)
    304
    if (cop.refNumber >= this.nofparen)
    305
    throw new RuntimeException("Internal Error: Reference number must be more than zero: " + cop.refNumber);
    305
    throw new RuntimeException("Internal Error: Reference number must be more than zero: " + cop.refNumber);
    306
    matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0;
    306
    matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0;
    else
    else
    307
    matchp = 0 <= this.matchString(con, cop.condition, offset, dx, opts);
    307
    matchp = 0 <= this.matchString(con, cop.condition, offset, dx, opts);
    307
    matchp = 0 <= this.matchCharacterIterator(con, cop.condition, offset, dx, opts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,cop.condition,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,cop.condition,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    307
    matchp = 0 <= this.matchCharacterIterator(con, cop.condition, offset, dx, opts);
    308
    if (matchp)
    308
    if (matchp)
    309
    op = cop.yes;
    309
    op = cop.yes;
    310
    else if (cop.no != null)
    310
    else if (cop.no != null)
    311
    op = cop.no;
    311
    op = cop.no;
    else
    else
    312
    op = cop.next;
    312
    op = cop.next;
    313
    break;
    313
    break;
    314
    default:
    314
    default:
    315
    throw new RuntimeException("Unknown operation type: " + op.type);
    315
    throw new RuntimeException("Unknown operation type: " + op.type);
    Precondition Violations (106)
    Row Violation
    1Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    4Expression target.charAt(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression target.setIndex(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    7Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    10Expression target.charAt(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression target.setIndex(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    13Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    16Expression target.charAt(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression target.setIndex(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    19Expression target.charAt(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression target.setIndex(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    22Expression target.charAt(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Expression target.setIndex(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    25Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    28Expression target.charAt(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29Expression target.setIndex(++offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    31Expression target.charAt(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    32Expression target.setIndex(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    33Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    34Expression target.charAt(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    35Expression target.setIndex(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    36Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    37Expression target.charAt(offset - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    38Expression target.setIndex(offset - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    39Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    40Expression target.charAt(offset - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    41Expression target.setIndex(offset - 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    42Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    43Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    44Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    45Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    46Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    47Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    48Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    49Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    50Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    51Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    52Expression target.charAt(offset + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    53Expression target.setIndex(offset + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    54Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    55Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    56Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    57Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    58Expression target.charAt(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    59Expression target.setIndex(offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    60Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    61Expression target.charAt(offset + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    62Expression target.setIndex(offset + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    63Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    64Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    65Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    66Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    67Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    68Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    69Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    70Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    71Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    72Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    73Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    74Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    75Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    76Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    77Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    78Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    79Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    80Expression this.matchString(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    81Expression this.matchCharacterIterator(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    82Expression this.matchString(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    83Expression this.matchCharacterIterator(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    84Expression this.matchString(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    85Expression this.matchCharacterIterator(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    86Expression this.matchString(con,op.elementAt(i),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    87Expression this.matchCharacterIterator(con,op.elementAt(i),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    88Expression this.matchString(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    89Expression this.matchCharacterIterator(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    90Expression this.matchString(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    91Expression this.matchCharacterIterator(con,op.next,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    92Expression this.matchString(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    93Expression this.matchCharacterIterator(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    94Expression this.matchString(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    95Expression this.matchCharacterIterator(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    96Expression this.matchString(con,op.getChild(),offset,-1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    97Expression this.matchCharacterIterator(con,op.getChild(),offset,-1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    98Expression this.matchString(con,op.getChild(),offset,-1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    99Expression this.matchCharacterIterator(con,op.getChild(),offset,-1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    100Expression this.matchString(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    101Expression this.matchCharacterIterator(con,op.getChild(),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    102Expression this.matchString(con,op.getChild(),offset,dx,localopts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    103Expression this.matchCharacterIterator(con,op.getChild(),offset,dx,localopts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    104Expression this.matchString(con,cop.condition,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    105Expression this.matchCharacterIterator(con,cop.condition,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    106Clone fragment #1 returns variables op, offset , while Clone fragment #2 returns variables op, offset