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 [ ++offset ] ); if (isEOLChar(ch)) return -1; }
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; }
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 matchCharArray(Context, Op, int, int, int) Method name: int matchCharacterIterator(Context, Op, int, int, int)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (isSet(opts, SINGLE_LINE)) {
1
if (isSet(opts, SINGLE_LINE)) {
2
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
2
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
3
                              offset ++;
3
                              offset ++;
4
                      } else {
4
                      } else {
5
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
5
                          if (REUtil.isHighSurrogate(ch) && offset+1 < con.limit)
6
                              ch = REUtil.composeFromSurrogates(ch,  target [  ++offset ] );
6
                              ch = REUtil.composeFromSurrogates(ch,  target .setIndex(  ++offset ) );
7
                          if (isEOLChar(ch))
7
                          if (isEOLChar(ch))
8
                              return -1;
8
                              return -1;
9
                      }
9
                      }
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)1.2
Clones locationClones are declared in the same class
Number of node comparisons30
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)20.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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[++offset]);
    39
    ch = REUtil.composeFromSurrogates(ch, target[++offset]);
    39
    ch = REUtil.composeFromSurrogates(ch, target.setIndex(++offset));
    Differences
    Expression1Expression2Difference
    target[++offset]target.setIndex(++offset)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression target[++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
    39
    ch = REUtil.composeFromSurrogates(ch, target.setIndex(++offset));
    40
    if (isEOLChar(ch))
    40
    if (isEOLChar(ch))
    41
    return -1;
    41
    return -1;
    Precondition Violations (2)
    Row Violation
    1Expression target[++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