10788-2-5

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:
case Op.LOOKAHEAD: if (0 > this. matchCharArray (con, op.getChild(), offset, 1, opts)) return -1; op = op.next; break; case Op.NEGATIVELOOKAHEAD: if (0 <= this. matchCharArray (con, op.getChild(), offset, 1, opts)) return -1; op = op.next; break; case Op.LOOKBEHIND:

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 matchCharacterIterator(Context, Op, int, int, int)` |  | Method name: `int matchCharArray(Context, Op, int, int, int)`
Number of AST nodes: 11 |  | Number of AST nodes: 11

1

    case Op.LOOKAHEAD:↵

1

    case Op.LOOKAHEAD:↵

2

                      if (0 > this. matchCharacterIterator (con, op.getChild(), offset, 1, opts))  return -1;↵

2

                      if (0 > this. matchCharArray (con, op.getChild(), offset, 1, opts))  return -1;↵

3

                      op = op.next;↵

3

                      op = op.next;↵

4

                      break;↵

4

                      break;↵

5

                  case Op.NEGATIVELOOKAHEAD:↵

5

                  case Op.NEGATIVELOOKAHEAD:↵

6

                      if (0 <= this. matchCharacterIterator (con, op.getChild(), offset, 1, opts))  return -1;↵

6

                      if (0 <= this. matchCharArray (con, op.getChild(), offset, 1, opts))  return -1;↵

7

                      op = op.next;↵

7

                      op = op.next;↵

8

                      break;↵

8

                      break;↵

9

                  case Op.LOOKBEHIND:

9

                  case Op.LOOKBEHIND:

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.9
Clones location | Clones are declared in the same class
Number of node comparisons | 51

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 11
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 127.3
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   263

       case Op.LOOKAHEAD:

   263

       case Op.LOOKAHEAD:

   264

       if (0 > this.matchCharacterIterator(con, op.getChild(), offset, 1, opts))

   264 | if (0 > this.matchCharacterIterator(con, op.getChild(), offset, 1, opts))
   264 | if (0 > this.matchCharArray(con, op.getChild(), offset, 1, opts))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   matchCharacterIterator | matchCharArray | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations

   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

   Expression this.matchCharArray(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   - Inline private method matchCharArray

   264

       if (0 > this.matchCharArray(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.matchCharacterIterator(con, op.getChild(), offset, 1, opts))

   269 | if (0 <= this.matchCharacterIterator(con, op.getChild(), offset, 1, opts))
   269 | if (0 <= this.matchCharArray(con, op.getChild(), offset, 1, opts))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   matchCharacterIterator | matchCharArray | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations

   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

   Expression this.matchCharArray(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   - Inline private method matchCharArray

   269

       if (0 <= this.matchCharArray(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:

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Expression this.matchCharacterIterator(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression this.matchCharArray(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression this.matchCharacterIterator(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression this.matchCharArray(con,op.getChild(),offset,1,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted